-- Load the package |
success = .ooSQLExtensions~loadPackage(packageFile) |
if \\ success then do |
say 'Failed to load package' |
say ' Error code: ' .ooSQLExtensions~lastErrCode |
say ' Error message:' .ooSQLExtensions~lastErrMsg |
|
return .ooSQLExtensions~lastErrCode |
end |
|
... |
|
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE) |
|
-- Get the package and register a single function |
package = .ooSQLExtensions~getPackage('examplePackage') |
|
function = package~getFunction('half') |
if function == .nil then do |
say 'Failed to get function: half' |
say ' Error code: ' package~lastErrCode |
say ' Error message:' package~lastErrMsg |
|
return package~lastErrCode |
end |
|
dbConn~createFunction('half', function)
|