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

Sync after each insert/update/delete of duckdb.secrets table #253

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

mkaruza
Copy link
Collaborator

@mkaruza mkaruza commented Oct 7, 2024

If duckdb.secrets table is inserted, updated or deleted in same connection we would not sync changes for next query. Introduce sequence that keeps track of each change so we can compare with and sync if required.

Fixes #215

@mkaruza mkaruza requested a review from JelteF October 7, 2024 12:23
@JelteF JelteF added the bug Something isn't working label Oct 7, 2024
If duckdb.secrets table is inserted, updated or deleted in same
connection we would not sync changes for next query. Introduce sequence
that keeps track of each change so we can compare with and sync if
required.
@wuputah
Copy link
Collaborator

wuputah commented Oct 7, 2024

This is tangential but while you are here, it would be nice to add a primary key to this table. I think an auto-increment column would be sorta nice it could probably be (type, id).

This will make it safer / easier when either editing or deleting values from this table to have a WHERE clause that ensures you are only affecting a single row.

Copy link
Collaborator

@JelteF JelteF left a comment

Choose a reason for hiding this comment

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

Using a sequence this way definitely feels like a bit of a hack, but it should work pretty well. And if we run into issues with it we can always change this.

@mkaruza
Copy link
Collaborator Author

mkaruza commented Oct 9, 2024

Using a sequence this way definitely feels like a bit of a hack, but it should work pretty well. And if we run into issues with it we can always change this.

Yes, but problem is multiple connections to same database. Modifying secrets table in one of connections should reflect to others as well.

@mkaruza mkaruza merged commit 68dab4f into main Oct 9, 2024
4 checks passed
@mkaruza mkaruza deleted the secret-changes branch October 9, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Secrets are not synced after first database query
3 participants