0

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

LuMa
  • 1,673
  • 3
  • 19
  • 41
  • 1
    What are you asking? I don't understand what "enable the SQLite Foreign Keys" means for you.... – Arnaud Bouchez Nov 16 '14 at 16:45
  • Sorry if wasn't very clear. SQLite docu says: "{ ... } it must still be enabled by the application at runtime, using the PRAGMA foreign_keys command." Instead of using PRAGMA foreign_keys = ON; command, is there way to enable this with code? – LuMa Nov 16 '14 at 16:57

1 Answers1

1

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.

CL.
  • 173,858
  • 17
  • 217
  • 259