mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Update SQLite deserialize to allow resizing restored DB (#701)
Using either option (FREEONCLOSE or RESIZEABLE) requires using sqlite3_malloc. Ref. #436
This commit is contained in:
parent
b850b14300
commit
bcae817215
2 changed files with 9 additions and 3 deletions
|
@ -7,7 +7,12 @@ backup = sqlite3.open_memory()
|
|||
buffer = LoadAsset("backup.sqlite3")
|
||||
backup:deserialize(buffer)
|
||||
|
||||
-- insert more values
|
||||
for i = 1, 250 do
|
||||
backup:exec("INSERT INTO test (content) VALUES ('Hello more')")
|
||||
end
|
||||
|
||||
-- See .init.lua for CREATE TABLE setup.
|
||||
for row in backup:nrows("SELECT * FROM test") do
|
||||
Write(row.id.." "..row.content.."<br>")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue