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 All Data From a Table

Syntax
connection
tbl_name
table_dict
Example

Syntax
table_dict = dismod_at.get_table_dict(connectiontbl_name)

connection
is a connection for this database.

tbl_name
is a str that specifies the name of the table. We use the notation n_row for the number of rows in the table.

table_dict
This is a list, with length n_row , where each element of the list is a dictionary. For each dictionaries, the set of keys is the column names in the table (excluding the primary key tbl_name_id ). The value table_dict[i][col_name] corresponds to and the column with name col_name and primary key tbl_name_id = i . The python type corresponding to the values in the table are as follows:
Sql Table    Python
integer int
real float
text str
null None
You can determine the type for all the columns in the table using get_name_type .

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