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

feat: allow URI filenames #571

Merged
merged 3 commits into from
Oct 30, 2024
Merged

feat: allow URI filenames #571

merged 3 commits into from
Oct 30, 2024

Conversation

flavorjones
Copy link
Member

@flavorjones
Copy link
Member Author

I think it might be better to not merge this -- the Open::URI bit can be passed where people want to pass a URI, and all the options available via URI are also available via the API.

What I really want is to be able to inject configuration options in a Rails app via the config/database.yml and so maybe it's better for me to do some work in the Rails sqlite3 adapter instead.

@flavorjones
Copy link
Member Author

flavorjones commented Oct 29, 2024

Since what I really want is to be able to inject behavior into the database of a Rails app via the database config, I'm going to shift focus to the sqlite adapter.

@flavorjones flavorjones reopened this Oct 29, 2024
@flavorjones
Copy link
Member Author

flavorjones commented Oct 29, 2024

Hrm, reopening. It's hard to set just this one Open::URI bit from Rails for each connection because of how the database configs are passed-through to SQLite3::Database#initialize.

@flavorjones
Copy link
Member Author

FWIW, it looks like the major distros compile with -DSQLITE_USE_URI=1, also (e.g. debian has compiled with it since 2019 / 3.27.1-1).

@flavorjones flavorjones force-pushed the flavorjones-feat-allow-uri branch from 1cb699e to a75a7f9 Compare October 29, 2024 19:10
@tenderlove
Copy link
Member

Ah, I didn't realize this was a feature natively supported by SQLite. Yes, we should do this.

there are a lot of caveats about them in
https://www.sqlite.org/uri.html and I don't have the energy to deal
with it today.
since the compile-time option may not be on
@flavorjones flavorjones force-pushed the flavorjones-feat-allow-uri branch from 4cd058c to 7e750ac Compare October 30, 2024 17:11
@flavorjones flavorjones enabled auto-merge (squash) October 30, 2024 17:12
@flavorjones flavorjones merged commit c15fc69 into main Oct 30, 2024
105 checks passed
@flavorjones flavorjones deleted the flavorjones-feat-allow-uri branch October 30, 2024 17:49
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.

2 participants