Prev | Next |
dismod_at.create_table(
connection, tbl_name, col_name, col_type, row_list
)
str
that specifies the name of the table.
list
of str
where the elements are the column names in the table that is created.
The column name for the primary key,
tbl_name_id
must
not be included in the list.
tbl_name_name
is in the list,
the corresponding column will have the unique
constraint.
list
of str
where the elements are the column types
in the same order as
col_name
.
The valid types are
integer
, real
, text
.
list
of rows contain data that is written
to the table.
Each row is itself a list containing the data for one row of the
table in the same order as
col_name
.
Note that the primary key column is not included in
row_list
.
Also note that the value in each column gets converted to unicode
before being written to the database.
Note that the special value
row_list[i][j] == None
gets converted to null
in the table.
tbl_name_id
and type
integer primary key
is included as the first column in the table.
Its values start with zero (for the first row) and
increment by one for each row.
connection.commit()
to make sure the table exists before returning.
create_table
.