Skip to main content

TCC UnQLite Embedded Database Support

One of the more popular user suggestions over the years has been for internal database support in TCC. We haven’t added it previously because (1) everybody wanted support for a different database, (2) it was difficult to design a reasonable syntax for command line usage, and (3) we weren’t entirely happy with the various embedded databases available.

That has all changed with TCC v23, which incorporates UnQLite, a NoSQL database engine, which supports both key/value and documents store databases. UnQLite features include:

  • Serverless NoSQL database engine
  • Zero configuration
  • Single database file with no temporary files
  • Transactional (ACID) database
  • Cross-platform file format
  • Standard Key/Value store
  • Document store (JSON) database
  • Supports cursors for linear records traversal
  • Support for on-disk as well in-memory databases
  • Disk storage engine supports O(1) lookup
  • Supports Terabyte sized databases

See the UnQLite web site for more information.

The UnQLite support in TCC is in the new UNQLITE internal command (best for interactive experimentation with UnQLite features), and in 12 new variable functions (best for production use in batch files):

  • @UNQCLOSE – Close a UnQLite database opened by @UNQOPEN
  • @UNQDELETE – Delete a key/value pair from a UnQLite database
  • @UNQKVB– Add a key / binary blob value pair to a UnQLite database
  • @UNQKVBA – Append to the value of an existing key / binary blob value pair
  • @UNQKVF – Add a key / file value pair to a UnQLite database
  • @UNQKVFA – Append to the value of an existing key / file value pair
  • @UNQKVS – Add a key / string value pair to a UnQLite database
  • @UNQKVSA – Append to the value of an existing key/value pair
  • @UNQOPEN – Open a UnQLite database, specifying a database name that is used by other @UNQ… functions
  • @UNQREADB – Read a binary value from an existing key in a UnQLite database
  • @UNQREADF – Read a value from an existing key in a UnQLite database and save it to a file
  • @UNQREADS – Read a string value from an existing key in a UnQLite database

If you have suggestions for additional database options, please post them in our Suggestions Forum.