Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
sqlite_column.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2018 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 /*
17  * sqlite_column.h
18  *
19  * Created on: 16 Aug 2018
20  * Author: billy
21  */
22 
23 #ifndef CORE_SERVER_SQLITE_INCLUDE_SQLITE_COLUMN_H_
24 #define CORE_SERVER_SQLITE_INCLUDE_SQLITE_COLUMN_H_
25 
26 #include "typedefs.h"
27 #include "linked_list.h"
28 #include "sqlite_library.h"
29 
30 
34 typedef struct
35 {
39  char *slc_name_s;
40 
50  uint32 slc_type;
51 
56 
61 
65  char *slc_check_s;
66 
71 
72 } SQLiteColumn;
73 
74 
78 typedef struct
79 {
82 
85 
87 
88 
89 #ifdef __cplusplus
90 extern "C"
91 {
92 #endif
93 
94 
95 GRASSROOTS_SQLITE_API SQLiteColumn *AllocateSQLiteColumn (const char *name_s, uint32 datatype, bool primary_key_flag, bool unique_flag, bool can_be_null_flag, const char *check_s);
96 
98 
99 GRASSROOTS_SQLITE_API SQLiteColumnNode *AllocateSQLiteColumnNode (const char *name_s, uint32 datatype, bool primary_key_flag, bool unique_flag, bool can_be_null_flag, const char *check_s);
100 
102 
104 
106 
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 
113 
114 #endif /* CORE_SERVER_SQLITE_INCLUDE_SQLITE_COLUMN_H_ */
SQLiteColumn::slc_unique_flag
bool slc_unique_flag
Does this column have a UNIQUE constraint?
Definition: sqlite_column.h:55
SQLiteColumn
A datatype to model an SQLite column.
Definition: sqlite_column.h:34
SQLiteColumn::slc_null_flag
bool slc_null_flag
Can the column contain NULL values?
Definition: sqlite_column.h:60
GRASSROOTS_SQLITE_API
#define GRASSROOTS_SQLITE_API
Definition: sqlite_library.h:46
FreeSQLiteColumnNode
void FreeSQLiteColumnNode(ListItem *node_p)
AllocateSQLiteColumnNode
SQLiteColumnNode * AllocateSQLiteColumnNode(const char *name_s, uint32 datatype, bool primary_key_flag, bool unique_flag, bool can_be_null_flag, const char *check_s)
GetSQLiteColumnDatatypeAsString
const char * GetSQLiteColumnDatatypeAsString(const SQLiteColumn *column_p)
FreeSQLiteColumn
void FreeSQLiteColumn(SQLiteColumn *column_p)
typedefs.h
SQLiteColumn::slc_primary_key_flag
bool slc_primary_key_flag
Is this column the primary key in its table?
Definition: sqlite_column.h:70
SQLiteColumnNode::sqlcn_column_p
SQLiteColumn * sqlcn_column_p
The SQLiteColumn.
Definition: sqlite_column.h:84
SQLiteColumn::slc_type
uint32 slc_type
The datatype for the column.
Definition: sqlite_column.h:50
linked_list.h
A doubly-linked list.
SQLiteColumn::slc_check_s
char * slc_check_s
The column's CHECK constraint.
Definition: sqlite_column.h:65
GetSQLiteColumnAsString
char * GetSQLiteColumnAsString(const SQLiteColumn *column_p)
sqlite_library.h
SQLiteColumn::slc_name_s
char * slc_name_s
The name of the column.
Definition: sqlite_column.h:39
SQLiteColumnNode
A datatype for storing a SQLiteColumn on a LinkedList.
Definition: sqlite_column.h:78
AllocateSQLiteColumn
SQLiteColumn * AllocateSQLiteColumn(const char *name_s, uint32 datatype, bool primary_key_flag, bool unique_flag, bool can_be_null_flag, const char *check_s)
ListItem
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43
SQLiteColumnNode::sqlcn_node
ListItem sqlcn_node
The base ListItem.
Definition: sqlite_column.h:81