Skip to content

Conversation

jrauh01
Copy link
Contributor

@jrauh01 jrauh01 commented Dec 9, 2024

Add sqlite support to use in memory databases for example in unit tests. (Like in #102)

@jrauh01 jrauh01 self-assigned this Dec 9, 2024
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Dec 9, 2024
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

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

First of all, thanks for this PR. While skimming older open PRs, I stumbled upon this one and its modernc.org/sqlite dependency.

Besides the one comment about the library, could you please describe the motivation for this change and its necessity? Where is it needed and why?

@Al2Klimov
Copy link
Member

could you please describe the motivation for this change and its necessity? Where is it needed and why?

@jrauh01 It's for some kind of automatic tests, right?

@jrauh01
Copy link
Contributor Author

jrauh01 commented Jul 4, 2025

Right, like described above it's for mocking databases in e.g. unit tests.

mode = "mode=memory&"
}

addr = fmt.Sprintf("file:%s?%scache=shared", name, mode)
Copy link
Member

Choose a reason for hiding this comment

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

As I was just fiddling with some other SQLite application, I realized that by default foreign key constraints are not enforced unless _foreign_keys is set accordingly. After fixing this on my side, I remembered this PR and would suggest adding this here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants