镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Faced 'Error: unable to open database "xxx.db": automatic extension loading failed: no extension with name 'http' registered'. #32

Open

Description

@avinashkurup

Hi,
I am attempting to statically link the sqlite-http extension with the amalgamation sqlite. I was able to succeed with another go extensions viz. sqlite-html. I face this error on extension loading in sqlite.

SQLite version 3.43.2 2023-10-10 12:14:04
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select http_get_body('https://text.npr.org/');
Error: unable to open database ":memory:": automatic extension loading failed: no extension with name 'http' registered

I find sqlite3_http_init included in the executable,

00000000001eea7f T sqlite3_global_recover
0000000000117a5a T sqlite3_hard_heap_limit64
0000000000400cf3 T sqlite3_html_init
000000000063a546 T sqlite3_http_init <------ calls go_sqlite3_extension_init
000000000063a596 T sqlite3_http_no_network_init
00000000000ea95b T sqlite3_ieee_init
00000000001e9b6d T sqlite3_initialize
00000000004034fe T _sqlite3_interrupt

nm -gC ./libsqlite_http0.a | grep 'go_sqlite3_extension_init'
000000000011e960 T _cgoexp_97bac8ba3e87_go_sqlite3_extension_init
U go_sqlite3_extension_init
U _cgoexp_97bac8ba3e87_go_sqlite3_extension_init
000000000000017e T go_sqlite3_extension_init
U go_sqlite3_extension_init


nm -gC html0.a | grep 'go_sqlite3_extension_init'
00000000001f3ea0 T _cgoexp_97bac8ba3e87_go_sqlite3_extension_init
U go_sqlite3_extension_init
U _cgoexp_97bac8ba3e87_go_sqlite3_extension_init
000000000000017e T go_sqlite3_extension_init
U go_sqlite3_extension_init


nm -gC ./sqlite | grep 'go_sqlite3_extension_init'
00000000005f76c0 T _cgoexp_97bac8ba3e87_go_sqlite3_extension_init
0000000000400eb0 T go_sqlite3_extension_init

where is go_sqlite3_extension_init defined, Please tell me what I am missing in the build process?

Thanks,

Activity

  1. avinashkurup commented on Oct 30, 2023

    @avinashkurup
    Author

    Hi, I am attempting to statically link the sqlite-http extension with the amalgamation sqlite. I was able to succeed with another go extensions viz. sqlite-html. I face this error on extension loading in sqlite.

    SQLite version 3.43.2 2023-10-10 12:14:04 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> select http_get_body('https://text.npr.org/'); Error: unable to open database ":memory:": automatic extension loading failed: no extension with name 'http' registered

    I find sqlite3_http_init included in the executable,

    00000000001eea7f T sqlite3_global_recover 0000000000117a5a T sqlite3_hard_heap_limit64 0000000000400cf3 T sqlite3_html_init 000000000063a546 T sqlite3_http_init <------ calls go_sqlite3_extension_init 000000000063a596 T sqlite3_http_no_network_init 00000000000ea95b T sqlite3_ieee_init 00000000001e9b6d T sqlite3_initialize 00000000004034fe T _sqlite3_interrupt

    nm -gC ./libsqlite_http0.a | grep 'go_sqlite3_extension_init' 000000000011e960 T _cgoexp_97bac8ba3e87_go_sqlite3_extension_init U go_sqlite3_extension_init U _cgoexp_97bac8ba3e87_go_sqlite3_extension_init 000000000000017e T go_sqlite3_extension_init U go_sqlite3_extension_init

    nm -gC html0.a | grep 'go_sqlite3_extension_init' 00000000001f3ea0 T _cgoexp_97bac8ba3e87_go_sqlite3_extension_init U go_sqlite3_extension_init U _cgoexp_97bac8ba3e87_go_sqlite3_extension_init 000000000000017e T go_sqlite3_extension_init U go_sqlite3_extension_init

    nm -gC ./sqlite | grep 'go_sqlite3_extension_init' 00000000005f76c0 T _cgoexp_97bac8ba3e87_go_sqlite3_extension_init 0000000000400eb0 T go_sqlite3_extension_init

    where is go_sqlite3_extension_init defined, Please tell me what I am missing in the build process?

    Thanks,

    Issue with SQLite HTTP Extension Compilation

    Hi,

    I am using the http extension in a custom build. I aim to obtain a static library that can be linked with the amalgamation SQLite version.

    I've observed that the $(TARGET_OBJ) in the Makefile produces a file named sqlite-http/dist/http0.o. However, this seems to be a static library rather than an object file, as evident from the following:

    $ file ./sqlite-http/dist/http0.o 
    ./sqlite-http/dist/http0.o: current ar archive

    Is it necessary to compile the shared.c file, given it contains the entry point? Notably, the sqlite-html extension seems to function correctly. I am keen on making the sqlite-http extension operational as well.

    Any guidance would be immensely appreciated.

  2. asg017 commented on Oct 30, 2023

    @asg017
    Owner

    A few notes:

    Do you mind sharing the compile flags you've tried so far?

  3. avinashkurup commented on Oct 31, 2023

    @avinashkurup
    Author

    Thank you, These are the compile flags I have been using for compiling the static library for Linux.

    GO_BUILD_LDFLAGS=-ldflags '-X main.Version=v$(VERSION) -X main.Commit=$(COMMIT) -X main.Date=$(DATE)'
    GO_BUILD_CGO_CFLAGS=CGO_ENABLED=1 CGO_CFLAGS="-DUSE_LIBSQLITE3" CPATH="$(VENDOR_SQLITE) -gcflags "all=-N -l""

  4. riyaz-ali commented on Nov 21, 2023

    @riyaz-ali

    Are you trying to embed this extension in another application?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions