sqlitedelphicommandfiredacanydac

Enabling SQLite Foreign Keys without command


Is there a way to enable the SQLite Foreign Keys with the TFDQuery component and without using a sql command?

I build a SQLite DB with foreign keys and it works, also without enabling that option. However, I might better use it.


LuMa


Solution

  • It would be possible to enable foreign key enforcement by default with the SQLITE_DEFAULT_FOREIGN_KEYS compilation option, but this would require recompiling the database (driver).

    Otherwise, you have no choice but to execute an SQL command.