2shady4u / godot-sqlite

GDExtension wrapper for SQLite (Godot 4.x+)
MIT License
850 stars 76 forks source link

Document attach database shenanigans #140

Open skysphr opened 1 year ago

skysphr commented 1 year ago

I've discovered that in order to use "ATTACH DATABASE", one should use ProjectSettings.globalize_path(path) on the database path and throw that into the query. For paths in res://, exported projects should use OS.get_executable_path().get_base_dir() as a base directory, as per the docs.

2shady4u commented 1 year ago

Hello @skysphr

Thank you for reporting this :) I will see if I can add the necessary documentation to the README.md

ionous commented 10 months ago

regarding attach and the item on the faq My Android/iOS/HTML5 application cannot access the database! -- one possible solution might be to attach a read-only db ( in res ) to a writable one ( in user. )

i haven't tried it but this stackoverflow seems to indicate it might work. https://stackoverflow.com/questions/4637790/sqlite3-read-only-main-database-and-attach