Skip to content

code-by-sia/xi-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xi-sqlite

Experimental SQLite bindings for Xi through extern "C".

Xi currently compiles to C and invokes cc, but does not document project-level linker metadata for extra native objects. This project keeps Xi's generated C with XC_KEEP_C=1, then links it with a small C99 SQLite bridge.

Layout

  • src/sqlite.xi: Xi API (open, close, exec, queryJson)
  • native/sqlite_bridge.c: C99 bridge around sqlite3
  • examples/demo.xi: runnable Xi demo
  • scripts/run-demo.sh: compile/link/run helper

Run

./scripts/run-demo.sh

Expected output:

[info] [{"id":1,"title":"hello from Xi"},{"id":2,"title":"sqlite bridge"}]

Requires SQLite headers/libs on the host. On macOS this should work when pkg-config --libs sqlite3 prints -lsqlite3.

Test

./scripts/run-tests.sh

The test runner uses the same XC_KEEP_C=1 compile/link flow as the demo and checks basic queries, empty result sets, JSON value encoding, SQL errors, and invalid handles.

About

SQLite library port for Xi language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors