Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clean up sqlite3.Connection APIs #108278

Closed
Closed
Labels
@erlend-aasland

Description

@erlend-aasland

Feature or enhancement

Has this already been discussed elsewhere?

https://discuss.python.org/t/clean-up-some-sqlite3-apis/32093

Links to previous discussion of this feature:

#87260 (comment)

Proposal:

The sqlite3.Connection class has groups of similar APIs with inconsistent parameter specs.

Create user-defined function APIs:

  • create_function(name, narg, func, *, deterministic=False)
  • create_aggregate(name, /, n_arg, aggregate_class)
  • create_window_function(name, num_params, aggregate_class, /)
  • create_collation(name, callable, /)

Set callback APIs:

  • set_authorizer(authorizer_callback)
  • set_progress_handler(progress_handler, n)
  • set_trace_callback(trace_callback)

For all APIs butcreate_function, I suggest to make all parameters positional-only; forcreate_function, I suggest to make the three first parameters positional-only:

Create user-defined function APIs:

  • create_function(name, nargs, callable, /, *, deterministic=False)
  • create_aggregate(name, nargs, aggregate_class, /)
  • create_window_function(name, nargs, aggregate_class, /)
  • create_collation(name, callable, /)

Set callback APIs:

  • set_authorizer(authorizer_callback, /)
  • set_progress_handler(progress_handler, /, n)
  • set_trace_callback(trace_callback, /)

Obviously,create_window_function stays as it is.

UPDATE: I noticed the docs are wrong aboutcreate_collation; it's signature is actuallycreate_collation(name, callable, /).

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp