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

Make DuckDB connection a singleton #206

Closed
wants to merge 2 commits into from
Closed

Make DuckDB connection a singleton #206

wants to merge 2 commits into from

Conversation

JelteF
Copy link
Collaborator

@JelteF JelteF commented Sep 23, 2024

In #174 we made the DuckDB database a singleton, but a new DuckDB connection was still being created for every query. This means that any connection state, such as SET commands or temporary tables don't survive a single query, which is pretty confusing. This addresses that by also making the duckdb::Connection a singleton, this way a Postgres connection and a DuckDB connection are linked 1-to-1.

In #174 we made the DuckDB database a singleton, but a new DuckDB
connection was still being created for every query. This means that any
connection state, such as SET commands or temporary tables don't survive a
single query, which is pretty confusing. This addresses that by also
making the `duckdb::Connection` a singleton, this way a Postgres
connection and a DuckDB connection are linked 1-to-1.
@JelteF JelteF marked this pull request as draft September 25, 2024 16:51
@JelteF
Copy link
Collaborator Author

JelteF commented Sep 30, 2024

FYI I'm postponing working on this until later, since it's not needed for the first release and the current implementation has bugs with non-obvious causes.

@JelteF JelteF added this to the 0.2.0 milestone Sep 30, 2024
@JelteF JelteF added the enhancement New feature or request label Sep 30, 2024
JelteF added a commit that referenced this pull request Oct 7, 2024
Since #247 is merged PostgresContextState is not actually used anymore.
So this removes it completely. This will make a bunch of PRs easier to
implement, specifically #241 and #206.
JelteF added a commit that referenced this pull request Oct 7, 2024
Since #247 is merged PostgresContextState is not actually used anymore.
So this removes it completely. This will make a bunch of PRs easier to
implement, specifically #241 and #206.
@JelteF
Copy link
Collaborator Author

JelteF commented Nov 11, 2024

Closing this in favor of #413

@JelteF JelteF closed this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant