riscv-openocd-wch/jimtcl/sqlite3
imi415 6f2de615cf
Initial WCH codebase.
2022-03-29 17:01:37 +08:00
..
Makefile Initial WCH codebase. 2022-03-29 17:01:37 +08:00
README Initial WCH codebase. 2022-03-29 17:01:37 +08:00
build-ext Initial WCH codebase. 2022-03-29 17:01:37 +08:00
jim-sqlite.c Initial WCH codebase. 2022-03-29 17:01:37 +08:00
shell.c Initial WCH codebase. 2022-03-29 17:01:37 +08:00
sqlite3.c Initial WCH codebase. 2022-03-29 17:01:37 +08:00
sqlite3.h Initial WCH codebase. 2022-03-29 17:01:37 +08:00
sqlite3ext.h Initial WCH codebase. 2022-03-29 17:01:37 +08:00
test-sqlite.tcl Initial WCH codebase. 2022-03-29 17:01:37 +08:00

README

Full sqlite3 Extension for Jim Tcl
==================================

Author: Steve Bennett <steveb@workware.net.au>
Date: Thu 24 Nov 2011

This directory builds a Jim Tcl extension containing a complete sqlite3 implementation and binding.

Building
--------

Ensure that you have configured and built jim in the source directory, then:

$ make

./build-ext -o sqlite.so -I.. -L.. -DSQLITE_OMIT_LOAD_EXTENSION=1 ... jim-sqlite.c sqlite3.c
Building sqlite.so from jim-sqlite.c sqlite3.c

Warning: libjim is static. Dynamic module may not work on some platforms.

Compile: jim-sqlite.o
Compile: sqlite3.o
Link:    sqlite.so

Success!

Testing
-------

$ make test

Installing
----------

Copy sqlite.so to your jim library directory, typically /usr/local/lib/jim or
where $JIMLIB points to.

Using
-----
In your Jim Tcl code, ensure that sqlite.so is in a directory on $auto_path.
Then:

  package require sqlite

  sqlite db test.db
  ...etc..

Documentation
-------------

The Jim Tcl binding is almost exactly identical to the Tcl binding.
See http://www.sqlite.org/tclsqlite.html for documentation.

Differences:
- INCRBLOB is not supported as Jim Tcl does not support channels
- No attempt is made to change encoding between Jim Tcl and sqlite
- Jim Tcl doesn't differentiate between binary data (bytearray) and
  string, so only the @field syntax causes a fieldsto be bound
  as a blob rather than text.
- Jim Tcl doesn't have a boolean type