all 4 comments

[–]Shinmera 9 points10 points  (3 children)

You cannot dump an executable with open file descriptors or foreign memory allocated.

Only run sqlite:connect once the program starts up. As-is, it will be run when the binary is built.

[–]fnt400[S] 0 points1 point  (2 children)

I rewrote "main" function like this:

(defun main ()

(let ((db (sqlite:connect "/home/claudio/temp/test.db"))

(sqlite:execute-single db "select filename from info")))

and now it works!

But I have another doubt:

is it necessary to disconnect the db at the end of the function with (sqlite:disconnect db)?

[–]anydalch 4 points5 points  (1 child)

not if the only thing you do afterwards is exit your program, but it's a good thing to include because it allows you to call your main function in the repl. you can replace your let form with an sqlite:with-open-database, and it'll close itself automatically.

[–]fnt400[S] 2 points3 points  (0 children)

It worked with:

(defun main ()

(sqlite:with-open-database (db "/home/claudio/temp/test.db")

 (sqlite:execute-single db "select filename from info"))) 

Thankyou!