Here is my sample code. It kinda works but there is a problem.
The SQLite3 API for creating a function includes a prototype that described the return params. However, the nim-wrapper does not.
The example below compiles and executes, however, since I cannot determine how to return a value it does not pass the test.
import db_sqlite, sqlite3
# open the DB
let theDb = open("mytest.db", "", "", "")
# declare my function
proc hello(para1: Pcontext, para2: int32, para3: PValueArg){.cdecl.} = echo "hello"
# register the function
let ret = theDb.create_function("Hello", 0, 0, nil, hello, nil, nil)
echo "create function {ret}"
echo $ret
# test the extension
for x in theDb.fastRows(sql"SELECT hello()"):
echo x
# close the DB
# because I'm importing both db_sqlite and sqlite3 I need to be explicit or generate an error
db_sqlite.close(theDb)