Skip to content

horatio-sans-serif/gomix-sqlite-extensions-howto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A demo of using sqlite3 extensions on gomix

  • You need to know which version of sqlite is installed.
  • You need to know the OS architecture as well.
  • see /config for those.

With this, you can build SQLite extensions on some equivalent server.

  • Get a x86-64 Linux droplet on Digital Ocean for example (match the arch from /config).
  • Login as root.
  • apt install build-essential tclsh tcl-dev
  • Download sqlite source code for the same version. E.g. for 3.15.0
    • cd /tmp
    • wget -Osqlite.tar.gz 'http://www.sqlite.org/cgi/src/tarball/SQLite-70787558.tar.gz?uuid=707875582fcba352b4906a595ad89198d84711d8'
    • tar xzvf sqlite.tar.gz
    • cd SQLite-70787558
    • ./configure && make && make install

Download whatever extension code you want to build

Compile the extension

  • gcc -fPIC -lm -shared ext.c -o libmath.so

Upload the shared object

  • scp this file to your machine
  • drag it into gomix.com project
  • click the "asset" to copy its url

Download asset into your project at runtime

  • use the snippet in server.js to download the asset to the project's local data dir
  • open the sqlite db
  • load the extension

It's a bit convoluted but whatever!

About

sqlite3 does not come with a lot of functions but can load extensions. This is a bit tricky to configure on GoMix so here's an example.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published