JSqldb – JavaScript Query Language Database – is a DBMS that natively stores JavaScript objects, and uses JavaScript as it’s query language

JSqldb natively stores JavaScript objects, and hence also JSON, but not as a document, rather as a traversable and queryable object graph. The contents of the database can be seen as a persistent named Global object graph.
This means it fully supports all JavaScript functionality and syntax, including object traversal and stored executable functions. In this way JavaScript can be used to store and retrieve persistent data.
Additionally it has defined convenience query functions for mimicking common SQL operations.

Powered by the high performance v8 JavaScript engine.

Example query:
Saving data to the database is as simple as variable assignment.

Persistent data can be worked with in a similar fasion as normal in memory data – assign, modify and read persistent data as if javascript variables.

It does not store just JSON, it stores JavaScript objects, including executable functions, and references to other objects.

It can use these references and connections to model graph data, but it can also easily store tabular data using either object or array collections

Querying data

All queries target the database referred to by a database handle (db in this case). Getting the database handle depends on the client driver and will be covered later.
For simple queries, simple object access can be used, similar to accessing data from normal javascript objects.

The query language also defines various query functions that can be called on database objects, for example:

Inheritance

Like normal javascript object, JSqldb objects supports prototypal inheritance.

A benefit of this is that all fields that are at default values do not take up any storage space in the database.

Functions

Similarly functions are also supported, and could be seen as analogue to stored procedures in other database systems – but with the power and ease of javascript.

One final example

Next: JSqldb In Practice