Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for setting SQLite limits #1548

Merged
merged 1 commit into from
Jul 31, 2022

Conversation

paulfitz
Copy link
Contributor

@paulfitz paulfitz commented Mar 2, 2022

This extends db.configure to support the sqlite3_limit method.

Calling db.configure('limit', sqlite3.LIMIT_XXX, value) is now equivalent to calling sqlite3_limit(db, SQLITE_LIMIT_XXX, value). For example, to prohibit attaching extra databases on a given database connection, you'd call db.configure('limit', sqlite3.LIMIT_ATTACHED, 0). The list of possible limits is taken from https://www.sqlite.org/c3ref/c_limit_attached.html

This is useful for selectively reducing limits. It cannot increase limits set at compile-time.

@paulfitz
Copy link
Contributor Author

paulfitz commented Mar 3, 2022

The single test failure looks unrelated:
Screenshot from 2022-03-03 10-15-19
Other runs look happier:
Screenshot from 2022-03-03 10-17-38

@daniellockyer
Copy link
Member

@paulfitz Would you be able to rebase the PR? 🙂

@daniellockyer daniellockyer self-assigned this Jul 31, 2022
This extends `db.configure` to support the `sqlite3_limit` method.
Calling `db.configure('limit', sqlite3.LIMIT_XXX, value)` is equivalent to
calling `sqlite3_limit(db, SQLITE_LIMIT_XXX, value)`.

For example, to prohibit attaching extra databases on a given database
connection, you'd call `db.configure('limit', sqlite3.LIMIT_ATTACHED, 0)`.
@paulfitz
Copy link
Contributor Author

@daniellockyer I've rebased the PR.

@daniellockyer daniellockyer changed the title support sqlite3_limit(id, value) via db.configure('limit', id, value) Added support for setting SQLite limits Jul 31, 2022
@daniellockyer daniellockyer merged commit 1bcbf70 into TryGhost:master Jul 31, 2022
@joebnb
Copy link

joebnb commented Sep 2, 2022

waiting for this feature come

@paulfitz paulfitz deleted the sqlite3-limit branch September 19, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants