Python - SQLite JSON1 load extension

后端 未结 2 461
醉梦人生
醉梦人生 2021-02-02 01:40

I want to use the json1 extension for SQLite within Python. According to the official documentation, it should be a loadable extension. I got the json1.c file from the source an

2条回答
  •  暖寄归人
    2021-02-02 02:03

    For anyone who's still trying to figure out how to build the json1 extension from source code, here it is:

    After you download the latest release source code from SQLite Source Repository, unzip it, cd into its folder and run ./configure.

    Then add the following to the generated Makefile:

    json1.dylib: json1.lo  
        $(LTCOMPILE) -c $(TOP)/ext/misc/json1.c  
        $(TCC) -shared -o json1.dylib json1.o  
    

    make is finicky, so be sure $(LTCOMPILE) and $(TCC) are preceded by TAB, not spaces!

    Then run make json1.dylib

    Reference: https://burrows.svbtle.com/build-sqlite-json1-extension-as-shared-library-on-os-x

提交回复
热议问题