| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Good call on SQLITE_DBCONFIG_LOOKASIDE. Is the decision wrt SQLITE_DBCONFIG_MAINDBNAME due more to the risk of breaking existing code relying on the magic constant MAIN. or the memory lifetime requirements of its parameter? I'm surprised to see SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER made the cut given it gates operation of fts3_tokenizer(), which takes a C struct of function pointers. |
Sorry, something went wrong.
Well, those two are the only ones with non-standard arg spec, so by keeping them out we get a cleaner API. They are also pretty esoteric features IMO, so I'm not sure they're worth the added complexity.
Thanks, you're quite correct; there's no reason to expose that constant. |
Sorry, something went wrong.
Fair enough, though it seems like this runs a risk the SQLite project adds a desirable verb with non-int parameters in the future. I don't see an API analogue for sqlite3_config in Python to act as precedent1; would it make sense/be more idiomatic for the verbs to be subproperties of a config property on the database object? Something like: db.config.defensive = False There's still a type risk here—SQLite has a history of adding third options to formerly boolean configurations (like PRAGMA auto_vacuum) but it's not nearly as rigid Footnotes
|
Sorry, something went wrong.
Yep, that's a risk, but we can expand the scope of the new Python API later, so it's not too big of a risk. Another option is of course the namespace design you hinted at.
The problem with that SQLite C API, is that it must be called prior to SQLite initialisation. Currently, that happens during sqlite3 initialisation. We initialise SQLite explicitly with a call to sqlite3_initialize, and we kind of need it to stay like that, because the runtime library may have been compiled with SQLITE_OMIT_AUTOINIT. I see four possible paths:
Anyway, this discussion is off-topic for this PR :) If you want to follow this up, please create a topic on Discourse; we can continue there. |
Sorry, something went wrong.
A namespace could of course be an option, but I think a simple get/set pair is a cleaner API for this feature (both programmatically and regarding to documentation). (Also, we've already got setlimit() and getlimit() for connection limits.) |
Sorry, something went wrong.
|
@AlexWaygood: The added docs are quite sparse, but I'm hesitant to explode this PR by documenting every single constant. I've added a link to the SQLite docs, maybe that is enough. What do you think? |
Sorry, something went wrong.
This looks like a reasonable solution to me, but I'm not an SQLite expert :) |
Sorry, something went wrong.
There was a problem hiding this comment.
Docs approval!
Sorry, something went wrong.
|
Thanks everybody! I'll land this later today. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.