-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't load extension from crawshaw.io/sqlite #16
Comments
I'm not sure if it's this repo, or the other, or some issue due to this being Go->C->C->Go. The issue persists even when trying to register stuff directly on the |
Re the 1st error: I have seen this when loading Go SQLite extensions in a Go environment. To put it shortly, I don't think it's possible, but finding an exact reason why has been hard. This thread might have more info: https://groups.google.com/g/golang-nuts/c/omI57CgJj20 From what I can tell, Go's However, I've been able to run multiple Go SQLite extensions from a "host" from C or Rust (ex loading 2 extensions built with this library from the Re the 2nd error: That error message seems to originate here, which was a recent addition to the library (#10) - do you have more info on how you get this? |
I have done more experimentation on this. I think both messages above are due to having 2 runtimes loaded, it's just nondeterministic where you will see the first failure. I am able to load the extension from crawshaw importing my extension code directly in Go (without the main and the implicit registration) and creating an I think some of this has some value to be contributed, I mentioned in #2 (comment). It would be great to know if I've missed how to do this already or if my changes were actually necessary for this use case. Thanks for jumping in @asg017 ! |
I do believe my theory above is correct. The only available solution (Go limitation) for now is to document how to work around this case. See #2. |
I usually get this:
or
sqlite.Conn.LoadExtension: SQLITE_ERROR: error during initialization: no extension with name 'default' registered
.The first I suspect to be some kind of GC disagreement. The latter might be related to multiple Go runtimes? I'm not sure what happens if a Go process tries to load to load a c-shared binary that I think also contains a Go runtime.
The text was updated successfully, but these errors were encountered: