Skip to content

Allow schema-referencing foreign keys in sqlite backend#1056

Open
fnimick wants to merge 5 commits intoSeaQL:masterfrom
fnimick:allow-sqlite-foreign-key
Open

Allow schema-referencing foreign keys in sqlite backend#1056
fnimick wants to merge 5 commits intoSeaQL:masterfrom
fnimick:allow-sqlite-foreign-key

Conversation

@fnimick
Copy link

@fnimick fnimick commented Feb 12, 2026

This is implemented by stripping the foreign key target table schema reference, as sqlite syntax does not support it.

Foreign keys from a table not in a schema targeting a table in a schema, or vice versa, or foreign keys from a table in one schema targeting a table in a second schema are not supported by sqlite. An explicit error is raised in this case.

New Features

  • allows the sqlite backend to create a table in a schema, with a foreign key to a table in the same schema

This is implemented by stripping the foreign key schema reference, as
sqlite syntax does not support it.
@fnimick
Copy link
Author

fnimick commented Feb 13, 2026

In the latest commit, I've also updated the sqlite backend to explicitly fail on db.schema.table references as these are illegal under the sqlite parser. Let me know if you'd prefer me to move that to another PR.

@fnimick fnimick force-pushed the allow-sqlite-foreign-key branch from 6fbe2c4 to 4eea982 Compare February 13, 2026 01:03
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.

1 participant