3. Run the code. A file named "test.db" will be created. You can inspect the database to confirm that bytes `1, 2, 3` were added.
4. The code will crash with an FFI error.
I've made it possible to return simple pointers from functions.
In addition, I've added the &memcpy and &memfree system functions for working with pointers in ways that the ffi type:len_index syntax doesn't allow for.
Hopefully this should make a proper API for returning blobs possible.
Yet again, I'm not sure if I'm doing something wrong or a byte array as return value from a function is not supported.
Reproduction:
ColumnBlob
inlib.ua
, remove the assertion, uncomment the "Call" function line.$ CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, blob BLOB); Sqlite~Exec ⊙.
$ INSERT INTO test (blob) VALUES (X'010203'); Sqlite~Exec ⊙.
$ SELECT blob FROM test; Sqlite~Prepare ⊙. ◌Sqlite~StepRow . ◌?Sqlite~ColumnBlob 1
Sqlite~Close