khairul169 / gdsqlite-native

SQLite module for Godot 3.x
MIT License
219 stars 41 forks source link

Using db.open(path) on a DB under res:// now uses open_buffered on non-editor builds #36

Open TGRCdev opened 5 years ago

TGRCdev commented 5 years ago

This pull request changes the behavior of SQLite.open(path). When path points to a database file under res://, it implicitly opens it using Godot's File class, allowing the use of packed databases without the user needing additional boiler plate code to use open_buffered.

This does not occur in scripts running in the editor, so tool scripts will still be able to write to databases under res://.

This has been tested on Windows 10 64-bit using the item_database example.