GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-45243: Add support for setting/getting `sqlite3` connection limits by erlend-aasland · Pull Request #28463 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Sep 19, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue45243

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Erlend E. Aasland added 4 commits September 20, 2021 00:37
Erlend E. Aasland
bpo-45243: Add support for setting/getting sqlite3 connection limits
39d69ce
Erlend E. Aasland
Add docs
6fd1c74
Erlend E. Aasland
Add NEWS
3514179
Erlend E. Aasland
Add What's New
c5abeb0
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner September 19, 2021 23:29
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 19, 2021
@bedevere-bot bedevere-bot added the awaiting review label Sep 19, 2021
@erlend-aasland
erlend-aasland requested review from pablogsal and serhiy-storchaka September 19, 2021 23:30
Erlend E. Aasland added 2 commits September 20, 2021 01:33
Erlend E. Aasland
SQLITE_LIMIT_WORKER_THREADS appeared in SQLite 3.8.7
76d2c2b
https://sqlite.org/changes.html
Erlend E. Aasland
Merge branch 'main' into sqlite-limits
2373a95
@erlend-aasland

erlend-aasland commented Oct 7, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Thinking about this, I wonder if connection limits are better implemented as attributes:

import sqlite3
cx = sqlite3.connect(":memory:")
lim = cx.SQLITE_LIMIT_LENGTH
cx.SQLITE_LIMIT_LENGTH = 100

# instead of
lim = cx.getlimit(sqlite3.SQLITE_LIMIT_LENGTH)
cx.setlimit(sqlite3.SQLITE_LIMIT_LENGTH, 100)

I added GH-28790 as an alternative implementation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Oct 7, 2021
bpo-45243: Expose SQLite connection limits as sqlite3.Connection attributes #28790
Closed
serhiy-storchaka
serhiy-storchaka reviewed Oct 7, 2021
View reviewed changes
Comment thread Modules/_sqlite/connection.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_sqlite/connection.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_sqlite/connection.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_sqlite/module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 2 commits October 7, 2021 20:30
Erlend E. Aasland
Remove debug print
a51f286
Erlend E. Aasland
Raise ProgrammingError if limit is out of bounds
e093a99
@erlend-aasland
erlend-aasland requested a review from serhiy-storchaka October 7, 2021 18:42
Erlend E. Aasland added 3 commits October 7, 2021 20:46
Erlend E. Aasland
SQLITE_LIMIT_WORKER_THREADS is defined in SQLite 3.8.7, not 3.8.3
fced0ce
https://sqlite.org/changes.html#version_3_8_7
Erlend E. Aasland
SQLite version is found in sqlite3.sqlite_version_info, not sqlite3.v…
4f7c2c0
…ersion_info
Erlend E. Aasland
Improve argument spec
5e2ae97
- Use 'category' for limit category
- Use 'limit' for the new limit
@erlend-aasland

erlend-aasland commented Oct 8, 2021

Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka I changed the argument spec:

  • setlimit(limit, value, /) => setlimit(category, limit, /)
  • getlimit(limit, /) => getlimit(category, /)

I believe this is clearer and more aligned with the SQLite documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland
Drop 'Non-standard' from docstring
1c36d95
@erlend-aasland

erlend-aasland commented Oct 8, 2021

Copy link
Copy Markdown
Contributor Author

PTAL, @serhiy-storchaka.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 2 commits October 21, 2021 09:42
Erlend E. Aasland
Expand test suite
eb6c233
Erlend E. Aasland
Merge branch 'main' into sqlite-limits
c1d828f
@erlend-aasland

erlend-aasland commented Oct 29, 2021

Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka I believe all comments have been resolved. Would you like to take another look at this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Oct 29, 2021
bpo-45634: Don't combine error checks when adding sqlite3 int constants #29251
Merged
Erlend E. Aasland added 2 commits October 31, 2021 11:48
Erlend E. Aasland
Merge branch 'main' into sqlite-limits
28b514a
Erlend E. Aasland
Merge branch 'main' into sqlite-limits
872f1ef
@erlend-aasland

erlend-aasland commented Nov 1, 2021

Copy link
Copy Markdown
Contributor Author

@pablogsal would you mind taking a look at this? I believe I've addressed all of Serhiy's comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal approved these changes Nov 1, 2021
View reviewed changes

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Nov 1, 2021
@pablogsal
pablogsal merged commit b6b38a8 into python:main Nov 1, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 1, 2021
@erlend-aasland
erlend-aasland deleted the sqlite-limits branch November 1, 2021 22:53
@JelleZijlstra JelleZijlstra mentioned this pull request Apr 15, 2022
sqlite3: add 3.11 additions python/typeshed#7625
Merged
JelleZijlstra added a commit to JelleZijlstra/typeshed that referenced this pull request Apr 15, 2022
@JelleZijlstra
sqlite3: add 3.11 additions
0ba23bb
- Blob from python/cpython#30680 (and anticipating that python/cpython#91550 will be merged)
- Aggregate window functions from python/cpython#20903
- Serialize/deserialize from python/cpython#26728
- Limit setting from python/cpython#28463
srittau pushed a commit to python/typeshed that referenced this pull request Apr 16, 2022
@JelleZijlstra
sqlite3: add 3.11 additions (#7625)
d802e65
- Blob from python/cpython#30680 (and anticipating that python/cpython#91550 will be merged)
- Aggregate window functions from python/cpython#20903
- Serialize/deserialize from python/cpython#26728
- Limit setting from python/cpython#28463
@erlend-aasland erlend-aasland mentioned this pull request May 16, 2022
[sqlite3] add support for changing connection limits #89406
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@serhiy-storchaka serhiy-storchaka Awaiting requested review from serhiy-storchaka

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@erlend-aasland @serhiy-storchaka @pablogsal @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.