-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi everyone
So I ran into an issue when using Octo with a compiled executable. Such a compiled executable doesn't like it when you try to load code dynamically during runtime and it can't use the functions loaded. This is a problem because Octo dynamically loads backend code when Repo.connect is called. But I found a little workaround, namely calling Octo.Backends.backend deliberately in the root of the compiled module. Here's an example based on the PackageCompiler example of an compiled executable:
module Test
using Octo.Adapters.SQLite
Octo.Backends.backend(Octo.Adapters.SQLite) # without this function call the compiled executable fails.
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
Repo.connect(adapter = Octo.Adapters.SQLite, dbfile = "test.sqlite")
Repo.execute(Raw("""
CREATE TABLE IF NOT EXISTS Test (
ID integer not null primary key,
Name nvarchar(128) not null
)"""))
return 0
end
endI'm sharing this in case anybody else runs into this problem. (And so the devs of Octo know there's a small problem of course.)
Cheers,
Wieke
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels