godot-sqlite icon indicating copy to clipboard operation
godot-sqlite copied to clipboard

Document attach database shenanigans

Open skysphr opened this issue 1 year ago • 2 comments

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.

skysphr avatar Apr 18 '23 19:04 skysphr

Hello @skysphr

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

2shady4u avatar Jun 18 '23 11:06 2shady4u

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

ionous avatar Sep 27 '23 00:09 ionous