You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is that right way to store and retrieve blobs in table? Trying to store array of dicts in table and retrieve it.
If i understand correctly blobs are stored as string and you must convert String to Bytes and Bytes to actual data.
extendsNodefunc_ready() ->void:
vardb=SQLite.new()
db.path=":memory:"db.open_db()
varlist:= [{"id": "sword"}, {"id": "potion"}]
db.query(" CREATE TABLE IF NOT EXISTS actors ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, items BLOB NOT NULL); INSERT INTO actors (name, items) VALUES ('Bob', '%s'); "%var_to_bytes(list))
db.query("SELECT * FROM actors")
print(bytes_to_var(str_to_var(db.query_result[0].items)))
db.close_db()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is that right way to store and retrieve blobs in table? Trying to store array of dicts in table and retrieve it.
If i understand correctly blobs are stored as string and you must convert String to Bytes and Bytes to actual data.
This part feels clunky:
Beta Was this translation helpful? Give feedback.
All reactions