Closed JuanSantosGomez closed 2 years ago
Hello @JuanSantosGomez
I've done some experimenting myself and it seems that this issue is fixed if you enable fk support by adding following line before opening the database:
db.foreign_keys = true
Most likely SQLiteStudio enables foreign keys for the database automatically whenever it detects that you are using fk in any of your tables. This is something I could definitely look into automating as well.
Oh it works! thanks @2shady4u !
So I tried turning on fk through the query statement before this as well but it didn't work. It's good to know we can do it the way you did it.
It seems like this is an oversight on my part as it seems this is also stated in the documentation on the front page. Apologies for that, and thank you for spending time on this. Have a great weekend! ;)
Ran into the same problem, and it can also be fixed by querying PRAGMA foreign_keys=ON
after opening the database.
First of all thank you for this wonderful plugin. This is a really great tool and this really opens up a lot of possibilities for beginners such as myself to delve into the nitty gritty stuff of game development. Awesome job! :)
Anyways, here's my little issue:
I've setup two tables with a foreign key field on one table set to
ON CASCADE DELETE
. When executing a delete query from the sqlite browser, to delete an entry from the parent table, the entry on the child table gets deleted. However, when I run the same query on Godot with the plugin using thequery()
function, the child table entry that's linked through the fk is not deleted.Here's the create statements for context:
and the delete query,
Steps to reproduce:
skills_details
to an entry onskills_skills
by havingskills_details
skill_id
match theid
onskills_skills
.skills_details
got deleted.