feat: finer-grained :mode support for Sqlite3.open (align with sqlite3_open_v2)#348
Open
dl-alexandre wants to merge 1 commit into
Open
Conversation
Member
|
You've got a merge conflict on the change log. Should be easy to rectify. Rebase off of main and adjust the entry up into the unreleased section. Sorry I cut a release yesterday. |
…3_open_v2) - `:readwrite` atom keeps backward-compatible "create if needed" behavior. - Lists now allow precise control: - `[:readwrite]` for read/write without CREATE (errors if file missing). - `[:readwrite, :create]` (or default list form) for with create. - `:create` supported in lists. - Updated types, docs, error messages, and tests. - Added test covering no-create list vs compat default. Refs elixir-sqlite#347 (proposal accepted in spirit by maintainer @warmwaffles). This is a non-breaking enhancement for users who opt into list forms.
345a9ea to
85c76ec
Compare
Contributor
Author
|
Thanks @warmwaffles — rebased the branch onto latest main (v0.37 bump + sqlite 3.53.2 etc.), and moved the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds finer-grained control over the
:modeoption (why: to align the public API with the underlying sqlite3_open_v2 flags as proposed and welcomed by the maintainer in #347, while preserving backward compat for the common case).Add finer-grained control over the
:modeoption when opening SQLite databases viaSqlite3.open/2(and thusExqlite.start_link/1etc.).This implements the alignment with
sqlite3_open_v2flags proposed in #347. The maintainer indicated openness to the change (preferring to keep the ergonomic default via lists).Changes
:readwriteatom form is preserved for backward compatibility (still implies CREATE).mode: [:readwrite]— read/write only (will fail to open non-existing files).mode: [:readwrite, :create]— the previous "default" behavior.:createis now a first-class list element.:nomutex, etc.) continue to work.@type, docs, error messages, and added a regression test.This is non-breaking for the common
mode: :readwrite/ default usage while enabling the use-case from the issue (and URI?mode=rwetc. documented behavior).Validation
[:readwrite](no create) vs. default atom and explicit create list.Refs #347