No description
Find a file
2025-10-29 18:34:28 +01:00
htmldocs Fixed doc 2022-04-30 18:48:10 +02:00
src Changes for Nim 2.2 2025-10-29 18:34:28 +01:00
tests Changes for Nim 2.2 2025-10-29 18:34:28 +01:00
.gitattributes Add .gitattributes 2021-02-21 11:03:56 +01:00
db_nimternalsql.nimble Increased version number 2022-04-22 21:45:33 +02:00
LICENSE Initial commit 2020-12-06 22:40:09 +01:00
README.md Extended Test, README 2022-03-23 20:08:16 +01:00

NimternalSQL, an in-memory SQL database for Nim

NimternalSQL is a Nim library providing an in-memory SQL database. It uses the same interface as the Nim db_*.nim database wrappers.

Tables are implemented using hash tables, so specifying a key using PRIMARY KEY is mandatory. Compound keys are supported.

Data types

The following data types are supported:

  • INTEGER
  • TEXT
  • CHAR
  • VARCHAR
  • DECIMAL
  • NUMERIC
  • REAL
  • DOUBLE PRECISION
  • BIGINT
  • BOOLEAN
  • BINARY
  • VARBINARY
  • LONGVARBINARY
  • RAW
  • BYTEA
  • TIME
  • DATE
  • TIMESTAMP

DECIMAL and NUMERIC are internally represented as 64-bit integers. The maximum number of digits is 18.

AUTOINCREMENT is supported on INTEGER and BIGINT columns. It is not restricted to key columns.

Scalar operators

Besides the usual arithmetic, comparison, and logical operators, NimternalSQL supports the following scalar operators:

  • || (string concatenation)
  • CASE
  • CAST
  • CHAR_LENGTH
  • CURRENT_DATE
  • CURRENT_TIME
  • CURRENT_TIMESTAMP
  • LENGTH
  • LOWER
  • UPPER
  • LIKE
  • OCTET_LENGTH
  • POSITION
  • SUBSTR
  • TRIM

Persistence

Persistence is supported through snapshots or (optionally) a transaction log.

Transactions

By default, NimternalSQL is in autocommit mode. Autocommit mode can be enabled or disabled using DbConn.setAutocommit().

Unimplemented SQL features

A number of SQL features is not implemented, most notably:

OUTER JOIN (JOIN .. ON, CROSS JOIN, and LEFT JOIN are supported)

HAVING (GROUP BY is supported)

RECURSIVE (WITH without RECURSIVE is supported)

ALTER TABLE

Views