Skip to content

Fix SQLite database queries - #2696

Open
DamianX wants to merge 2 commits into
OpenDreamProject:masterfrom
DamianX:sqlite-query-execute-filename
Open

Fix SQLite database queries#2696
DamianX wants to merge 2 commits into
OpenDreamProject:masterfrom
DamianX:sqlite-query-execute-filename

Conversation

@DamianX

@DamianX DamianX commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Changed the following in order to make vgstation migrations and preferences actually work.

Made GetColumn() 1-indexed, as it is in BYOND.
Implemented /database/query.Execute(filename) (as opposed to Execute(database/db))
Execute() now returns 1 on success and 0 on failure.
Invalid Execute() arguments raise Bad database.
NextRow() now returns 1 when it advances to a row and 0 when exhausted.
Re-executing a query closes its prior reader and restarts the result set.

An existing comment mentioned that /icons could be turned into BLOBs in SQLite. That turned out to be true, but BYOND, at least in the latest version, does not seem to allow retrieving BLOBs from SQLite.
So:

  • File resources and /icon values are stored as BLOBs.
  • BLOB values read through DM query APIs return null. I guess, man.

@boring-cyborg boring-cyborg Bot added the Runtime Involves the OpenDream server/runtime label Aug 12, 2026
@DamianX
DamianX force-pushed the sqlite-query-execute-filename branch 3 times, most recently from 605b34f to 5ee3d76 Compare August 12, 2026 16:05
@DamianX
DamianX force-pushed the sqlite-query-execute-filename branch from b4d3b21 to abd94f1 Compare August 13, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Runtime Involves the OpenDream server/runtime size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant