class

Amber::CLI::Field

Inherits Reference < Object

Constants

TYPE_MAPPING = { common: { string: ["string", "String", "VARCHAR"], text: ["text", "String", "TEXT"], int: ["integer", "Int32", "INT"], int32: ["integer", "Int32", "INT"], integer: ["integer", "Int32", "INT"], int64: ["bigint", "Int64", "BIGINT"], bigint: ["bigint", "Int64", "BIGINT"], float: ["float", "Float64", "FLOAT"], float64: ["real", "Float64", "FLOAT"], real: ["real", "Float64", "REAL"], bool: ["boolean", "Bool", "BOOL"], boolean: ["boolean", "Bool", "BOOL"], date: ["date", "Time", "DATE"], time: ["time", "Time", "TIMESTAMP"], timestamp: ["time", "Time", "TIMESTAMP"], password: ["password", "String", "VARCHAR"], ref: ["reference", "Int64", "BIGINT"], belongs_to: ["reference", "Int64", "BIGINT"], reference: ["reference", "Int64", "BIGINT"], references: ["reference", "Int64", "BIGINT"], }, mysql: { string: ["string", "String", "VARCHAR(255)"], float: ["float", "Float32", "FLOAT"], password: ["password", "String", "VARCHAR(255)"], time: ["time", "Time", "TIMESTAMP NULL"], timestamp: ["time", "Time", "TIMESTAMP NULL"], uuid: ["uuid", "UUID", "binary(16)"], }, sqlite: { int: ["bigint", "Int64", "INT"], int32: ["bigint", "Int64", "INT"], integer: ["bigint", "Int64", "INT"], int64: ["bigint", "Int64", "INT"], bigint: ["bigint", "Int64", "INT"], bool: ["boolean", "Int64", "BOOL"], boolean: ["boolean", "Int64", "BOOL"], date: ["date_as_var", "String", "DATE"], time: ["time_as_var", "String", "TIMESTAMP"], timestamp: ["time_as_var", "String", "TIMESTAMP"], }, }

Constructors

new(field, hidden : Bool = false, database : String = "pg")
Source

Instance methods

class_name
Source
cr_type
Source
cr_type=(cr_type : String)
Source
database
Source
database=(database : String)
Source
db_type
Source
db_type=(db_type : String)
Source
hidden
Source
hidden=(hidden : Bool)
Source
name
Source
name=(name : String)
Source
reference?
Source
to_json(json : JSON::Builder)
Source
type
Source
type=(type : String)
Source
type_mapping(type = "string")
Source