Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\W}[1]{ \; #1 \; }@)@ This is dismod_at-20221105 documentation: Here is a link to its current documentation .
Get Column Names and Types in a Table

Syntax
connection
table_name
col_name
col_type
Primary Key
Example

Syntax
(col_namecol_type)  = dismod_at.get_name_type(connectiontbl_name)

connection
is a connection for this database.

table_name
is a str that specifies the name of the table.

col_name
is a list of strings containing the column names in the same order as they appear in the table.

col_type
is a list of strings containing the column types in the same order as the columns appear in the table. The possible values for the column types are integer, real, text, or integer primary key. Note that the types in the database are converted to lower case before being returned in col_type .

Primary Key
This routine assumes the primary key is an integer, corresponds to the first column, and has name tbl_name_id .

Example
The file get_name_type.py is an example use of get_name_type.
Input File: python/dismod_at/get_name_type.py