Schema

Introduced in 4.2.0

Stability: 1 - Experimental

const Schema = require('kado/lib/Schema')

The Schema class implements a super class for constructing schema builders that are customized for a specific schema language.

Class: Schema extends Query

For usage of the Query library, see the Query documentation.

Class: SchemaSQL

static SchemaSQL.create(tableName)

static SchemaSQL.alter(tableName)

SchemaSQL.constructor(tableName)

SchemaSQL.alterTable(options)

SchemaSQL.createTable(options)

SchemaSQL.field(name, options)

Available Options:

SchemaSQL.index(name, fields, options)

Available Options:

SchemaSQL.foreignKey(name, table, columns, reference, options)

Available Options:

Other values may include: SET NULL, RESTRICT

SchemaSQL.primary(fieldName)

SchemaSQL.toArray()

SchemaSQL.toString()