react-native-sqlite-storage icon indicating copy to clipboard operation
react-native-sqlite-storage copied to clipboard

db.executeSql('PRAGMA foreign_keys = ON');

Open viveKing21 opened this issue 7 months ago • 0 comments

          db.executeSql('PRAGMA foreign_keys = ON');

Execute this after creating connection and it will solve your issue .. it worked for me.

Originally posted by @AdnanAshraf-pro in https://github.com/andpor/react-native-sqlite-storage/issues/478#issuecomment-934100851

‘PRAGMA foreign_keys=ON;’ executed and success callback invokes, but after that if I check ‘PRAGMA foreign_keys;’ it gives result ‘{foreign_keys:0}’ and its not working, accepting any integer as FK and CASCADE not working on Delete.

android devices

viveKing21 avatar Jan 19 '24 08:01 viveKing21