Skip to content

Database connection control options #1399

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

Merged
merged 6 commits into from
Feb 19, 2025
Merged

Database connection control options #1399

merged 6 commits into from
Feb 19, 2025

Conversation

trueqbit
Copy link
Collaborator

  • Introduced a connection control struct as an aggregate of options. This opens the way for various options and modes to establish a database connection, and can be used to make certain assumption in a multi-threading environment. E.g. make_storage("", connection_control{.open_forever = true});. Also see PR #1392 : Add support for SQLite VFS and open mode flags #1393.
  • An 'on open' callback can now be specified in a declarative way to the make_storage() call. This finally solves the issue that in-memory databases didn't call the 'on open' callback. E.g. make_storage("", on_open([](sqlite3* db) {}));.
  • Reordered members of the connection holder. This will be important for upcoming multi-threading improvements (see PR Threadsafe connection #1395), avoiding false L1 cache sharing.

* Introduced a connection control struct as an aggregate of options. This opens the way for various options and modes to establish a database connection.
* An 'on open' callback can now be specified in a declarative way to the `make_storage()` call. This finally solves the issue that in-memory databases didn't call the 'on open' callback.
* Reordered members of the connection holder. This will be important for upcoming multi-threading improvements, avoiding false L1 cache sharing.
@trueqbit trueqbit requested a review from fnc12 February 16, 2025 13:46
@trueqbit trueqbit linked an issue Feb 16, 2025 that may be closed by this pull request
Older compilers such as Visual C++ 16.11 [msvc 1929] choke on deeply nested alias template expressions and can be made happy by unraveling these expressions.
@trueqbit trueqbit requested a review from fnc12 February 18, 2025 16:57
@trueqbit trueqbit merged commit 6249684 into dev Feb 19, 2025
3 checks passed
@trueqbit trueqbit deleted the connection_control branch February 19, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on_open is never called for in memory storage
2 participants