You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.@ccallablefunctionjulia_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 )"""))
return0endend
I'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
The text was updated successfully, but these errors were encountered:
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 callingOcto.Backends.backend
deliberately in the root of the compiled module. Here's an example based on the PackageCompiler example of an compiled executable:I'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
The text was updated successfully, but these errors were encountered: