stch.sql.ddl documentation
SQL DSL for data definition language (DDL).
Supports a majority of MySQL's statements for
tables and databases.
->AddColumnSpec
(->AddColumnSpec col-spec col-position)
Positional factory function for class stch.sql.ddl.AddColumnSpec.
->AddIndexSpec
(->AddIndexSpec index-spec)
Positional factory function for class stch.sql.ddl.AddIndexSpec.
->ChangeSpec
(->ChangeSpec col col-spec)
Positional factory function for class stch.sql.ddl.ChangeSpec.
->ColumnPosition
(->ColumnPosition preposition col)
Positional factory function for class stch.sql.ddl.ColumnPosition.
->ColumnSpec
(->ColumnSpec col-name col-type options)
Positional factory function for class stch.sql.ddl.ColumnSpec.
->Columns
(->Columns columns+keys)
Positional factory function for class stch.sql.ddl.Columns.
->ConstraintSpec
(->ConstraintSpec key-name key-spec)
Positional factory function for class stch.sql.ddl.ConstraintSpec.
->DBSpec
(->DBSpec db-name)
Positional factory function for class stch.sql.ddl.DBSpec.
->DefaultValueSpec
(->DefaultValueSpec x)
Positional factory function for class stch.sql.ddl.DefaultValueSpec.
->DropColumnSpec
(->DropColumnSpec col)
Positional factory function for class stch.sql.ddl.DropColumnSpec.
->DropDefaultSpec
(->DropDefaultSpec col)
Positional factory function for class stch.sql.ddl.DropDefaultSpec.
->DropForeignKeySpec
(->DropForeignKeySpec fk)
Positional factory function for class stch.sql.ddl.DropForeignKeySpec.
->DropIndexSpec
(->DropIndexSpec index)
Positional factory function for class stch.sql.ddl.DropIndexSpec.
->DropPrimaryKeySpec
(->DropPrimaryKeySpec)
Positional factory function for class stch.sql.ddl.DropPrimaryKeySpec.
->ForeignKeySpec
(->ForeignKeySpec field references options)
Positional factory function for class stch.sql.ddl.ForeignKeySpec.
->IndexSpec
(->IndexSpec index-type index-cols)
Positional factory function for class stch.sql.ddl.IndexSpec.
->RenameSpec
(->RenameSpec table)
Positional factory function for class stch.sql.ddl.RenameSpec.
->SetDefaultSpec
(->SetDefaultSpec col default)
Positional factory function for class stch.sql.ddl.SetDefaultSpec.
->TableOption
(->TableOption option-name option-value)
Positional factory function for class stch.sql.ddl.TableOption.
->TableSpec
(->TableSpec table-name temporary columns+keys)
Positional factory function for class stch.sql.ddl.TableSpec.
-add
(-add spec m)
(-add spec m options)
ColumnOptions
Column options type definition.
ColumnOrIndex
Column or index type definition.
Index
Index type definition.
KeywordOrSym
Keyword or symbol type definition.
NamedOrColumn
Named or column spec type definition.
NamedOrDB
Named or DB spec type definition.
NamedOrTable
Named or table spec type definition.
TableOrDB
Table spec or DB spec type definition.
ToSQL
Convert an object to SQL.
add
(add m spec)
(add m spec options)
Inputs: [m :- TableSpec spec] [m :- TableSpec spec options]
Returns: TableSpec
Add column/index. Use with alt.
after
(after col)
Inputs: [col :- NamedOrColumn]
Returns: ColumnPosition
Set column position. Use with add.
alt
(alt spec)
Inputs: [spec :- TableSpec]
Returns: String
Alter a table.
alt-db
(alt-db db option)
Inputs: [db :- NamedOrDB, option :- TableOption]
Returns: String
Alter a database.
append
(append m x)
Inputs: [m :- TableSpec, x :- (U Columns ColumnSpec Index)]
Returns: TableSpec
Append a set of columns/indexes or single
column/index to a table.
auto-inc
(auto-inc start)
Inputs: [start :- Int]
Returns: TableOption
Set the auto-increment table option.
big-int
(big-int & [arg0__2221__auto__ & args__2222__auto__])
binary
(binary & [arg0__2221__auto__ & args__2222__auto__])
blob
(blob & [arg0__2221__auto__ & args__2222__auto__])
bool
(bool & [arg0__2221__auto__ & args__2222__auto__])
change
(change m col col-spec)
Inputs: [m :- TableSpec, col :- NamedOrColumn, col-spec :- ColumnSpec]
Returns: TableSpec
Change column. Use with alt.
character-set
(character-set charset)
Inputs: [charset :- Named]
Returns: TableOption
Set the character set table option.
chr
(chr & [arg0__2221__auto__ & args__2222__auto__])
collate
(collate collation)
Inputs: [collation :- Named]
Returns: TableOption
Set the collate table option.
column
(column col-name col-type options)
Inputs: [col-name col-type options]
Returns: ColumnSpec
column?
(column? x)
Inputs: [x :- Any]
Returns: Boolean
columns
(columns)
Inputs: []
Returns: Columns
columns?
(columns? x)
Inputs: [x :- Any]
Returns: Boolean
constraint
(constraint & [arg0 & args])
Define a named constraint. Use with an index fn.
create
(create spec & options)
Inputs: [spec :- TableOrDB & options :- [TableOption]]
Returns: String
Create a table or database with options.
date
(date & [arg0__2221__auto__ & args__2222__auto__])
datetime
(datetime & [arg0__2221__auto__ & args__2222__auto__])
db
(db db-name)
Inputs: [db-name :- Named]
Returns: DBSpec
Create a database.
db?
(db? x)
Inputs: [x :- Any]
Returns: Boolean
decimal
(decimal & [arg0__2221__auto__ & args__2222__auto__])
default
(default x)
Inputs: [x :- (U Number String)]
Returns: DefaultValueSpec
Set the default value for a column.
Use with a column fn.
defcolumns
macro
(defcolumns name & columns+keys)
Define one or more columns.
defindexfn
macro
(defindexfn fn-name index-type)
Define an index fn.
deftable
macro
(deftable table-name & columns+keys)
deftypefn
macro
(deftypefn fn-name col-type)
Define a type fn (e.g., int, varchar).
double'
(double' & [arg0__2221__auto__ & args__2222__auto__])
drop-column
(drop-column m col)
Inputs: [m :- TableSpec, col :- NamedOrColumn]
Returns: TableSpec
Drop a column. Use with alt.
drop-db
(drop-db db)
Inputs: [db :- NamedOrDB]
Returns: String
Drop a database.
drop-default
(drop-default m col)
Inputs: [m :- TableSpec, col :- NamedOrColumn]
Returns: TableSpec
Drop column default. Use with alt.
drop-foreign-key
(drop-foreign-key m fk)
Inputs: [m :- TableSpec, fk :- NamedOrConstraint]
Returns: TableSpec
Drop a foreign key. Use with alt.
drop-index
(drop-index m index)
Inputs: [m :- TableSpec, index :- NamedOrConstraint]
Returns: TableSpec
Drop an index. Use with alt.
drop-primary-key
(drop-primary-key m)
Inputs: [m :- TableSpec]
Returns: TableSpec
Drop a primary key. Use with alt.
drop-table
(drop-table & tables)
Inputs: [& tables :- [NamedOrTable]]
Returns: String
Drop one or more tables.
drop-temp-table
(drop-temp-table & tables)
Inputs: [& tables :- [NamedOrTable]]
Returns: String
Drop one or more tables.
engine
(engine eng)
Inputs: [eng :- Named]
Returns: TableOption
Set the engine table option.
enum
(enum & [arg0__2221__auto__ & args__2222__auto__])
float'
(float' & [arg0__2221__auto__ & args__2222__auto__])
foreign-key
(foreign-key & [arg0 & args])
Define a foreign key. Use with create or alt.
fulltext
(fulltext & [arg0__2450__auto__ & args__2451__auto__])
geometry
(geometry & [arg0__2221__auto__ & args__2222__auto__])
idx
(idx index-type index-cols)
Inputs: [index-type index-cols]
Returns: IndexSpec
index
(index & [arg0__2450__auto__ & args__2451__auto__])
index?
(index? x)
Inputs: [x :- Any]
Returns: Boolean
integer
(integer & [arg0__2221__auto__ & args__2222__auto__])
linestring
(linestring & [arg0__2221__auto__ & args__2222__auto__])
map->AddColumnSpec
(map->AddColumnSpec m2155)
Factory function for class AddColumnSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->AddIndexSpec
(map->AddIndexSpec m2951)
Factory function for class AddIndexSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->ChangeSpec
(map->ChangeSpec m2992)
Factory function for class ChangeSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->ColumnPosition
(map->ColumnPosition m2091)
Factory function for class ColumnPosition, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->ColumnSpec
(map->ColumnSpec m2020)
Factory function for class ColumnSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->Columns
(map->Columns m2762)
Factory function for class Columns, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->ConstraintSpec
(map->ConstraintSpec m2553)
Factory function for class ConstraintSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DBSpec
(map->DBSpec m1890)
Factory function for class DBSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DefaultValueSpec
(map->DefaultValueSpec m1963)
Factory function for class DefaultValueSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DropColumnSpec
(map->DropColumnSpec m3182)
Factory function for class DropColumnSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DropDefaultSpec
(map->DropDefaultSpec m3124)
Factory function for class DropDefaultSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DropForeignKeySpec
(map->DropForeignKeySpec m3348)
Factory function for class DropForeignKeySpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DropIndexSpec
(map->DropIndexSpec m3240)
Factory function for class DropIndexSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->DropPrimaryKeySpec
(map->DropPrimaryKeySpec m3298)
Factory function for class DropPrimaryKeySpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->ForeignKeySpec
(map->ForeignKeySpec m2493)
Factory function for class ForeignKeySpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->IndexSpec
(map->IndexSpec m2385)
Factory function for class IndexSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->RenameSpec
(map->RenameSpec m3406)
Factory function for class RenameSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->SetDefaultSpec
(map->SetDefaultSpec m3058)
Factory function for class SetDefaultSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->TableOption
(map->TableOption m2839)
Factory function for class TableOption, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
map->TableSpec
(map->TableSpec m2624)
Factory function for class TableSpec, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version
medium-int
(medium-int & [arg0__2221__auto__ & args__2222__auto__])
point
(point & [arg0__2221__auto__ & args__2222__auto__])
polygon
(polygon & [arg0__2221__auto__ & args__2222__auto__])
primary-key
(primary-key & [arg0__2450__auto__ & args__2451__auto__])
rename
(rename m table)
Inputs: [m :- TableSpec, table :- NamedOrTable]
Returns: TableSpec
Rename a table. Use with alt.
rename-db
(rename-db old-db new-db)
Inputs: [old-db :- NamedOrDB, new-db :- NamedOrDB]
Returns: String
Rename a database.
set'
(set' & [arg0__2221__auto__ & args__2222__auto__])
set-default
(set-default m col default)
Inputs: [m :- TableSpec, col :- NamedOrColumn, default :- (U String Number)]
Returns: TableSpec
Set column default. Use with alt.
small-int
(small-int & [arg0__2221__auto__ & args__2222__auto__])
spatial
(spatial & [arg0__2450__auto__ & args__2451__auto__])
strict-map->AddColumnSpec
(strict-map->AddColumnSpec m2156 & [drop-extra-keys?__894__auto__])
Factory function for class AddColumnSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->AddIndexSpec
(strict-map->AddIndexSpec m2952 & [drop-extra-keys?__894__auto__])
Factory function for class AddIndexSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->ChangeSpec
(strict-map->ChangeSpec m2993 & [drop-extra-keys?__894__auto__])
Factory function for class ChangeSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->ColumnPosition
(strict-map->ColumnPosition m2092 & [drop-extra-keys?__894__auto__])
Factory function for class ColumnPosition, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->ColumnSpec
(strict-map->ColumnSpec m2021 & [drop-extra-keys?__894__auto__])
Factory function for class ColumnSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->Columns
(strict-map->Columns m2763 & [drop-extra-keys?__894__auto__])
Factory function for class Columns, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->ConstraintSpec
(strict-map->ConstraintSpec m2554 & [drop-extra-keys?__894__auto__])
Factory function for class ConstraintSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DBSpec
(strict-map->DBSpec m1891 & [drop-extra-keys?__894__auto__])
Factory function for class DBSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DefaultValueSpec
(strict-map->DefaultValueSpec m1964 & [drop-extra-keys?__894__auto__])
Factory function for class DefaultValueSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DropColumnSpec
(strict-map->DropColumnSpec m3183 & [drop-extra-keys?__894__auto__])
Factory function for class DropColumnSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DropDefaultSpec
(strict-map->DropDefaultSpec m3125 & [drop-extra-keys?__894__auto__])
Factory function for class DropDefaultSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DropForeignKeySpec
(strict-map->DropForeignKeySpec m3349 & [drop-extra-keys?__894__auto__])
Factory function for class DropForeignKeySpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DropIndexSpec
(strict-map->DropIndexSpec m3241 & [drop-extra-keys?__894__auto__])
Factory function for class DropIndexSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->DropPrimaryKeySpec
(strict-map->DropPrimaryKeySpec m3299 & [drop-extra-keys?__894__auto__])
Factory function for class DropPrimaryKeySpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->ForeignKeySpec
(strict-map->ForeignKeySpec m2494 & [drop-extra-keys?__894__auto__])
Factory function for class ForeignKeySpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->IndexSpec
(strict-map->IndexSpec m2386 & [drop-extra-keys?__894__auto__])
Factory function for class IndexSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->RenameSpec
(strict-map->RenameSpec m3407 & [drop-extra-keys?__894__auto__])
Factory function for class RenameSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->SetDefaultSpec
(strict-map->SetDefaultSpec m3059 & [drop-extra-keys?__894__auto__])
Factory function for class SetDefaultSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->TableOption
(strict-map->TableOption m2840 & [drop-extra-keys?__894__auto__])
Factory function for class TableOption, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
strict-map->TableSpec
(strict-map->TableSpec m2625 & [drop-extra-keys?__894__auto__])
Factory function for class TableSpec, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->
table
(table table-name)
Inputs: [table-name :- Named]
Returns: TableSpec
table?
(table? x)
Inputs: [x :- Any]
Returns: Boolean
temp-table
(temp-table table-name)
Inputs: [table-name :- Named]
Returns: TableSpec
text
(text & [arg0__2221__auto__ & args__2222__auto__])
time'
(time' & [arg0__2221__auto__ & args__2222__auto__])
timestamp
(timestamp & [arg0__2221__auto__ & args__2222__auto__])
tiny-int
(tiny-int & [arg0__2221__auto__ & args__2222__auto__])
truncate
(truncate table)
Inputs: [table :- NamedOrTable]
Returns: String
Truncate a table.
unique
(unique & [arg0__2450__auto__ & args__2451__auto__])
varbinary
(varbinary & [arg0__2221__auto__ & args__2222__auto__])
varchar
(varchar & [arg0__2221__auto__ & args__2222__auto__])
whats-my-name
(whats-my-name x)
year
(year & [arg0__2221__auto__ & args__2222__auto__])