lorefnon
Explore posts from serversHow to enable pragmas with SqliteDialect
Hello, I am using SqliteDialect and want to enable foreign_keys pragma.
From SQLite Docs:
Foreign key constraints are disabled by default (for backwards compatibility), so must be enabled separately for each database connection.I was trying to use SqliteDialect's onCreateConnection to enable this. But the issue is that
onCreateConnection
provides me a DatabaseConnection
instance. DatabaseConnection.executeQuery
expects a CompiledQuery
. To compile a query I can do something like but the problem is that I don't have a db
because I am creating a dialect which I will then use to create a db
.
Is there something I am missing or is there a better way to achieve this ?4 replies