Skip to content

Data Types

Branden Horiuchi edited this page Sep 18, 2015 · 7 revisions

❁ Description


Data Types are taken directly from Knex.js and are used in conjunction with Column Options to define a database column using KSDF. Types are values for the type parameter of a Column and each associated option is its own (parameter : value) pair. Each type is supplied as a String and a Column can only have one type.

❁ Types


Type String Options
bigInteger  
boolean  
binary length: Number
date  
dateTime  
decimal precision: Number
scale: Number
float precision: Number
scale: Number
integer unsigned: Boolean
json jsonb: Boolean
string size: Number
text textType: "text" | "mediumtext" | "longtext"
time  
timestamp standard: ???
uuid  

❁ Examples

☴ Basic Table Schema Example
A schema for a student that uses types with and without options ```js var schema = { student: { id: { type: 'integer' } name: { type: 'string', size: 64 }, biography: { type: 'text', textType: 'longtext' }, gpa: { type: 'float', percision: 3, scale: 2 } } }; ```