Skip to content

Collections & Documents

AingDB organizes data into tables (similar to collections). Each table can define columns with hints:

ts
type ColumnType = 'string'|'number'|'boolean'|'uuid'|'text'|'json'|'vector'|'date'|'datetime'|'blob'

interface Column {
  name: string
  type: ColumnType
  primary?: boolean
  unique?: boolean
  notNull?: boolean
  default?: { kind: 'default'; expr: string }
  masked?: boolean
}

You can also set TTL at table level:

ts
interface TTLSpec { column?: string }
interface TableSchema { name: string; columns: Column[]; ttl?: TTLSpec }

Documents are stored as JSON under the hood. If a primary key column is present, its value is used as the storage key; otherwise AingDB generates a UUID.

Released under MIT License.