How to set “PRAGMA foreign_keys = ON” each time I'm connecting to sqlite db via Datagrip

dba.stackexchange https://dba.stackexchange.com/questions/241726

  •  06-02-2021
  •  | 
  •  

Pregunta

In my pet project I'm working with small sqlite db and I've just came to realization that, in order to ON DELETE CASCADE actually do the thing, I need to set PRAGMA foreign_keys = ON each time I'm connecting to db.

However I'm using Datagrip and since it's quite new product to me I don't what's the best way to set this option every time.

¿Fue útil?

Solución

Please, go the SQLite driver options, Advanced tab and set true to foreign_keys parameter.

enter image description here

Otros consejos

As long as DataGrip does not have a built-in option for that, you have to write the command(s) in a startup script, and remember to configure it in the options of each new data source.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a dba.stackexchange
scroll top