summaryrefslogtreecommitdiff
path: root/doc/reference/meta_data.adoc
blob: 63751081462560dc963a353eb70d115b910429bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
== `sqlite/meta_data.hpp`

The meta_data header provides some meta_data for columns.

[source,cpp,subs=+quotes]
----
// The metadata of a column
struct column_meta_data
{
    // Data type fo the column
    cstring_ref data_type;
    // Name of default collation sequence
    cstring_ref collation;
    // true if column has a NOT NULL constraint
    bool not_null;
    // true if column is part of the PRIMARY KEY
    bool primary_key;
    // true if column is AUTOINCREMENT
    bool auto_increment;
};

// get the meta-data of one colum

column_meta_data table_column_meta_data(connection  & conn,
                                        cstring_ref db_name, cstring_ref table_name, cstring_ref column_name,
                                        system::error_code & ec, error_info &ei);
column_meta_data table_column_meta_data(connection  & conn,
                                        cstring_ref table_name, cstring_ref column_name,
                                        system::error_code & ec, error_info &ei);

column_meta_data table_column_meta_data(connection  & conn,
                                        cstring_ref db_name, cstring_ref table_name, cstring_ref column_name);
column_meta_data table_column_meta_data(connection  & conn,
                                        cstring_ref table_name, cstring_ref column_name);
---