Skip to content

Instantly share code, notes, and snippets.

@nrktkt
Created July 3, 2015 06:23
Show Gist options
  • Save nrktkt/b17a5859163ad1fe7698 to your computer and use it in GitHub Desktop.
Save nrktkt/b17a5859163ad1fe7698 to your computer and use it in GitHub Desktop.
maybeSQL

maybeSQL

maybeSQL is the bastard child of SQL and noSQL.

Structure

Database

A maybeSQL database is a map from string table names to tables.

Table

A maybeSQL table is a collection of entries, as well as a set of named common properties that all entries may or may not have and a set of constraints on those properties that all entries must obey.

Entry

A maybeSQL entry is a set of key-value pairs, where values may be of a variety of data types. Values may also be tables of their own, although implementations of maybeSQL are not required to support relational constraints on these value-tables.

Property

A property of an entry is its name and data type.

Constraint

A constraint is any restriction on the existence or value of an element with a specific property. Especially notable constraints are those on data type, nullability, uniqueness or relation to other entries.

Access

Queries

maybeSQL databases can be accessed one or both of two ways. Firstly through SQL; queries on databases can be done as traditional SQL queries, properties which do not exist for an entry are evaluated as having a null value. Second databases can be accessed as objects (compared to JSON objects here); A database can be interpreted as an object, a table as a collection, an entry as an object.

ACID

maybeSQL databases support ACID transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment