1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 10:08:52 +08:00

Build sqlitelua for scalar, aggregate & table-valued UDFs in Lua (#118)

* Update base Docker images

* Use performance.now() instead of Date.now() for time promise tests

* Build sqlitelua: user scalar, aggregate & table-valued functions in Lua
This commit is contained in:
saaj
2024-08-25 21:03:34 +02:00
committed by GitHub
parent a2464d839f
commit 3f6427ff0e
10 changed files with 159 additions and 11 deletions

View File

@@ -24,6 +24,7 @@ cflags = (
# Compile-time optimisation
'-Os', # reduces the code size about in half comparing to -O2
'-flto',
'-Isrc', '-Isrc/lua',
)
emflags = (
# Base
@@ -61,6 +62,15 @@ def build(src: Path, dst: Path):
'-c', src / 'extension-functions.c',
'-o', out / 'extension-functions.o',
])
logging.info('Building LLVM bitcode for SQLite Lua extension')
subprocess.check_call([
'emcc',
*cflags,
'-shared',
*(src / 'lua').glob('*.c'),
*(src / 'sqlitelua').glob('*.c'),
'-o', out / 'sqlitelua.o',
])
logging.info('Building WASM from bitcode')
subprocess.check_call([
@@ -68,6 +78,7 @@ def build(src: Path, dst: Path):
*emflags,
out / 'sqlite3.o',
out / 'extension-functions.o',
out / 'sqlitelua.o',
'-o', out / 'sql-wasm.js',
])