Add/Improve SQLite compatiblity#778
Add/Improve SQLite compatiblity#778Soapy7261 wants to merge 9 commits intoBlueMap-Minecraft:masterfrom
Conversation
|
|
||
| $driver = 'mysql'; // 'mysql' (MySQL) or 'pgsql' (PostgreSQL) | ||
| $driver = 'mysql'; // 'mysql' (MySQL), 'pgsql' (PostgreSQL) or 'sqlite' (SQLite) | ||
| $sqlfile = 'bluemap.db'; // Only applies when using 'sqlite' as the driver |
There was a problem hiding this comment.
Comment for future self: This should probably specify it'll (most likely) require an absolute path instead of a relative path
There was a problem hiding this comment.
Should also specify that you'll need an extra driver on Windows for SQLite on PHP
nope, correct repo My thoughts about the PRAGMA statements: I also don't like the thought of having sqlite-specific settings in the |
|
(noted!) |
|
No, bluemap doesn't include any of the sql-drivers. |
|
Oh, I didn't realize none were bundled.. oops? |
|
While technically less configurable, I don't think there's really any reason to include the whole |
still need to make sure existing functionality works, and solve the TODOs, but otherwise this is working, I think!
|
Works for SQLite now and respects all PRAGMAs I tested, solving all |
|
|
This PR aims to add or improve compatibility/usage for SQLite databases.
While the BlueMap base already technically supports SQLite via the use of custom drivers, certain parts (such as the sql.php script) do not.
Compatibility todo:
Options that should be added, in order of how important they probably are (None of them should require any internal code changes?):
Option for enabling WAL (PRAGMA journal_mode = WAL;, definitely most important imo)Option(s?) for increasing cache size (PRAGMA cache_size = -20000;, negative means kilobytes, so 20MB cache, should be configurable though)Option for decreasing syncs (PRAGMA synchronous = NORMAL;, only safe to use with WAL, might lose the latest transactions on sudden power loss, but shouldn't corrupt the DB itself)Option for storing temporary tables in RAM (PRAGMA temp_store = memory;, not necessary with proper indexing)^ All options can be added by the user now
Other todo:
SQLITE_BUSYerrors, even if using WAL)@TODOs solved