create-table name description &key database type extra-options
The name of the table.
The table properties.
A string or the keyword
A string or
create-table creates a table called name and defines its columns and other properties with description. The argument description is a list containing lists of attribute-name and type information pairs.
The default value of database is *default-database*.
type and extra-options are treated in a database-type specific way. Currently only database-type
:mysql uses these options, as follows.
If type is not supplied, it defaults to the value (if any) of default-table-type that was supplied to connect. If extra-options is not supplied, it defaults to the value (if any) of default-table-extra-options that was supplied to connect.
type, if non-nil, is used as argument to TYPE in the SQL statement:
create table MyTable (column-specs) TYPE = type
except that if type is
create-table will attempt to make tables that support transactions, by using the type
extra-options (if non-nil) is appended in the end of this SQL statement.
When database-type is not
:mysql, type and extra-options are ignored.
The following code:
'(([id] (char 10) not-null)
([salary] (number 8 2))))
is equivalent to the following SQL:
CREATE TABLE MANAGER
(ID CHAR(10) NOT NULL,SALARY NUMBER(8,2))
LispWorks User Guide and Reference Manual - 20 Sep 2017