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

Bug: db connection on android doesn't support ForeignKey #5

Closed
antailyaqwer opened this issue Mar 26, 2024 · 3 comments · Fixed by #6
Closed

Bug: db connection on android doesn't support ForeignKey #5

antailyaqwer opened this issue Mar 26, 2024 · 3 comments · Fixed by #6
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@antailyaqwer
Copy link
Contributor

As said in documentation, connection should enable foreign key support in runtime.
Please, add configuration for this or make this behavior enabled by default

@tamimattafi tamimattafi self-assigned this Mar 26, 2024
@tamimattafi tamimattafi added enhancement New feature or request bug Something isn't working labels Mar 26, 2024
@tamimattafi
Copy link
Owner

tamimattafi commented Mar 26, 2024

@antailyaqwer According to SQLDelight docs, Foreign Key support should be enabled during driver creation
https://cashapp.github.io/sqldelight/2.0.1/multiplatform_sqlite/foreign_keys/

I will add the required API to achieve this through KabinDatabaseConfiguration

tamimattafi pushed a commit that referenced this issue Mar 26, 2024
@tamimattafi
Copy link
Owner

tamimattafi commented Mar 26, 2024

@antailyaqwer Added new flags and callbacks to KabinDatabaseConfiguration in db530a3 (Except for js target)

Here's how you control ForeignKey behaviour:

val configuration = KabinDatabaseConfiguration(
    context = this,
    name = "sample-database",
    foreignKeyConstraintsEnabled = false
)

foreignKeyConstraintsEnabled is true by default

tamimattafi added a commit that referenced this issue Mar 26, 2024
feat: add support for foreign key configuration

Close #5
@tamimattafi
Copy link
Owner

Changes were published to 0.1.0-alpha03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants