Skip to content

Unify open and openInMemory with Location type#49

Merged
blaix merged 1 commit into
nextfrom
sqlite-open-location
May 11, 2026
Merged

Unify open and openInMemory with Location type#49
blaix merged 1 commit into
nextfrom
sqlite-open-location

Conversation

@blaix
Copy link
Copy Markdown
Contributor

@blaix blaix commented May 9, 2026

Closes #46

Thoughts on adding a ConnectionString variant? It could just be a pass-thru to DatabaseSync. That would make it a lot easier to configure the registry with environment variables for deployment. I'm torn because that's a pretty raw approach, and a true Uri option would be better, but it doesn't look like node's sqlite supports sqlite's uri config.

@blaix blaix requested a review from robinheghan May 9, 2026 15:33
@robinheghan
Copy link
Copy Markdown
Member

Thoughts on adding a ConnectionString variant?

It's an option, but I'm also hesitant. One of the things that makes me hesitant is that you can pass query params to set certain options, which can override or be overriden by the options record you pass to Sqlite.open. Not sure if that's a good idea :/

@blaix
Copy link
Copy Markdown
Contributor Author

blaix commented May 9, 2026

One of the things that makes me hesitant is that you can pass query params to set certain options

That's supported via Sqlite URIs but I don't think it is supported by the node API, which says the string has to be a file path or ":memory:". Which is why I was thinking ConnectionString instead of URI. But still probably too ambiguous.

Maybe a function like parseUri would be better. It could return an Options record. And location could be moved from its own parameter to a field on the options record.

@blaix
Copy link
Copy Markdown
Contributor Author

blaix commented May 10, 2026

I don't think I like moving location into the options. And a connection string that is node-api-specific doesn't feel right either. Happy to merge this as-is soon unless you have thoughts.

@robinheghan
Copy link
Copy Markdown
Member

I'm happy to merge this.

@blaix blaix merged commit eb4f26d into next May 11, 2026
@blaix blaix deleted the sqlite-open-location branch May 11, 2026 10:07
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