GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-b2e2571e19
|
Go to the source code of this file.
Functions | |
void | db_Cstring_to_lowercase (char *) |
Convert string to lowercase. More... | |
void | db_Cstring_to_uppercase (char *) |
Convert string to lowercase. More... | |
int | db_add_column (dbDriver *, dbString *, dbColumn *) |
Add column to table. More... | |
void | db__add_cursor_to_driver_state (dbCursor *) |
Add cursor do driver state. More... | |
int | db_alloc_cursor_column_flags (dbCursor *) |
Allocate columns' flags for cursor. More... | |
int | db_alloc_cursor_table (dbCursor *, int) |
Allocate table for cursor. More... | |
int | db_append_table_column (dbTable *, dbColumn *) |
Append a specific column to given table. More... | |
dbDirent * | db_alloc_dirent_array (int) |
Allocate dirent array. More... | |
dbHandle * | db_alloc_handle_array (int) |
Allocate array of handles. More... | |
dbIndex * | db_alloc_index_array (int) |
Allocate index array. More... | |
int | db_alloc_index_columns (dbIndex *, int) |
Allocate index columns. More... | |
dbString * | db_alloc_string_array (int) |
Allocate dbString array. More... | |
dbTable * | db_alloc_table (int) |
Allocate a table with a specific number of columns. More... | |
int | db_append_string (dbString *, const char *) |
Append string to dbString. More... | |
void | db_auto_print_errors (int) |
Toggles printing of DBMI error messages. More... | |
void | db_auto_print_protocol_errors (int) |
Set auto print protocol error. More... | |
int | db_bind_update (dbCursor *) |
? More... | |
void * | db_calloc (int, int) |
Allocate memory. More... | |
int | db_CatValArray_alloc (dbCatValArray *, int) |
Allocate dbCatValArray. More... | |
int | db_CatValArray_realloc (dbCatValArray *, int) |
Realloc dbCatValArray. More... | |
void | db_CatValArray_free (dbCatValArray *) |
Free allocated dbCatValArray. More... | |
void | db_CatValArray_init (dbCatValArray *) |
Initialize dbCatValArray. More... | |
void | db_CatValArray_sort (dbCatValArray *) |
Sort key/value array by key. More... | |
int | db_CatValArray_sort_by_value (dbCatValArray *) |
Sort key/value array by value. More... | |
int | db_CatValArray_get_value (dbCatValArray *, int, dbCatVal **) |
Find value by key. More... | |
int | db_CatValArray_get_value_int (dbCatValArray *, int, int *) |
Find value (integer) by key. More... | |
int | db_CatValArray_get_value_double (dbCatValArray *, int, double *) |
Find value (double) by key. More... | |
void | db_char_to_lowercase (char *) |
Convert character to lowercase. More... | |
void | db_char_to_uppercase (char *) |
Convert character to uppercase. More... | |
void | db_clear_error (void) |
Clear error status. More... | |
dbTable * | db_clone_table (dbTable *) |
Make a new exact copy of an existing table. More... | |
void | db__close_all_cursors (void) |
Close all cursors. More... | |
int | db_close_cursor (dbCursor *) |
Close cursor. More... | |
int | db_close_database (dbDriver *) |
Close database connection. More... | |
int | db_close_database_shutdown_driver (dbDriver *) |
Close driver/database connection. More... | |
int | db_column_sqltype (dbDriver *, const char *, const char *) |
Get column sqltype. More... | |
int | db_column_Ctype (dbDriver *, const char *, const char *) |
Get column ctype. More... | |
int | db_convert_Cstring_to_column_default_value (const char *, dbColumn *) |
? More... | |
int | db_convert_Cstring_to_column_value (const char *, dbColumn *) |
? More... | |
int | db_convert_Cstring_to_value (const char *, int, dbValue *) |
Convert string to value. More... | |
int | db_convert_Cstring_to_value_datetime (const char *, int, dbValue *) |
Convert datetime string to value. More... | |
int | db_convert_column_default_value_to_string (dbColumn *, dbString *) |
? More... | |
int | db_convert_column_value_to_string (dbColumn *, dbString *) |
? More... | |
int | db_convert_value_datetime_into_string (dbValue *, int, dbString *) |
Convert datetime value into string. More... | |
int | db_convert_value_to_string (dbValue *, int, dbString *) |
Convert value to string. More... | |
dbColumn * | db_copy_column (dbColumn *, dbColumn *) |
Copy a db column from source to destination. More... | |
void | db_copy_dbmscap_entry (dbDbmscap *, dbDbmscap *) |
Copy dbmscap entry. More... | |
int | db_copy_string (dbString *, const dbString *) |
Copy dbString. More... | |
int | db_table_to_sql (dbTable *, dbString *) |
Create SQL CREATE string from table definition. More... | |
int | db_copy_table (const char *, const char *, const char *, const char *, const char *, const char *) |
Copy a table. More... | |
int | db_copy_table_where (const char *, const char *, const char *, const char *, const char *, const char *, const char *) |
Copy a table (by where statement) More... | |
int | db_copy_table_select (const char *, const char *, const char *, const char *, const char *, const char *, const char *) |
Copy a table (by select statement) More... | |
int | db_copy_table_by_ints (const char *, const char *, const char *, const char *, const char *, const char *, const char *, int *, int) |
Copy a table (by keys) More... | |
void | db_copy_value (dbValue *, dbValue *) |
Copy value. More... | |
int | db_create_database (dbDriver *, dbHandle *) |
Create database. More... | |
int | db_create_index (dbDriver *, dbIndex *) |
Create index. More... | |
int | db_create_index2 (dbDriver *, const char *, const char *) |
Create unique index. More... | |
int | db_create_table (dbDriver *, dbTable *) |
Create table. More... | |
int | db_d_add_column (void) |
Add column to table. More... | |
int | db_d_bind_update (void) |
ADD. More... | |
const char * | db_dbmscap_filename (void) |
Get dbmscap file name. More... | |
int | db_d_close_cursor (void) |
Close cursor. More... | |
int | db_d_close_database (void) |
Close database connection. More... | |
int | db_d_create_database (void) |
Create database. More... | |
int | db_d_create_index (void) |
Create index. More... | |
int | db_d_create_table (void) |
Create table. More... | |
int | db_d_delete (void) |
Delete record (?) More... | |
int | db_d_delete_database (void) |
Delete database. More... | |
int | db_d_describe_table (void) |
Describe table. More... | |
int | db_d_drop_column (void) |
Drop column. More... | |
int | db_d_drop_index (void) |
Drop index. More... | |
int | db_d_drop_table (void) |
Drop table. More... | |
void | db_debug (const char *) |
Print debug message. More... | |
void | db_debug_off (void) |
Turn off debugging. More... | |
void | db_debug_on (void) |
Turn on debugging. More... | |
int | db_delete (dbCursor *) |
Delete record (?) More... | |
int | db_delete_database (dbDriver *, dbHandle *) |
Delete database. More... | |
int | db_delete_table (const char *, const char *, const char *) |
Delete table. More... | |
int | db_describe_table (dbDriver *, dbString *, dbTable **) |
Describe table. More... | |
int | db_d_execute_immediate (void) |
Execute SQL statements. More... | |
int | db_d_begin_transaction (void) |
Begin transaction. More... | |
int | db_d_commit_transaction (void) |
Commit transaction. More... | |
int | db_d_fetch (void) |
Fetch data. More... | |
int | db_d_find_database (void) |
Find database. More... | |
int | db_d_get_num_rows (void) |
Get number of selected rows. More... | |
int | db_d_grant_on_table (void) |
Grant privileges on table. More... | |
int | db_d_insert (void) |
Insert new record into table. More... | |
void | db_d_init_error (const char *) |
Init error message for DB driver. More... | |
void | db_d_append_error (const char *,...) __attribute__((format(printf |
void void | db_d_report_error (void) |
Report error message for DB driver. More... | |
dbDirent * | db_dirent (const char *, int *) |
Read directory and build an array of dbDirent's. More... | |
int | db_d_list_databases (void) |
List databases. More... | |
int | db_d_list_indexes (void) |
List indexes. More... | |
int | db_d_list_tables (void) |
List available tables for given connection. More... | |
int | db_d_open_database (void) |
Open database connection. More... | |
int | db_d_open_insert_cursor (void) |
Open insert cursor. More... | |
int | db_d_open_select_cursor (void) |
Open select cursor. More... | |
int | db_d_open_update_cursor (void) |
Open update cursor. More... | |
void | db_double_quote_string (dbString *) |
Replace each ' is replaced by ''. More... | |
int | db_driver (int, char **) |
int | db_driver_mkdir (const char *, int, int) |
Create db directory. More... | |
int | db_drop_column (dbDriver *, dbString *, dbString *) |
Drop column. More... | |
void | db__drop_cursor_from_driver_state (dbCursor *) |
Drop cursor from driver state. More... | |
int | db_drop_index (dbDriver *, dbString *) |
Drop index. More... | |
int | db_drop_table (dbDriver *, dbString *) |
Drop table. More... | |
void | db_drop_token (dbToken) |
Drop token. More... | |
int | db_d_update (void) |
? More... | |
int | db_d_version (void) |
Get version info. More... | |
int | db_enlarge_string (dbString *, int) |
Enlarge dbString. More... | |
void | db_error (const char *) |
Report error message. More... | |
int | db_execute_immediate (dbDriver *, dbString *) |
Execute SQL statements. More... | |
int | db_begin_transaction (dbDriver *) |
Begin transaction. More... | |
int | db_commit_transaction (dbDriver *) |
Commit transaction. More... | |
int | db_fetch (dbCursor *, int, int *) |
Fetch data from open cursor. More... | |
int | db_find_database (dbDriver *, dbHandle *, int *) |
Find database. More... | |
dbAddress | db_find_token (dbToken) |
Find token. More... | |
void | db_free (void *) |
Free allocated memory. More... | |
void | db_free_column (dbColumn *) |
Frees column structure. More... | |
void | db_free_cursor (dbCursor *) |
Free allocated dbCursor. More... | |
void | db_free_cursor_column_flags (dbCursor *) |
Free columns' flags of cursor. More... | |
void | db_free_dbmscap (dbDbmscap *) |
Free dbmscap. More... | |
void | db_free_dirent_array (dbDirent *, int) |
Free dbDirent. More... | |
void | db_free_handle (dbHandle *) |
Free dbHandle structure. More... | |
void | db_free_handle_array (dbHandle *, int) |
Free array of handles. More... | |
void | db_free_index (dbIndex *) |
Free allocated dbIndex. More... | |
void | db_free_index_array (dbIndex *, int) |
Free index array. More... | |
void | db_free_string (dbString *) |
Free allocated space for dbString. More... | |
void | db_free_string_array (dbString *, int) |
Free allocated dbString array. More... | |
void | db_free_table (dbTable *) |
Free the table. More... | |
int | db_get_column (dbDriver *, const char *, const char *, dbColumn **) |
Get column structure by table and column name. More... | |
dbValue * | db_get_column_default_value (dbColumn *) |
Returns column default value for given column structure. More... | |
const char * | db_get_column_description (dbColumn *) |
Returns column description for given column. More... | |
int | db_get_column_host_type (dbColumn *) |
Get column host type. More... | |
int | db_get_column_length (dbColumn *) |
Get column's length. More... | |
const char * | db_get_column_name (dbColumn *) |
Returns column name for given column. More... | |
int | db_get_column_precision (dbColumn *) |
Get column precision. More... | |
int | db_get_column_scale (dbColumn *) |
Get column scale. More... | |
int | db_get_column_select_priv (dbColumn *) |
Get select privileges. More... | |
int | db_get_column_sqltype (dbColumn *) |
Returns column sqltype for column. More... | |
int | db_get_column_update_priv (dbColumn *) |
Get update privileges. More... | |
dbValue * | db_get_column_value (dbColumn *) |
Returns column value for given column structure. More... | |
int | db_get_connection (dbConnection *) |
Get default DB connection settings for the current mapset. More... | |
int | db_get_cursor_number_of_columns (dbCursor *) |
Get number of columns. More... | |
dbTable * | db_get_cursor_table (dbCursor *) |
Get table allocated by cursor. More... | |
dbToken | db_get_cursor_token (dbCursor *) |
Get cursor token. More... | |
const char * | db_get_default_driver_name (void) |
Get driver name from current DB connection settings. More... | |
const char * | db_get_default_database_name (void) |
Get database name from current DB connection settings. More... | |
const char * | db_get_default_schema_name (void) |
Get schema name from current DB connection settings. More... | |
const char * | db_get_default_group_name (void) |
Get group name from current DB connection settings. More... | |
dbDriverState * | db__get_driver_state (void) |
Get driver state. More... | |
int | db_get_error_code (void) |
Get error code. More... | |
const char * | db_get_error_msg (void) |
Get error message. More... | |
const char * | db_get_error_who (void) |
const char * | db_get_handle_dbname (dbHandle *) |
Get handle database name. More... | |
const char * | db_get_handle_dbschema (dbHandle *) |
Get handle schema name. More... | |
const char * | db_get_index_column_name (dbIndex *, int) |
Get column number. More... | |
const char * | db_get_index_name (dbIndex *) |
Get index name. More... | |
int | db_get_index_number_of_columns (dbIndex *) |
Get number of columns. More... | |
const char * | db_get_index_table_name (dbIndex *) |
Get table name. More... | |
int | db_get_num_rows (dbCursor *) |
Get number of selected rows. More... | |
char * | db_get_string (const dbString *) |
Get string. More... | |
dbColumn * | db_get_table_column (dbTable *, int) |
Returns column structure for given table and column number. More... | |
dbColumn * | db_get_table_column_by_name (dbTable *, const char *) |
Returns column structure for given table and column name. More... | |
int | db_get_table_delete_priv (dbTable *) |
Get table delete privileges. More... | |
const char * | db_get_table_description (dbTable *) |
Get the description of the table. More... | |
int | db_get_table_insert_priv (dbTable *) |
Get table insert privileges. More... | |
const char * | db_get_table_name (dbTable *) |
Get the name of the table. More... | |
int | db_get_table_number_of_columns (dbTable *) |
Return the number of columns of the table. More... | |
int | db_get_table_number_of_rows (dbDriver *, dbString *) |
Get number of rows of table. More... | |
int | db_get_table_select_priv (dbTable *) |
Get table select privileges. More... | |
int | db_get_table_update_priv (dbTable *) |
Get table update privileges. More... | |
double | db_get_value_as_double (dbValue *, int) |
Get value as double. More... | |
int | db_get_value_day (dbValue *) |
Get day value. More... | |
double | db_get_value_double (dbValue *) |
Get double precision value. More... | |
int | db_get_value_hour (dbValue *) |
Get hour value. More... | |
int | db_get_value_int (dbValue *) |
Get integer value. More... | |
int | db_get_value_minute (dbValue *) |
Get minute value. More... | |
int | db_get_value_month (dbValue *) |
Get month value. More... | |
double | db_get_value_seconds (dbValue *) |
Get seconds value. More... | |
const char * | db_get_value_string (dbValue *) |
Get string value. More... | |
int | db_get_value_year (dbValue *) |
Get year value. More... | |
int | db_grant_on_table (dbDriver *, const char *, int, int) |
Grant privileges on table. More... | |
int | db_has_dbms (void) |
Check dbms. More... | |
void | db_init_column (dbColumn *) |
Initialize dbColumn. More... | |
void | db_init_cursor (dbCursor *) |
Initialize dbCursor. More... | |
void | db__init_driver_state (void) |
Initialize driver state. More... | |
void | db_init_handle (dbHandle *) |
Initialize handle (i.e database/schema) More... | |
void | db_init_index (dbIndex *) |
Initialize dbIndex. More... | |
void | db_init_string (dbString *) |
Initialize dbString. More... | |
void | db_init_table (dbTable *) |
Initialize the table to zero. More... | |
int | db_insert (dbCursor *) |
Insert new record into table. More... | |
void | db_interval_range (int, int *, int *) |
Define range based on SQL data type. More... | |
int | db_isdir (const char *) |
Test if path is a directory. More... | |
int | db_legal_tablename (const char *) |
Check if output is legal table name. More... | |
int | db_list_databases (dbDriver *, dbString *, int, dbHandle **, int *) |
List databases. More... | |
const char * | db_list_drivers (void) |
Return comma separated list of existing DB drivers, used for driver parameter options. More... | |
int | db_list_indexes (dbDriver *, dbString *, dbIndex **, int *) |
List indexes. More... | |
int | db_list_tables (dbDriver *, dbString **, int *, int) |
List available tables for given connection. More... | |
void * | db_malloc (int) |
Allocate memory. More... | |
void | db__mark_database_closed (void) |
Mark database as closed. More... | |
void | db__mark_database_open (const char *, const char *) |
Mark database as opened. More... | |
void | db_memory_error (void) |
Report memory error. More... | |
dbToken | db_new_token (dbAddress) |
Add new token. More... | |
int | db_nocase_compare (const char *, const char *) |
Compare strings case-insensitive. More... | |
void | db_noproc_error (int) |
Report no procedure error. More... | |
int | db_open_database (dbDriver *, dbHandle *) |
Open database connection. More... | |
int | db_open_insert_cursor (dbDriver *, dbCursor *) |
Open insert cursor. More... | |
int | db_open_select_cursor (dbDriver *, dbString *, dbCursor *, int) |
Open select cursor. More... | |
int | db_open_update_cursor (dbDriver *, dbString *_name, dbString *, dbCursor *, int) |
Open update cursor. More... | |
void | db_print_column_definition (FILE *, dbColumn *) |
Print column definition info. More... | |
void | db_print_error (void) |
Print error. More... | |
void | db_print_index (FILE *, dbIndex *) |
Report index. More... | |
void | db_print_table_definition (FILE *, dbTable *) |
Print table definition info. More... | |
void | db_procedure_not_implemented (const char *) |
Report 'not implemented' error. More... | |
void | db_protocol_error (void) |
Report protocol error. More... | |
dbDbmscap * | db_read_dbmscap (void) |
Read dbmscap. More... | |
void * | db_realloc (void *, int) |
Reallocate memory. More... | |
int | db__recv_char (char *) |
? More... | |
int | db__recv_column_default_value (dbColumn *) |
Receive column default value. More... | |
int | db__recv_column_definition (dbColumn *) |
Receive column definition. More... | |
int | db__recv_column_value (dbColumn *) |
Receive column value. More... | |
int | db__recv_datetime (dbDateTime *) |
Receive datetime. More... | |
int | db__recv_double (double *) |
Receive double. More... | |
int | db__recv_double_array (double **, int *) |
Receive double array. More... | |
int | db__recv_float (float *) |
Receive float. More... | |
int | db__recv_float_array (float **, int *) |
Receive float array. More... | |
int | db__recv_handle (dbHandle *) |
Receive handle. More... | |
int | db__recv_index (dbIndex *) |
Receive index. More... | |
int | db__recv_index_array (dbIndex **, int *) |
Receive index array. More... | |
int | db__recv_int (int *) |
Receive integer. More... | |
int | db__recv_int_array (int **, int *) |
Receive integer array. More... | |
int | db__recv_procnum (int *) |
? (driver only) More... | |
int | db__recv_return_code (int *) |
Receive return code. More... | |
int | db__recv_short (short *) |
Receive short. More... | |
int | db__recv_short_array (short **, int *) |
Receive short array. More... | |
int | db__recv_string (dbString *) |
Reads a string from transport. More... | |
int | db__recv_string_array (dbString **, int *) |
Receive string array. More... | |
int | db__recv_table_data (dbTable *) |
Receive table data. More... | |
int | db__recv_table_definition (dbTable **) |
Receive table definition. More... | |
int | db__recv_token (dbToken *) |
Receive token. More... | |
int | db__recv_value (dbValue *, int) |
Receive value. More... | |
int | db__send_Cstring (const char *) |
Send C string. More... | |
int | db__send_char (int) |
? More... | |
int | db__send_column_default_value (dbColumn *) |
Send column default value. More... | |
int | db__send_column_definition (dbColumn *) |
Send column definition. More... | |
int | db__send_column_value (dbColumn *) |
Send column value. More... | |
int | db__send_datetime (dbDateTime *) |
Send datetime. More... | |
int | db__send_double (double) |
Send double. More... | |
int | db__send_double_array (const double *, int) |
Send double array. More... | |
int | db__send_failure (void) |
Send failure code. More... | |
int | db__send_float (float) |
Send float. More... | |
int | db__send_float_array (const float *, int) |
Send float array. More... | |
int | db__send_handle (dbHandle *) |
Send handle. More... | |
int | db__send_index (dbIndex *) |
Send index. More... | |
int | db__send_index_array (dbIndex *, int) |
Send index array. More... | |
int | db__send_int (int) |
Send integer. More... | |
int | db__send_int_array (const int *, int) |
Send integer array. More... | |
int | db__send_procedure_not_implemented (int) |
? More... | |
int | db__send_procedure_ok (int) |
? More... | |
int | db__send_short (int) |
Send short. More... | |
int | db__send_short_array (const short *, int) |
Send short array. More... | |
int | db__send_string (dbString *) |
Send string. More... | |
int | db__send_string_array (dbString *, int) |
Send string array. More... | |
int | db__send_success (void) |
Send success code. More... | |
int | db__send_table_data (dbTable *) |
Send table data. More... | |
int | db__send_table_definition (dbTable *) |
Send table definition. More... | |
int | db__send_token (dbToken *) |
Send token. More... | |
int | db__send_value (dbValue *, int) |
Send value. More... | |
int | db_select_CatValArray (dbDriver *, const char *, const char *, const char *, const char *, dbCatValArray *) |
Select pairs key/value to array, values are sorted by key (must be integer) More... | |
int | db_select_int (dbDriver *, const char *, const char *, const char *, int **) |
Select array of ordered integers from table/column. More... | |
int | db_select_value (dbDriver *, const char *, const char *, int, const char *, dbValue *) |
Select one (first) value from table/column for key/id. More... | |
int | db_set_column_description (dbColumn *, const char *) |
Set column description. More... | |
void | db_set_column_has_defined_default_value (dbColumn *) |
Set default value identificator. More... | |
void | db_set_column_has_undefined_default_value (dbColumn *) |
Unset default value identificator. More... | |
void | db_set_column_host_type (dbColumn *, int) |
Set column host data type. More... | |
void | db_set_column_length (dbColumn *, int) |
Set column's length. More... | |
int | db_set_column_name (dbColumn *, const char *) |
Set column name. More... | |
void | db_set_column_null_allowed (dbColumn *) |
Set null value to be allowed. More... | |
void | db_set_column_precision (dbColumn *, int) |
Set column precision. More... | |
void | db_set_column_scale (dbColumn *, int) |
Set column scale. More... | |
void | db_set_column_select_priv_granted (dbColumn *) |
Set select privileges to be granted. More... | |
void | db_set_column_select_priv_not_granted (dbColumn *) |
Unset select privileges. More... | |
void | db_set_column_sqltype (dbColumn *, int) |
Define column sqltype for column. More... | |
void | db_set_column_update_priv_granted (dbColumn *) |
Set update privileges to be granted. More... | |
void | db_set_column_update_priv_not_granted (dbColumn *) |
Unset update privileges. More... | |
void | db_set_column_use_default_value (dbColumn *) |
Set default value to be used. More... | |
int | db_set_connection (dbConnection *) |
Set default DB connection settings. More... | |
void | db_set_cursor_column_flag (dbCursor *, int) |
Set column's flag. More... | |
void | db_set_cursor_column_for_update (dbCursor *, int) |
Set Column flag to 'update'. More... | |
void | db_set_cursor_mode (dbCursor *, int) |
Set cursor mode. More... | |
void | db_set_cursor_mode_insensitive (dbCursor *) |
Set 'intensive' cursor mode. More... | |
void | db_set_cursor_mode_scroll (dbCursor *) |
Set 'scroll' cursor mode. More... | |
void | db_set_cursor_table (dbCursor *, dbTable *) |
Set table for given cursor. More... | |
void | db_set_cursor_token (dbCursor *, dbToken) |
Set cursor token. More... | |
void | db_set_cursor_type_insert (dbCursor *) |
Set cursor to be writable (insert) More... | |
void | db_set_cursor_type_readonly (dbCursor *) |
Set cursor to be read-only (select) More... | |
void | db_set_cursor_type_update (dbCursor *) |
Set cursor to be writable (update) More... | |
int | db_set_default_connection (void) |
Sets up database connection settings using GRASS default from dbmi.h. More... | |
void | db_set_error_who (const char *) |
Set 'who' for error messages. More... | |
int | db_set_handle (dbHandle *, const char *, const char *) |
Set handle (database and schema name) More... | |
void | db_set_error_handler_driver (dbDriver *) |
Define standard error handler for open database connection. More... | |
void | db_unset_error_handler_driver (dbDriver *) |
Remove error handler before closing the driver. More... | |
int | db_set_index_column_name (dbIndex *, int, const char *) |
Set column name. More... | |
int | db_set_index_name (dbIndex *, const char *) |
Set index name. More... | |
int | db_set_index_table_name (dbIndex *, const char *) |
Set table name. More... | |
int | db_set_index_type_non_unique (dbIndex *) |
Set index type to non-unique. More... | |
int | db_set_index_type_unique (dbIndex *) |
Set index type to unique. More... | |
void | db__set_protocol_fds (FILE *, FILE *) |
? More... | |
int | db_set_string (dbString *, const char *) |
Inserts string to dbString (enlarge string) More... | |
int | db_set_string_no_copy (dbString *, char *) |
Inserts string to dbString (overwrite current value) More... | |
int | db_set_table_column (dbTable *, int, dbColumn *) |
Set a specific column for given table and column number. More... | |
void | db_set_table_delete_priv_granted (dbTable *) |
Grant delete privileges for table. More... | |
void | db_set_table_delete_priv_not_granted (dbTable *) |
Set delete privileges not granted for table. More... | |
int | db_set_table_description (dbTable *, const char *) |
Set the description of the table. More... | |
void | db_set_table_insert_priv_granted (dbTable *) |
Grant insert privileges for table. More... | |
void | db_set_table_insert_priv_not_granted (dbTable *) |
Set insert privileges not granted for table. More... | |
int | db_set_table_name (dbTable *, const char *) |
Set the name of the table. More... | |
void | db_set_table_select_priv_granted (dbTable *) |
Grant selection privileges for all columns. More... | |
void | db_set_table_select_priv_not_granted (dbTable *) |
Set selection privileges not granted for all columns. More... | |
void | db_set_table_update_priv_granted (dbTable *) |
Grant update privileges for all columns. More... | |
void | db_set_table_update_priv_not_granted (dbTable *) |
Set update privileges not granted for all columns. More... | |
void | db_set_value_datetime_current (dbValue *) |
Set datetime to current. More... | |
void | db_set_value_datetime_not_current (dbValue *) |
Set value to non-current. More... | |
void | db_set_value_day (dbValue *, int) |
Set day value. More... | |
void | db_set_value_double (dbValue *, double) |
Set double precision value. More... | |
void | db_set_value_hour (dbValue *, int) |
Set hour value. More... | |
void | db_set_value_int (dbValue *, int) |
Set integer value. More... | |
void | db_set_value_minute (dbValue *, int) |
Set minute value. More... | |
void | db_set_value_month (dbValue *, int) |
Set month value. More... | |
void | db_set_value_not_null (dbValue *) |
Set value to not null. More... | |
void | db_set_value_null (dbValue *) |
Set value to null. More... | |
void | db_set_value_seconds (dbValue *, double) |
Set seconds value. More... | |
int | db_set_value_string (dbValue *, const char *) |
Set string value. More... | |
void | db_set_value_year (dbValue *, int) |
Set year value. More... | |
int | db_shutdown_driver (dbDriver *) |
Closedown the driver, and free the driver structure. More... | |
const char * | db_sqltype_name (int) |
Get SQL data type description. More... | |
int | db_sqltype_to_Ctype (int) |
Get C data type based on given SQL data type. More... | |
dbDriver * | db_start_driver (const char *) |
Initialize a new dbDriver for db transaction. More... | |
dbDriver * | db_start_driver_open_database (const char *, const char *) |
Open driver/database connection. More... | |
int | db__start_procedure_call (int) |
? (client only) More... | |
char * | db_store (const char *) |
Make a copy of string buffer. More... | |
void | db_strip (char *) |
Strip given string. More... | |
void | db_syserror (const char *) |
Report system error. More... | |
int | db_table_exists (const char *, const char *, const char *) |
Check if table exists. More... | |
int | db_test_column_has_default_value (dbColumn *) |
Check if column has defined default value. More... | |
int | db_test_column_has_defined_default_value (dbColumn *) |
Check if column has defined default value. More... | |
int | db_test_column_has_undefined_default_value (dbColumn *) |
Check if column has defined default value. More... | |
int | db_test_column_null_allowed (dbColumn *) |
Checks if null value is allowed. More... | |
int | db_test_column_use_default_value (dbColumn *) |
Checks if default value is used. More... | |
int | db_test_cursor_any_column_flag (dbCursor *) |
Checks columns' flag. More... | |
int | db_test_cursor_any_column_for_update (dbCursor *) |
Check if columns' flag is 'update'. More... | |
int | db_test_cursor_column_flag (dbCursor *, int) |
Checks column's flag. More... | |
int | db_test_cursor_column_for_update (dbCursor *, int) |
Check if column flag is 'update'. More... | |
int | db_test_cursor_mode_insensitive (dbCursor *) |
Check if cursor mode is 'intensive'. More... | |
int | db_test_cursor_mode_scroll (dbCursor *) |
Check if cursor mode is 'scroll'. More... | |
int | db_test_cursor_type_fetch (dbCursor *) |
Check cursor type. More... | |
int | db_test_cursor_type_insert (dbCursor *) |
Check if cursor type is 'insert'. More... | |
int | db_test_cursor_type_update (dbCursor *) |
Check if cursor type is 'update'. More... | |
int | db__test_database_open (void) |
Test database connection. More... | |
int | db_test_index_type_unique (dbIndex *) |
Test if type is unique. More... | |
int | db_test_value_datetime_current (dbValue *) |
Check if datatime is current. More... | |
int | db_test_value_isnull (dbValue *) |
Check of value is null. More... | |
void | db_unset_column_has_default_value (dbColumn *) |
Unset default value identificator. More... | |
void | db_unset_column_null_allowed (dbColumn *) |
Unset null value to be allowed. More... | |
void | db_unset_column_use_default_value (dbColumn *) |
Unset default value to be used. More... | |
void | db_unset_cursor_column_flag (dbCursor *, int) |
Unset column's flag. More... | |
void | db_unset_cursor_column_for_update (dbCursor *, int) |
Unset 'update' column flag. More... | |
void | db_unset_cursor_mode (dbCursor *) |
Unset cursor mode. More... | |
void | db_unset_cursor_mode_insensitive (dbCursor *) |
Unset 'intensive' cursor mode. More... | |
void | db_unset_cursor_mode_scroll (dbCursor *) |
Unset 'scroll' cursor mode. More... | |
int | db_update (dbCursor *) |
? More... | |
int | db_gversion (dbDriver *, dbString *, dbString *) |
Get version info. More... | |
const char * | db_whoami (void) |
Who am i? More... | |
void | db_zero (void *, int) |
Zero allocated space. More... | |
void | db_zero_string (dbString *) |
Zero string. More... | |
unsigned int | db_sizeof_string (const dbString *) |
Get string size. More... | |
int | db_set_login (const char *, const char *, const char *, const char *, const char *, const char *, int) |
Set login parameters for driver/database. More... | |
int | db_set_login2 (const char *, const char *, const char *, const char *, const char *, const char *, int) |
Set login parameters for driver/database. More... | |
int | db_get_login (const char *, const char *, const char **, const char **, const char **, const char **) |
Get login parameters for driver/database. More... | |
int | db_get_login2 (const char *, const char *, const char **, const char **, const char **, const char **) |
Get login parameters for driver/database. More... | |
int | db_get_login_dump (FILE *) |
Print all connection settings to file. More... | |
void db__add_cursor_to_driver_state | ( | dbCursor * | cursor | ) |
Add cursor do driver state.
cursor | db cursor to be added |
Definition at line 78 of file driver_state.c.
References db_realloc(), list, NULL, and state.
void db__close_all_cursors | ( | void | ) |
Close all cursors.
Definition at line 120 of file driver_state.c.
References db_driver_close_cursor, db_free(), NULL, and state.
Referenced by db_d_close_database().
void db__drop_cursor_from_driver_state | ( | dbCursor * | cursor | ) |
Drop cursor from driver state.
cursor | db cursor to be dropped |
Definition at line 108 of file driver_state.c.
Referenced by db_d_close_cursor().
dbDriverState* db__get_driver_state | ( | void | ) |
Get driver state.
Definition at line 34 of file driver_state.c.
References state.
void db__init_driver_state | ( | void | ) |
Initialize driver state.
Definition at line 24 of file driver_state.c.
References db_zero(), and state.
Referenced by db_d_close_database().
void db__mark_database_closed | ( | void | ) |
Mark database as closed.
Definition at line 66 of file driver_state.c.
References db_free(), and state.
Referenced by db_d_close_database().
void db__mark_database_open | ( | const char * | dbname, |
const char * | dbschema | ||
) |
Mark database as opened.
dbname | database name |
dbschema | database schema name |
Definition at line 56 of file driver_state.c.
References db_store(), and state.
Referenced by db_d_open_database().
int db__recv_column_default_value | ( | dbColumn * | column | ) |
Receive column default value.
column | pointer to dbColumn |
Definition at line 120 of file xdrcolumn.c.
References db__recv_value(), db_get_column_default_value(), db_get_column_sqltype(), and db_sqltype_to_Ctype().
int db__recv_column_definition | ( | dbColumn * | column | ) |
Receive column definition.
column | pointer to dbColumn |
Definition at line 53 of file xdrcolumn.c.
References _db_column::columnName, _db_column::dataLen, DB_OK, DB_RECV_CHAR, DB_RECV_COLUMN_DEFAULT_VALUE, DB_RECV_INT, DB_RECV_STRING, _db_column::description, _db_column::hasDefaultValue, _db_column::hostDataType, _db_column::nullAllowed, _db_column::precision, _db_column::scale, _db_column::select, _db_column::sqlDataType, _db_column::update, and _db_column::useDefaultValue.
int db__recv_column_value | ( | dbColumn * | column | ) |
Receive column value.
column | pointer to dbColumn |
Definition at line 94 of file xdrcolumn.c.
References db__recv_value(), db_get_column_sqltype(), db_get_column_value(), and db_sqltype_to_Ctype().
int db__recv_datetime | ( | dbDateTime * | t | ) |
Receive datetime.
t | pointer to dbDateTime |
Definition at line 47 of file xdrdatetime.c.
References DB_OK, DB_RECV_CHAR, DB_RECV_DOUBLE, DB_RECV_INT, and t.
int db__recv_double | ( | double * | d | ) |
int db__recv_double_array | ( | double ** | x, |
int * | n | ||
) |
Receive double array.
Returns an allocated array of doubles Caller is responsible for free()
x | |
n |
Definition at line 90 of file xdrdouble.c.
int db__recv_float | ( | float * | d | ) |
int db__recv_float_array | ( | float ** | x, |
int * | n | ||
) |
Receive float array.
Returns an allocated array of floats Caller is responsible for free()
x | |
n |
Definition at line 92 of file xdrfloat.c.
int db__recv_handle | ( | dbHandle * | handle | ) |
Receive handle.
handle |
Definition at line 40 of file xdrhandle.c.
References DB_OK, DB_RECV_STRING, _db_handle::dbName, and _db_handle::dbSchema.
int db__recv_index | ( | dbIndex * | index | ) |
int db__recv_index_array | ( | dbIndex ** | list, |
int * | count | ||
) |
Receive index array.
list | |
count |
Definition at line 95 of file xdrindex.c.
References count, db_alloc_index_array(), db_get_error_code(), DB_OK, DB_RECV_INDEX, DB_RECV_INT, and NULL.
int db__recv_int | ( | int * | n | ) |
Receive integer.
n |
Definition at line 44 of file xdrint.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Referenced by db__recv_token().
int db__recv_int_array | ( | int ** | x, |
int * | n | ||
) |
int db__recv_procnum | ( | int * | n | ) |
? (driver only)
n |
Definition at line 52 of file xdrprocedure.c.
References db__recv(), DB_EOF, and DB_OK.
int db__recv_return_code | ( | int * | ret_code | ) |
Receive return code.
[out] | ret_code | return code |
Definition at line 51 of file ret_codes.c.
int db__recv_short | ( | short * | n | ) |
Receive short.
n |
Definition at line 46 of file xdrshort.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
int db__recv_short_array | ( | short ** | x, |
int * | n | ||
) |
Receive short array.
Returns an allocated array of ints Caller is responsible for free()
x | |
n |
Definition at line 94 of file xdrshort.c.
int db__recv_string | ( | dbString * | x | ) |
Reads a string from transport.
Note: caller MUST initialize x by calling db_init_string()
x |
Definition at line 117 of file xdrstring.c.
References DB_OK.
int db__recv_string_array | ( | dbString ** | a, |
int * | n | ||
) |
int db__recv_table_data | ( | dbTable * | table | ) |
int db__recv_table_definition | ( | dbTable ** | table | ) |
int db__recv_token | ( | dbToken * | token | ) |
Receive token.
token |
Definition at line 36 of file xdrtoken.c.
References db__recv_int().
int db__recv_value | ( | dbValue * | value, |
int | Ctype | ||
) |
Receive value.
value | |
Ctype |
Definition at line 62 of file xdrvalue.c.
References _, _db_value::d, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_error(), DB_FAILED, DB_OK, DB_RECV_CHAR, DB_RECV_DATETIME, DB_RECV_DOUBLE, DB_RECV_INT, DB_RECV_STRING, _db_value::i, _db_value::isNull, _db_value::s, and _db_value::t.
Referenced by db__recv_column_default_value(), and db__recv_column_value().
int db__send_column_default_value | ( | dbColumn * | column | ) |
Send column default value.
column | pointer to dbColumn |
Definition at line 107 of file xdrcolumn.c.
References db__send_value(), db_get_column_default_value(), db_get_column_sqltype(), and db_sqltype_to_Ctype().
int db__send_column_definition | ( | dbColumn * | column | ) |
Send column definition.
column | pointer to dbColumn |
Definition at line 25 of file xdrcolumn.c.
References _db_column::columnName, _db_column::dataLen, DB_OK, DB_SEND_CHAR, DB_SEND_COLUMN_DEFAULT_VALUE, DB_SEND_INT, DB_SEND_STRING, _db_column::description, _db_column::hasDefaultValue, _db_column::hostDataType, _db_column::nullAllowed, _db_column::precision, _db_column::scale, _db_column::select, _db_column::sqlDataType, _db_column::update, and _db_column::useDefaultValue.
int db__send_column_value | ( | dbColumn * | column | ) |
Send column value.
column | pointer to dbColumn |
Definition at line 81 of file xdrcolumn.c.
References db__send_value(), db_get_column_sqltype(), db_get_column_value(), and db_sqltype_to_Ctype().
int db__send_Cstring | ( | const char * | s | ) |
int db__send_datetime | ( | dbDateTime * | t | ) |
Send datetime.
t | pointer to dbDateTime |
Definition at line 25 of file xdrdatetime.c.
References DB_OK, DB_SEND_CHAR, DB_SEND_DOUBLE, DB_SEND_INT, and t.
int db__send_double | ( | double | d | ) |
int db__send_double_array | ( | const double * | x, |
int | n | ||
) |
Send double array.
x | |
n |
Definition at line 63 of file xdrdouble.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
int db__send_failure | ( | void | ) |
Send failure code.
Definition at line 37 of file ret_codes.c.
References DB_FAILED, db_get_error_msg(), DB_OK, DB_SEND_C_STRING, and DB_SEND_INT.
int db__send_float | ( | float | d | ) |
int db__send_float_array | ( | const float * | x, |
int | n | ||
) |
Send float array.
x | |
n |
Definition at line 65 of file xdrfloat.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
int db__send_handle | ( | dbHandle * | handle | ) |
Send handle.
handle |
Definition at line 25 of file xdrhandle.c.
References DB_OK, DB_SEND_STRING, _db_handle::dbName, and _db_handle::dbSchema.
int db__send_index | ( | dbIndex * | index | ) |
Send index.
index |
Definition at line 25 of file xdrindex.c.
References _db_index::columnNames, DB_OK, DB_SEND_CHAR, DB_SEND_INT, DB_SEND_STRING, _db_index::indexName, _db_index::numColumns, _db_index::tableName, and _db_index::unique.
int db__send_index_array | ( | dbIndex * | list, |
int | count | ||
) |
Send index array.
list | |
count |
Definition at line 50 of file xdrindex.c.
References count, DB_OK, DB_SEND_INDEX, and DB_SEND_INT.
int db__send_int | ( | int | n | ) |
Send integer.
n |
Definition at line 24 of file xdrint.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Referenced by db__send_procedure_not_implemented(), db__send_procedure_ok(), and db__send_token().
int db__send_int_array | ( | const int * | x, |
int | n | ||
) |
Send integer array.
x | |
n |
Definition at line 65 of file xdrint.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
int db__send_procedure_not_implemented | ( | int | n | ) |
int db__send_procedure_ok | ( | int | n | ) |
int db__send_short | ( | int | n | ) |
int db__send_short_array | ( | const short * | x, |
int | n | ||
) |
Send short array.
x | |
n |
Definition at line 67 of file xdrshort.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
int db__send_string | ( | dbString * | x | ) |
int db__send_string_array | ( | dbString * | a, |
int | count | ||
) |
int db__send_success | ( | void | ) |
Send success code.
Definition at line 26 of file ret_codes.c.
References DB_OK, and DB_SEND_INT.
int db__send_table_data | ( | dbTable * | table | ) |
int db__send_table_definition | ( | dbTable * | table | ) |
Send table definition.
table | pointer to dbTable |
Definition at line 26 of file xdrtable.c.
int db__send_token | ( | dbToken * | token | ) |
Send token.
token |
Definition at line 24 of file xdrtoken.c.
References db__send_int().
int db__send_value | ( | dbValue * | value, |
int | Ctype | ||
) |
Send value.
value | |
Ctype |
Definition at line 28 of file xdrvalue.c.
References _db_value::d, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_error(), DB_FAILED, DB_OK, DB_SEND_CHAR, DB_SEND_DATETIME, DB_SEND_DOUBLE, DB_SEND_INT, DB_SEND_STRING, _db_value::i, _db_value::isNull, _db_value::s, and _db_value::t.
Referenced by db__send_column_default_value(), and db__send_column_value().
void db__set_protocol_fds | ( | FILE * | send, |
FILE * | recv | ||
) |
?
send | |
recv |
Definition at line 75 of file db/dbmi_base/xdr.c.
Referenced by db_add_column(), db_begin_transaction(), db_bind_update(), db_close_cursor(), db_close_database(), db_commit_transaction(), db_create_database(), db_create_index(), db_delete(), db_delete_database(), db_drop_column(), db_drop_index(), db_drop_table(), db_execute_immediate(), db_find_database(), db_get_num_rows(), db_grant_on_table(), db_gversion(), db_insert(), db_list_indexes(), db_list_tables(), db_open_database(), db_open_insert_cursor(), db_shutdown_driver(), and db_update().
int db__start_procedure_call | ( | int | procnum | ) |
? (client only)
procnum |
Definition at line 25 of file xdrprocedure.c.
References db_noproc_error(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), DB_RECV_INT, DB_SEND_INT, and procnum.
int db__test_database_open | ( | void | ) |
Test database connection.
Definition at line 45 of file driver_state.c.
References state.
Referenced by db_d_close_database(), and db_d_open_database().
Add column to table.
driver | db driver |
tableName | table name |
column | new column description (dbColumn structure) |
Definition at line 28 of file c_add_col.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_ADD_COLUMN, DB_RECV_RETURN_CODE, DB_SEND_COLUMN_DEFINITION, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
int db_alloc_cursor_column_flags | ( | dbCursor * | cursor | ) |
int db_alloc_cursor_table | ( | dbCursor * | cursor, |
int | ncols | ||
) |
dbDirent* db_alloc_dirent_array | ( | int | count | ) |
Allocate dirent array.
count | number of entities in the array |
Definition at line 163 of file dirent.c.
References count, db_calloc(), db_dirent(), db_init_string(), name, and NULL.
dbHandle* db_alloc_handle_array | ( | int | count | ) |
Allocate array of handles.
count | number of handles in the array |
Definition at line 109 of file handle.c.
References count, db_calloc(), and db_init_handle().
dbIndex* db_alloc_index_array | ( | int | count | ) |
Allocate index array.
count | number of items |
Definition at line 73 of file db/dbmi_base/index.c.
References count, db_calloc(), db_init_index(), and list.
Referenced by db__recv_index_array().
int db_alloc_index_columns | ( | dbIndex * | index, |
int | ncols | ||
) |
Allocate index columns.
index | pointer to dbIndex |
ncols | number of columns to be allocated |
Definition at line 56 of file db/dbmi_base/index.c.
Referenced by db_create_index2().
dbString* db_alloc_string_array | ( | int | count | ) |
dbTable* db_alloc_table | ( | int | ncols | ) |
Allocate a table with a specific number of columns.
ncols | number of columns which should be allocated |
Definition at line 28 of file dbmi_base/table.c.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
int db_append_string | ( | dbString * | x, |
const char * | s | ||
) |
Append string to dbString.
x | pointer to dbString |
s | string to be appended |
Definition at line 205 of file string.c.
Referenced by db_d_append_error(), db_d_report_error(), db_delete_table(), IL_write_point_2d(), and P_Drop_Aux_Table().
Append a specific column to given table.
table | Pointer to dbTable |
column | Pointer to a dbColumn to append. A copy of the column is stored, so the original column can be deleted. |
Definition at line 374 of file dbmi_base/table.c.
void db_auto_print_errors | ( | int | flag | ) |
Toggles printing of DBMI error messages.
flag | ? |
Definition at line 247 of file db/dbmi_base/error.c.
void db_auto_print_protocol_errors | ( | int | flag | ) |
Set auto print protocol error.
flag | ? |
Definition at line 258 of file db/dbmi_base/error.c.
int db_begin_transaction | ( | dbDriver * | driver | ) |
Begin transaction.
driver | db driver |
Definition at line 56 of file c_execute.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_BEGIN_TRANSACTION, DB_RECV_RETURN_CODE, and DB_START_PROCEDURE_CALL.
int db_bind_update | ( | dbCursor * | cursor | ) |
?
cursor | db cursor |
Definition at line 26 of file c_bindupdate.c.
References _db_cursor::column_flags, db__set_protocol_fds(), db_get_cursor_number_of_columns(), DB_OK, DB_PROC_BIND_UPDATE, DB_RECV_RETURN_CODE, DB_SEND_SHORT_ARRAY, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.
void* db_calloc | ( | int | n, |
int | m | ||
) |
Allocate memory.
On failure is called db_memory_error().
n | number of entities |
m | entity size |
Definition at line 69 of file db/dbmi_base/alloc.c.
Referenced by db_alloc_dirent_array(), db_alloc_handle_array(), and db_alloc_index_array().
int db_CatValArray_alloc | ( | dbCatValArray * | arr, |
int | n | ||
) |
Allocate dbCatValArray.
arr | pointer to dbCatValArray |
n | number of items |
Definition at line 401 of file value.c.
References dbCatValArray::alloc, DB_OK, G_calloc, and dbCatValArray::value.
void db_CatValArray_free | ( | dbCatValArray * | arr | ) |
Free allocated dbCatValArray.
arr | pointer to dbCatValArray |
Definition at line 373 of file value.c.
References dbCatValArray::ctype, DB_C_TYPE_DATETIME, DB_C_TYPE_STRING, db_free(), db_free_string(), G_free(), dbCatValArray::n_values, dbCatVal::s, dbCatVal::t, dbCatVal::val, and dbCatValArray::value.
int db_CatValArray_get_value | ( | dbCatValArray * | arr, |
int | key, | ||
dbCatVal ** | cv | ||
) |
Find value by key.
arr | dbCatValArray (key/value array) | |
key | key value | |
[out] | cv | dbCatVal structure (key/value) to store within |
Definition at line 465 of file db/dbmi_client/select.c.
int db_CatValArray_get_value_double | ( | dbCatValArray * | arr, |
int | key, | ||
double * | val | ||
) |
Find value (double) by key.
arr | dbCatValArray (key/value array) | |
key | key value | |
[out] | val | found value (double) |
Definition at line 515 of file db/dbmi_client/select.c.
int db_CatValArray_get_value_int | ( | dbCatValArray * | arr, |
int | key, | ||
int * | val | ||
) |
Find value (integer) by key.
arr | dbCatValArray (key/value array) | |
key | key value | |
[out] | val | found value (integer) |
Definition at line 490 of file db/dbmi_client/select.c.
void db_CatValArray_init | ( | dbCatValArray * | arr | ) |
Initialize dbCatValArray.
arr | pointer to dbCatValArray to be initialized |
Definition at line 361 of file value.c.
References dbCatValArray::alloc, dbCatValArray::n_values, NULL, and dbCatValArray::value.
int db_CatValArray_realloc | ( | dbCatValArray * | arr, |
int | n | ||
) |
Realloc dbCatValArray.
arr | pointer to dbCatValArray |
n | number of items |
Definition at line 420 of file value.c.
References dbCatValArray::alloc, DB_OK, G_realloc, and dbCatValArray::value.
void db_CatValArray_sort | ( | dbCatValArray * | arr | ) |
Sort key/value array by key.
[in,out] | arr | dbCatValArray (key/value array) |
Definition at line 417 of file db/dbmi_client/select.c.
References dbCatValArray::n_values, and dbCatValArray::value.
int db_CatValArray_sort_by_value | ( | dbCatValArray * | arr | ) |
Sort key/value array by value.
[in,out] | arr | dbCatValArray (key/value array) |
Definition at line 430 of file db/dbmi_client/select.c.
References dbCatValArray::ctype, DB_C_TYPE_INT, dbCatValArray::n_values, and dbCatValArray::value.
void db_char_to_lowercase | ( | char * | s | ) |
void db_char_to_uppercase | ( | char * | s | ) |
void db_clear_error | ( | void | ) |
Clear error status.
Definition at line 170 of file db/dbmi_base/error.c.
Make a new exact copy of an existing table.
New memory is allocated for the clone, the columns-content will be copied too.
src | Pointer to dbTable |
Definition at line 396 of file dbmi_base/table.c.
int db_close_cursor | ( | dbCursor * | cursor | ) |
Close cursor.
cursor | cursor to be close |
Definition at line 27 of file c_close_cur.c.
References db__set_protocol_fds(), db_free_cursor(), DB_OK, DB_PROC_CLOSE_CURSOR, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.
Referenced by db_get_table_number_of_rows().
int db_close_database | ( | dbDriver * | driver | ) |
Close database connection.
driver | db driver |
Definition at line 26 of file c_closedb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CLOSE_DATABASE, DB_RECV_RETURN_CODE, and DB_START_PROCEDURE_CALL.
Referenced by db_close_database_shutdown_driver(), and IL_write_point_2d().
int db_close_database_shutdown_driver | ( | dbDriver * | driver | ) |
Close driver/database connection.
driver | db driver |
Definition at line 61 of file db.c.
References db_close_database(), DB_FAILED, DB_OK, db_shutdown_driver(), and G_debug().
Referenced by db_delete_table(), db_get_table_number_of_rows(), V1_close_ogr(), V1_close_pg(), and Vect_cats_set_constraint().
int db_column_Ctype | ( | dbDriver * | driver, |
const char * | tab, | ||
const char * | col | ||
) |
Get column ctype.
Supported types:
driver | DB driver |
tab | table name |
col | column name |
Definition at line 99 of file dbmi_client/column.c.
int db_column_sqltype | ( | dbDriver * | driver, |
const char * | tab, | ||
const char * | col | ||
) |
Get column sqltype.
See db_sqltype_name().
Supported types:
driver | DB driver |
tab | table name |
col | column name |
Definition at line 51 of file dbmi_client/column.c.
int db_commit_transaction | ( | dbDriver * | driver | ) |
Commit transaction.
driver | db driver |
Definition at line 82 of file c_execute.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_COMMIT_TRANSACTION, DB_RECV_RETURN_CODE, and DB_START_PROCEDURE_CALL.
?
column | pointer to dbColumn |
string | pointer to dbString |
Definition at line 80 of file columnfmt.c.
References db_convert_value_to_string(), db_get_column_default_value(), and db_get_column_sqltype().
Referenced by db_print_column_definition().
?
column | pointer to dbColumn |
string | pointer to dbString |
Definition at line 62 of file columnfmt.c.
References db_convert_value_to_string(), db_get_column_sqltype(), and db_get_column_value().
int db_convert_Cstring_to_column_default_value | ( | const char * | Cstring, |
dbColumn * | column | ||
) |
?
Cstring | string buffer |
column | pointer to dbColumn |
Definition at line 43 of file columnfmt.c.
References db_convert_Cstring_to_value(), db_get_column_default_value(), and db_get_column_sqltype().
int db_convert_Cstring_to_column_value | ( | const char * | Cstring, |
dbColumn * | column | ||
) |
?
Cstring | string buffer |
column | pointer to dbColumn |
Definition at line 25 of file columnfmt.c.
References db_convert_Cstring_to_value(), db_get_column_sqltype(), and db_get_column_value().
int db_convert_Cstring_to_value | ( | const char * | Cstring, |
int | sqltype, | ||
dbValue * | value | ||
) |
Convert string to value.
Cstring | string buffer | |
sqltype | SQL data type | |
[out] | value | pointer to dbValue |
Definition at line 31 of file valuefmt.c.
Referenced by db_convert_Cstring_to_column_default_value(), and db_convert_Cstring_to_column_value().
int db_convert_Cstring_to_value_datetime | ( | const char * | buf, |
int | sqltype, | ||
dbValue * | value | ||
) |
Convert datetime string to value.
The format of buf must be as follows
buf | input string buffer | |
sqltype | SQL data type | |
[out] | value | pointer to dbValue to be set |
Definition at line 196 of file datetime.c.
References DB_DAY, DB_FRACTION, DB_HOUR, db_interval_range(), DB_MINUTE, DB_MONTH, db_nocase_compare(), DB_OK, DB_SECOND, db_set_value_datetime_current(), db_set_value_day(), db_set_value_hour(), db_set_value_minute(), db_set_value_month(), db_set_value_seconds(), db_set_value_year(), DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, and DB_YEAR.
Convert datetime value into string.
value | pointer to dbValue | |
sqltype | SQL data type | |
[out] | string | pointer to dbString |
Definition at line 31 of file datetime.c.
References db_get_value_day(), db_get_value_hour(), db_get_value_minute(), db_get_value_month(), db_get_value_seconds(), db_get_value_year(), db_interval_range(), DB_MONTH, db_set_string(), db_test_value_datetime_current(), and DB_YEAR.
Referenced by db_convert_value_to_string().
Convert value to string.
value | pointer to dbValue | |
sqltype | SQL data type | |
[out] | string | pointer to dbString |
Definition at line 68 of file valuefmt.c.
References _, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_convert_value_datetime_into_string(), db_error(), DB_FAILED, db_get_value_double(), db_get_value_int(), db_get_value_string(), db_set_string(), db_sqltype_to_Ctype(), db_test_value_isnull(), and G_trim_decimal().
Referenced by db_convert_column_default_value_to_string(), and db_convert_column_value_to_string().
Copy a db column from source to destination.
src | The column to copy from |
dest | An allocated column to copy to which will be initialized. In case dest is NULL a new column will be allocated and returned |
Definition at line 472 of file dbmi_base/column.c.
int db_copy_table | ( | const char * | from_drvname, |
const char * | from_dbname, | ||
const char * | from_tblname, | ||
const char * | to_drvname, | ||
const char * | to_dbname, | ||
const char * | to_tblname | ||
) |
Copy a table.
from_drvname | name of driver from table is copied |
from_dbname | name of database from table is copied |
from_tblname | name of table to be copied |
to_drvname | name of driver to - where table is copied to |
to_dbname | name of database to - where table is copied to |
to_tblname | name of copied table |
Definition at line 443 of file copy_tab.c.
int db_copy_table_by_ints | ( | const char * | from_drvname, |
const char * | from_dbname, | ||
const char * | from_tblname, | ||
const char * | to_drvname, | ||
const char * | to_dbname, | ||
const char * | to_tblname, | ||
const char * | selcol, | ||
int * | ivals, | ||
int | nvals | ||
) |
Copy a table (by keys)
from_drvname | name of driver from table is copied |
from_dbname | name of database from table is copied |
from_tblname | name of table to be copied |
to_drvname | name of driver to - where table is copied to |
to_dbname | name of database to - where table is copied to |
to_tblname | name of copied table |
selcol | name of column used to select records by values in ivals or NULL |
ivals | pointer to array of integer values or NULL |
nvals | number of values in ivals |
Definition at line 513 of file copy_tab.c.
int db_copy_table_select | ( | const char * | from_drvname, |
const char * | from_dbname, | ||
const char * | from_tblname, | ||
const char * | to_drvname, | ||
const char * | to_dbname, | ||
const char * | to_tblname, | ||
const char * | select | ||
) |
Copy a table (by select statement)
from_drvname | name of driver from table is copied |
from_dbname | name of database from table is copied |
from_dbname | name of table to be copied |
to_drvname | name of driver to - where table is copied to |
to_dbname | name of database to - where table is copied to |
to_tblname | name of copied table |
select | full select statement |
Definition at line 488 of file copy_tab.c.
int db_copy_table_where | ( | const char * | from_drvname, |
const char * | from_dbname, | ||
const char * | from_tblname, | ||
const char * | to_drvname, | ||
const char * | to_dbname, | ||
const char * | to_tblname, | ||
const char * | where | ||
) |
Copy a table (by where statement)
from_drvname | name of driver from table is copied |
from_dbname | name of database from table is copied |
from_tblname | name of table to be copied |
to_drvname | name of driver to - where table is copied to |
to_dbname | name of database to - where table is copied to |
to_tblname | name of copied table |
where | WHERE SQL condition (without where key word) |
Definition at line 465 of file copy_tab.c.
Create database.
driver | db driver |
handle | handle |
Definition at line 27 of file c_createdb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, and DB_START_PROCEDURE_CALL.
Create index.
driver | db driver |
index | index info (pointer to dbIndex structure) |
Definition at line 28 of file c_create_idx.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_INDEX, DB_RECV_RETURN_CODE, DB_RECV_STRING, DB_SEND_INDEX, DB_START_PROCEDURE_CALL, and _db_index::indexName.
Referenced by db_create_index2().
int db_create_index2 | ( | dbDriver * | driver, |
const char * | table_name, | ||
const char * | column_name | ||
) |
Create unique index.
driver | db driver |
table_name | table name |
column_name | column name (where to create index) |
Definition at line 61 of file c_create_idx.c.
References db_alloc_index_columns(), db_create_index(), db_free_index(), db_init_index(), db_set_index_column_name(), db_set_index_name(), db_set_index_table_name(), db_set_index_type_unique(), and NULL.
Create table.
driver | db driver |
table | table description (pointer to dbTable structure) |
Definition at line 27 of file c_create_tab.c.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
void db_Cstring_to_lowercase | ( | char * | s | ) |
void db_Cstring_to_uppercase | ( | char * | s | ) |
int db_d_add_column | ( | void | ) |
Add column to table.
Definition at line 26 of file d_add_col.c.
References db_driver_add_column, db_free_column(), db_free_string(), db_init_column(), db_init_string(), DB_OK, DB_RECV_COLUMN_DEFINITION, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, and name.
void db_d_append_error | ( | const char * | , |
... | |||
) |
int db_d_begin_transaction | ( | void | ) |
Begin transaction.
Definition at line 56 of file d_execute.c.
References db_driver_begin_transaction, DB_OK, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_bind_update | ( | void | ) |
int db_d_close_cursor | ( | void | ) |
Close cursor.
Definition at line 26 of file d_close_cur.c.
References db__drop_cursor_from_driver_state(), db_driver_close_cursor, db_drop_token(), db_error(), DB_FAILED, db_find_token(), db_free(), db_free_cursor(), DB_OK, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, and NULL.
int db_d_close_database | ( | void | ) |
Close database connection.
Definition at line 25 of file d_closedb.c.
References db__close_all_cursors(), db__init_driver_state(), db__mark_database_closed(), db__test_database_open(), db_driver_close_database, db_error(), DB_OK, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_commit_transaction | ( | void | ) |
Commit transaction.
Definition at line 80 of file d_execute.c.
References db_driver_commit_transaction, DB_OK, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_create_database | ( | void | ) |
Create database.
Definition at line 26 of file d_createdb.c.
References db_driver_create_database, db_free_handle(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_create_index | ( | void | ) |
Create index.
Definition at line 26 of file d_create_idx.c.
References db_driver_create_index, db_free_index(), db_init_index(), DB_OK, DB_RECV_INDEX, DB_SEND_FAILURE, DB_SEND_STRING, DB_SEND_SUCCESS, and _db_index::indexName.
int db_d_create_table | ( | void | ) |
Create table.
Definition at line 26 of file d_create_tab.c.
int db_d_delete | ( | void | ) |
Delete record (?)
Definition at line 25 of file d_delete.c.
References db_driver_delete, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_type_update(), and NULL.
int db_d_delete_database | ( | void | ) |
Delete database.
Definition at line 26 of file d_deletedb.c.
References db_driver_delete_database, db_free_handle(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_describe_table | ( | void | ) |
Describe table.
Definition at line 26 of file d_desc_table.c.
int db_d_drop_column | ( | void | ) |
Drop column.
Definition at line 26 of file d_drop_col.c.
References db_driver_drop_column, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_drop_index | ( | void | ) |
Drop index.
Definition at line 26 of file d_drop_index.c.
References db_driver_drop_index, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, and name.
int db_d_drop_table | ( | void | ) |
Drop table.
Definition at line 26 of file d_drop_tab.c.
References db_driver_drop_table, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, and name.
int db_d_execute_immediate | ( | void | ) |
Execute SQL statements.
Definition at line 26 of file d_execute.c.
References db_driver_execute_immediate, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_fetch | ( | void | ) |
int db_d_find_database | ( | void | ) |
Find database.
Definition at line 26 of file d_finddb.c.
References db_driver_find_database, db_free_handle(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, DB_SEND_HANDLE, DB_SEND_INT, and DB_SEND_SUCCESS.
int db_d_get_num_rows | ( | void | ) |
Get number of selected rows.
Definition at line 25 of file d_rows.c.
References db_driver_get_num_rows, db_find_token(), DB_OK, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_INT, and DB_SEND_SUCCESS.
int db_d_grant_on_table | ( | void | ) |
Grant privileges on table.
Definition at line 26 of file d_priv.c.
References db_driver_grant_on_table, db_free_string(), db_init_string(), DB_OK, DB_RECV_INT, DB_RECV_STRING, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
void db_d_init_error | ( | const char * | name | ) |
int db_d_insert | ( | void | ) |
Insert new record into table.
Definition at line 25 of file d_insert.c.
References db_driver_insert, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_TABLE_DATA, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_type_insert(), NULL, and _db_cursor::table.
int db_d_list_databases | ( | void | ) |
List databases.
Definition at line 26 of file d_listdb.c.
int db_d_list_indexes | ( | void | ) |
List indexes.
Definition at line 26 of file d_list_idx.c.
References count, db_driver_list_indexes, db_free_index_array(), db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_INDEX_ARRAY, DB_SEND_SUCCESS, and list.
int db_d_list_tables | ( | void | ) |
List available tables for given connection.
Definition at line 25 of file d_list_tabs.c.
References count, db_driver_list_tables, DB_OK, DB_RECV_INT, DB_SEND_FAILURE, DB_SEND_STRING_ARRAY, and DB_SEND_SUCCESS.
int db_d_open_database | ( | void | ) |
Open database connection.
Definition at line 26 of file d_opendb.c.
References db__mark_database_open(), db__test_database_open(), db_driver_open_database, db_error(), db_free_handle(), db_get_handle_dbname(), db_get_handle_dbschema(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
int db_d_open_insert_cursor | ( | void | ) |
Open insert cursor.
Definition at line 25 of file d_openinsert.c.
int db_d_open_select_cursor | ( | void | ) |
Open select cursor.
Definition at line 26 of file d_openselect.c.
int db_d_open_update_cursor | ( | void | ) |
Open update cursor.
Definition at line 26 of file d_openupdate.c.
void void db_d_report_error | ( | void | ) |
Report error message for DB driver.
Definition at line 94 of file d_error.c.
References db_append_string(), db_error(), db_get_string(), init(), and st.
int db_d_update | ( | void | ) |
?
Definition at line 25 of file d_update.c.
References db_driver_update, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_TABLE_DATA, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_any_column_flag(), db_test_cursor_type_update(), NULL, and _db_cursor::table.
int db_d_version | ( | void | ) |
Get version info.
Definition at line 24 of file d_version.c.
References DB_OK, DB_SEND_C_STRING, DB_SEND_SUCCESS, and DB_VERSION.
const char* db_dbmscap_filename | ( | void | ) |
Get dbmscap file name.
Definition at line 57 of file dbmscap.c.
Referenced by db_read_dbmscap().
void db_debug | ( | const char * | s | ) |
void db_debug_off | ( | void | ) |
Turn off debugging.
Definition at line 216 of file db/dbmi_base/error.c.
void db_debug_on | ( | void | ) |
Turn on debugging.
Definition at line 208 of file db/dbmi_base/error.c.
int db_delete | ( | dbCursor * | cursor | ) |
Delete record (?)
cursor | db cursor |
Definition at line 26 of file c_delete.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DELETE, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.
Delete database.
driver | db driver |
handle | handle info |
Definition at line 27 of file c_deletedb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DELETE_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, and DB_START_PROCEDURE_CALL.
int db_delete_table | ( | const char * | drvname, |
const char * | dbname, | ||
const char * | tblname | ||
) |
Delete table.
drvname | driver name |
dbname | database name |
tblname | table name |
Definition at line 29 of file delete_tab.c.
References _, db_append_string(), db_close_database_shutdown_driver(), db_execute_immediate(), DB_FAILED, db_get_string(), db_init_string(), DB_OK, db_set_string(), db_start_driver_open_database(), driver, G_debug(), G_warning(), and NULL.
Describe table.
driver | db driver | |
name | table name | |
[out] | table | pointer to dbTable structure |
Definition at line 28 of file c_desc_table.c.
dbDirent* db_dirent | ( | const char * | dirname, |
int * | n | ||
) |
Read directory and build an array of dbDirent's.
Append one entry with name = NULL to mark end of array
dirname | directory name | |
[out] | n | number of entities |
Definition at line 49 of file dirent.c.
References count, and db_dirent().
Referenced by db_alloc_dirent_array(), db_dirent(), and db_free_dirent_array().
void db_double_quote_string | ( | dbString * | src | ) |
int db_driver | ( | int | , |
char ** | |||
) |
int db_driver_mkdir | ( | const char * | path, |
int | mode, | ||
int | parentdirs | ||
) |
Drop column.
driver | db driver |
tableName | table name |
columnName | column name to be dropped |
Definition at line 28 of file c_drop_col.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_COLUMN, DB_RECV_RETURN_CODE, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Drop index.
driver | db driver |
name | index name |
Definition at line 27 of file c_drop_index.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_INDEX, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, and name.
Drop table.
driver | db driver |
name | table name to be dropped |
Definition at line 28 of file c_drop_tab.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_TABLE, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, and name.
void db_drop_token | ( | dbToken | token | ) |
Drop token.
token | pointer to dbToken |
Definition at line 42 of file db/dbmi_base/token.c.
Referenced by db_d_close_cursor().
int db_enlarge_string | ( | dbString * | x, |
int | len | ||
) |
Enlarge dbString.
x | pointer to dbString |
len | requested string size |
Definition at line 120 of file string.c.
References DB_MEMORY_ERR, DB_OK, db_realloc(), NULL, and x.
void db_error | ( | const char * | s | ) |
Report error message.
s | error message (can be NULL) |
Definition at line 69 of file db/dbmi_base/error.c.
Referenced by db__recv_value(), db__send_value(), db_convert_value_to_string(), db_d_close_cursor(), db_d_close_database(), db_d_delete(), db_d_insert(), db_d_open_database(), db_d_report_error(), db_d_update(), db_get_index_column_name(), db_memory_error(), db_noproc_error(), db_procedure_not_implemented(), and db_set_index_column_name().
Execute SQL statements.
driver | db driver |
SQLstatement | SQL statement (alter, update, ...) |
Definition at line 27 of file c_execute.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_EXECUTE_IMMEDIATE, DB_RECV_RETURN_CODE, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Referenced by db_delete_table(), IL_write_point_2d(), and P_Drop_Aux_Table().
int db_fetch | ( | dbCursor * | cursor, |
int | position, | ||
int * | more | ||
) |
Find database.
driver | db driver | |
handle | handle info | |
[out] | found | if non-zero database found |
Definition at line 29 of file c_finddb.c.
References db__set_protocol_fds(), db_free_handle(), db_get_handle_dbname(), db_get_handle_dbschema(), DB_OK, DB_PROC_FIND_DATABASE, DB_RECV_HANDLE, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, db_set_handle(), and DB_START_PROCEDURE_CALL.
Find token.
token | pointer to dbToken |
Definition at line 30 of file db/dbmi_base/token.c.
Referenced by db_d_close_cursor(), db_d_delete(), db_d_get_num_rows(), db_d_insert(), and db_d_update().
void db_free | ( | void * | s | ) |
Free allocated memory.
s | pointer to memory to be freed |
Definition at line 111 of file db/dbmi_base/alloc.c.
Referenced by db__close_all_cursors(), db__mark_database_closed(), db_CatValArray_free(), db_d_close_cursor(), db_free_cursor_column_flags(), db_free_dirent_array(), db_free_handle_array(), db_free_index_array(), db_free_string(), and db_shutdown_driver().
void db_free_column | ( | dbColumn * | column | ) |
Frees column structure.
column | pointer to dbColumn |
Definition at line 454 of file dbmi_base/column.c.
References _db_column::columnName, db_free_string(), _db_column::defaultValue, _db_column::description, _db_value::s, and _db_column::value.
Referenced by db_d_add_column().
void db_free_cursor | ( | dbCursor * | cursor | ) |
Free allocated dbCursor.
cursor | pointer to dbCursor |
Definition at line 51 of file cursor.c.
References _db_cursor::column_flags, db_free_cursor_column_flags(), db_free_table(), db_init_cursor(), and _db_cursor::table.
Referenced by db_close_cursor(), and db_d_close_cursor().
void db_free_cursor_column_flags | ( | dbCursor * | cursor | ) |
Free columns' flags of cursor.
cursor | pointer to dbCursor |
Definition at line 294 of file cursor.c.
References _db_cursor::column_flags, db_free(), and NULL.
Referenced by db_free_cursor().
void db_free_dbmscap | ( | dbDbmscap * | list | ) |
void db_free_dirent_array | ( | dbDirent * | db_dirent, |
int | count | ||
) |
Free dbDirent.
db_dirent | pointer to dbDirent |
count | number of entities in the array |
Definition at line 114 of file dirent.c.
References count, db_dirent(), db_free(), db_free_string(), and name.
void db_free_handle | ( | dbHandle * | handle | ) |
Free dbHandle structure.
handle | pointer to dbHandle |
Definition at line 79 of file handle.c.
References db_free_string(), _db_handle::dbName, and _db_handle::dbSchema.
Referenced by db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), db_find_database(), and db_free_handle_array().
void db_free_handle_array | ( | dbHandle * | handle, |
int | count | ||
) |
Free array of handles.
handle | pointer to first dbHandle in the array |
count | number of handles in the array |
Definition at line 91 of file handle.c.
References count, db_free(), and db_free_handle().
void db_free_index | ( | dbIndex * | index | ) |
Free allocated dbIndex.
index | pointer to dbIndex to be freed |
Definition at line 39 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_free_string(), db_free_string_array(), db_init_index(), _db_index::indexName, _db_index::numColumns, and _db_index::tableName.
Referenced by db_create_index2(), db_d_create_index(), and db_free_index_array().
void db_free_index_array | ( | dbIndex * | list, |
int | count | ||
) |
Free index array.
list | dbIndex array |
count | number of items in the array |
Definition at line 92 of file db/dbmi_base/index.c.
References count, db_free(), and db_free_index().
Referenced by db_d_list_indexes().
void db_free_string | ( | dbString * | x | ) |
Free allocated space for dbString.
x | pointer to dbString |
Definition at line 150 of file string.c.
References db_free(), db_init_string(), and x.
Referenced by db_CatValArray_free(), db_d_add_column(), db_d_drop_column(), db_d_drop_index(), db_d_drop_table(), db_d_execute_immediate(), db_d_grant_on_table(), db_d_list_indexes(), db_free_column(), db_free_dirent_array(), db_free_handle(), db_free_index(), and db_grant_on_table().
void db_free_string_array | ( | dbString * | a, |
int | n | ||
) |
Free allocated dbString array.
a | pointer to 1st dbString in the array |
n | number of items in array |
Definition at line 163 of file string.c.
Referenced by db_free_index().
void db_free_table | ( | dbTable * | table | ) |
Free the table.
table | pointer to dbTable |
Definition at line 68 of file dbmi_base/table.c.
Referenced by db_free_cursor().
Get column structure by table and column name.
Column is set to new dbColumn structure or NULL if column was not found
Driver | DB driver | |
tname | table name | |
cname | column name | |
[out] | Column | column structure to store within |
Definition at line 124 of file dbmi_client/column.c.
Returns column default value for given column structure.
column | pointer to dbColumn |
Definition at line 39 of file dbmi_base/column.c.
References _db_column::defaultValue.
Referenced by db__recv_column_default_value(), db__send_column_default_value(), db_convert_column_default_value_to_string(), and db_convert_Cstring_to_column_default_value().
const char* db_get_column_description | ( | dbColumn * | column | ) |
Returns column description for given column.
column | pointer to dbColumn |
Definition at line 444 of file dbmi_base/column.c.
References db_get_string(), and _db_column::description.
Referenced by db_print_column_definition().
int db_get_column_host_type | ( | dbColumn * | column | ) |
Get column host type.
column | pointer to dbColumn |
Definition at line 154 of file dbmi_base/column.c.
References _db_column::hostDataType.
int db_get_column_length | ( | dbColumn * | column | ) |
Get column's length.
column | pointer to dbColumn |
Definition at line 303 of file dbmi_base/column.c.
References _db_column::dataLen.
Referenced by db_print_column_definition().
const char* db_get_column_name | ( | dbColumn * | column | ) |
Returns column name for given column.
column | pointer to dbColumn |
Definition at line 418 of file dbmi_base/column.c.
References _db_column::columnName, and db_get_string().
Referenced by db_print_column_definition().
int db_get_column_precision | ( | dbColumn * | column | ) |
Get column precision.
column | pointer to dbColumn |
Definition at line 117 of file dbmi_base/column.c.
References _db_column::precision.
Referenced by db_print_column_definition().
int db_get_column_scale | ( | dbColumn * | column | ) |
Get column scale.
column | pointer to dbColumn |
Definition at line 94 of file dbmi_base/column.c.
References _db_column::scale.
Referenced by db_print_column_definition().
int db_get_column_select_priv | ( | dbColumn * | column | ) |
Get select privileges.
column | pointer to dbColumn |
Definition at line 346 of file dbmi_base/column.c.
References _db_column::select.
int db_get_column_sqltype | ( | dbColumn * | column | ) |
Returns column sqltype for column.
The function db_sqltype_name() returns sqltype description.
column | pointer to dbColumn |
Definition at line 142 of file dbmi_base/column.c.
References _db_column::sqlDataType.
Referenced by db__recv_column_default_value(), db__recv_column_value(), db__send_column_default_value(), db__send_column_value(), db_convert_column_default_value_to_string(), db_convert_column_value_to_string(), db_convert_Cstring_to_column_default_value(), db_convert_Cstring_to_column_value(), and db_print_column_definition().
int db_get_column_update_priv | ( | dbColumn * | column | ) |
Get update privileges.
column | pointer to dbColumn |
Definition at line 378 of file dbmi_base/column.c.
References _db_column::update.
Returns column value for given column structure.
column | pointer to dbColumn |
Definition at line 27 of file dbmi_base/column.c.
References _db_column::value.
Referenced by db__recv_column_value(), db__send_column_value(), db_convert_column_value_to_string(), and db_convert_Cstring_to_column_value().
int db_get_connection | ( | dbConnection * | connection | ) |
Get default DB connection settings for the current mapset.
[out] | connection | pointer to dbConnection to be modified |
Definition at line 73 of file db/dbmi_base/connect.c.
References _db_connection::databaseName, DB_FAILED, db_get_login(), DB_OK, _db_connection::driverName, G_getenv_nofatal2(), G_VAR_MAPSET, G_zero(), _db_connection::group, _db_connection::hostName, NULL, _db_connection::password, _db_connection::port, _db_connection::schemaName, and _db_connection::user.
int db_get_cursor_number_of_columns | ( | dbCursor * | cursor | ) |
Get number of columns.
cursor | pointer to dbCursor |
Definition at line 393 of file cursor.c.
Referenced by db_bind_update().
Get table allocated by cursor.
cursor | pointer to dbCursor |
Definition at line 67 of file cursor.c.
References _db_cursor::table.
Referenced by db_open_insert_cursor().
Get cursor token.
cursor | pointer to dbCursor |
Definition at line 90 of file cursor.c.
References _db_cursor::token.
const char* db_get_default_database_name | ( | void | ) |
Get database name from current DB connection settings.
Definition at line 43 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
const char* db_get_default_driver_name | ( | void | ) |
Get driver name from current DB connection settings.
Definition at line 27 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
const char* db_get_default_group_name | ( | void | ) |
Get group name from current DB connection settings.
Definition at line 75 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
const char* db_get_default_schema_name | ( | void | ) |
Get schema name from current DB connection settings.
Definition at line 59 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
int db_get_error_code | ( | void | ) |
Get error code.
Definition at line 125 of file db/dbmi_base/error.c.
Referenced by db__recv_index_array(), and db_set_index_column_name().
const char* db_get_error_msg | ( | void | ) |
Get error message.
Definition at line 237 of file db/dbmi_base/error.c.
Referenced by db__send_failure().
const char* db_get_error_who | ( | void | ) |
brief Get 'who' string
Definition at line 59 of file db/dbmi_base/error.c.
const char* db_get_handle_dbname | ( | dbHandle * | handle | ) |
Get handle database name.
handle | pointer to dbHandle |
Definition at line 57 of file handle.c.
References db_get_string(), and _db_handle::dbName.
Referenced by db_d_open_database(), and db_find_database().
const char* db_get_handle_dbschema | ( | dbHandle * | handle | ) |
Get handle schema name.
handle | pointer to dbHandle |
Definition at line 69 of file handle.c.
References db_get_string(), and _db_handle::dbSchema.
Referenced by db_d_open_database(), and db_find_database().
const char* db_get_index_column_name | ( | dbIndex * | index, |
int | column_num | ||
) |
Get column number.
index | pointer to dbIndex |
column_num | column number |
Definition at line 194 of file db/dbmi_base/index.c.
References _, _db_index::columnNames, db_error(), db_get_string(), NULL, and _db_index::numColumns.
Referenced by db_print_index().
const char* db_get_index_name | ( | dbIndex * | index | ) |
Get index name.
index | pointer to dbIndex |
Definition at line 124 of file db/dbmi_base/index.c.
References db_get_string(), and _db_index::indexName.
Referenced by db_print_index().
int db_get_index_number_of_columns | ( | dbIndex * | index | ) |
Get number of columns.
index | pointer to dbIndex |
Definition at line 162 of file db/dbmi_base/index.c.
References _db_index::numColumns.
Referenced by db_print_index().
const char* db_get_index_table_name | ( | dbIndex * | index | ) |
Get table name.
index | pointer to dbIndex |
Definition at line 150 of file db/dbmi_base/index.c.
References db_get_string(), and _db_index::tableName.
Referenced by db_print_index().
int db_get_login | ( | const char * | driver, |
const char * | database, | ||
const char ** | user, | ||
const char ** | password, | ||
const char ** | host, | ||
const char ** | port | ||
) |
Get login parameters for driver/database.
If driver/database is not found, output arguments are set to NULL.
driver | driver name | |
database | database name (can be NULL) | |
[out] | user | name |
[out] | password | string |
[out] | host | name |
[out] | port |
Definition at line 381 of file login.c.
Referenced by db_get_connection(), and db_get_login2().
int db_get_login2 | ( | const char * | driver, |
const char * | database, | ||
const char ** | user, | ||
const char ** | password, | ||
const char ** | host, | ||
const char ** | port | ||
) |
Get login parameters for driver/database.
If driver/database is not found, output arguments are set to NULL.
driver | driver name | |
database | database name (can be NULL) | |
[out] | user | name |
[out] | password | string |
[out] | host | name |
[out] | port |
Definition at line 360 of file login.c.
References db_get_login().
int db_get_login_dump | ( | FILE * | fd | ) |
int db_get_num_rows | ( | dbCursor * | cursor | ) |
Get number of selected rows.
cursor | db select cursor |
Definition at line 26 of file c_rows.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_ROWS, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.
Referenced by db_get_table_number_of_rows().
char* db_get_string | ( | const dbString * | x | ) |
Get string.
x | pointer to dbString |
Definition at line 140 of file string.c.
References x.
Referenced by db_d_report_error(), db_delete_table(), db_get_column_description(), db_get_column_name(), db_get_handle_dbname(), db_get_handle_dbschema(), db_get_index_column_name(), db_get_index_name(), db_get_index_table_name(), db_get_table_number_of_rows(), db_get_value_string(), db_print_column_definition(), db_zero_string(), and IL_write_point_2d().
Returns column structure for given table and column number.
table | pointer to dbTable |
idx | column index (starting with '0') |
Definition at line 309 of file dbmi_base/table.c.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Returns column structure for given table and column name.
table | pointer to dbTable |
name | the name of the column |
Definition at line 325 of file dbmi_base/table.c.
int db_get_table_delete_priv | ( | dbTable * | table | ) |
Get table delete privileges.
table | pointer to dbTable |
Definition at line 295 of file dbmi_base/table.c.
const char* db_get_table_description | ( | dbTable * | table | ) |
Get the description of the table.
table | pointer to dbTable |
Definition at line 126 of file dbmi_base/table.c.
int db_get_table_insert_priv | ( | dbTable * | table | ) |
Get table insert privileges.
table | pointer to dbTable |
Definition at line 263 of file dbmi_base/table.c.
const char* db_get_table_name | ( | dbTable * | table | ) |
Get the name of the table.
table | pointer to dbTable |
Definition at line 101 of file dbmi_base/table.c.
int db_get_table_number_of_columns | ( | dbTable * | table | ) |
Return the number of columns of the table.
table | pointer to dbTable |
Definition at line 138 of file dbmi_base/table.c.
Get number of rows of table.
driver | db driver |
sql | SQL statement |
Definition at line 105 of file dbmi_client/table.c.
References _, db_close_cursor(), db_close_database_shutdown_driver(), db_get_num_rows(), db_get_string(), DB_OK, db_open_select_cursor(), DB_SEQUENTIAL, and G_warning().
int db_get_table_select_priv | ( | dbTable * | table | ) |
Get table select privileges.
table | pointer to dbTable |
Definition at line 199 of file dbmi_base/table.c.
int db_get_table_update_priv | ( | dbTable * | table | ) |
Get table update privileges.
table | pointer to dbTable |
Definition at line 231 of file dbmi_base/table.c.
double db_get_value_as_double | ( | dbValue * | value, |
int | ctype | ||
) |
Get value as double.
For given value and C type of value returns double representation.
value | pointer to dbValue |
ctype | C data type |
Definition at line 65 of file value.c.
References DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_get_value_double(), db_get_value_int(), and db_get_value_string().
int db_get_value_day | ( | dbValue * | value | ) |
Get day value.
value | pointer to dbValue |
Definition at line 128 of file value.c.
References _db_date_time::day, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
double db_get_value_double | ( | dbValue * | value | ) |
Get double precision value.
value | pointer to dbValue |
Definition at line 50 of file value.c.
References _db_value::d.
Referenced by db_convert_value_to_string(), and db_get_value_as_double().
int db_get_value_hour | ( | dbValue * | value | ) |
Get hour value.
value | pointer to dbValue |
Definition at line 140 of file value.c.
References _db_date_time::hour, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
int db_get_value_int | ( | dbValue * | value | ) |
Get integer value.
value | pointer to dbValue |
Definition at line 38 of file value.c.
References _db_value::i.
Referenced by db_convert_value_to_string(), and db_get_value_as_double().
int db_get_value_minute | ( | dbValue * | value | ) |
Get minute value.
value | pointer to dbValue |
Definition at line 152 of file value.c.
References _db_date_time::minute, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
int db_get_value_month | ( | dbValue * | value | ) |
Get month value.
value | pointer to dbValue |
Definition at line 116 of file value.c.
References _db_date_time::month, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
double db_get_value_seconds | ( | dbValue * | value | ) |
Get seconds value.
value | pointer to dbValue |
Definition at line 164 of file value.c.
References _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
const char* db_get_value_string | ( | dbValue * | value | ) |
Get string value.
value | pointer to dbValue |
Definition at line 92 of file value.c.
References db_get_string(), and _db_value::s.
Referenced by db_convert_value_to_string(), and db_get_value_as_double().
int db_get_value_year | ( | dbValue * | value | ) |
Get year value.
value | pointer to dbValue |
Definition at line 104 of file value.c.
References _db_value::t, and _db_date_time::year.
Referenced by db_convert_value_datetime_into_string().
int db_grant_on_table | ( | dbDriver * | driver, |
const char * | tableName, | ||
int | priv, | ||
int | to | ||
) |
Grant privileges on table.
driver | db driver |
tableName | table name |
priv | privileges DB_PRIV_SELECT |
to | grant to DB_GROUP | DB_PUBLIC |
Definition at line 29 of file c_priv.c.
References db__set_protocol_fds(), db_free_string(), db_init_string(), DB_OK, DB_PROC_GRANT_ON_TABLE, DB_RECV_RETURN_CODE, DB_SEND_INT, DB_SEND_STRING, db_set_string(), DB_START_PROCEDURE_CALL, and name.
Get version info.
Note: renamed from db_version to db_gversion to avoid name conflict with Berkeley DB etc.
driver | db driver | |
[out] | client_version | client version |
[out] | driver_version | driver version |
Definition at line 31 of file c_version.c.
References db__set_protocol_fds(), db_init_string(), DB_OK, DB_PROC_VERSION, DB_RECV_RETURN_CODE, DB_RECV_STRING, db_set_string(), DB_START_PROCEDURE_CALL, and DB_VERSION.
int db_has_dbms | ( | void | ) |
void db_init_column | ( | dbColumn * | column | ) |
Initialize dbColumn.
column | pointer to dbColumn to be initialized |
Definition at line 388 of file dbmi_base/column.c.
References _db_column::columnName, db_init_string(), db_zero(), _db_column::defaultValue, _db_column::description, _db_value::s, and _db_column::value.
Referenced by db_d_add_column().
void db_init_cursor | ( | dbCursor * | cursor | ) |
Initialize dbCursor.
cursor | pointer to dbCursor to be initialized |
Definition at line 23 of file cursor.c.
References G_zero(), and _db_cursor::token.
Referenced by db_free_cursor().
void db_init_handle | ( | dbHandle * | handle | ) |
Initialize handle (i.e database/schema)
handle | pointer to dbHandle to be initialized |
Definition at line 23 of file handle.c.
References db_init_string(), _db_handle::dbName, and _db_handle::dbSchema.
Referenced by db_alloc_handle_array(), db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), and db_start_driver_open_database().
void db_init_index | ( | dbIndex * | index | ) |
Initialize dbIndex.
index | pointer to dbIndex to be initialized |
Definition at line 25 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_init_string(), _db_index::indexName, NULL, _db_index::numColumns, _db_index::tableName, and _db_index::unique.
Referenced by db_alloc_index_array(), db_create_index2(), db_d_create_index(), and db_free_index().
void db_init_string | ( | dbString * | x | ) |
Initialize dbString.
[out] | x | pointer to dbString |
Definition at line 25 of file string.c.
Referenced by db_alloc_dirent_array(), db_d_add_column(), db_d_drop_column(), db_d_drop_index(), db_d_drop_table(), db_d_execute_immediate(), db_d_grant_on_table(), db_d_init_error(), db_d_list_indexes(), db_delete_table(), db_free_string(), db_grant_on_table(), db_gversion(), db_init_column(), db_init_handle(), db_init_index(), db_print_column_definition(), and P_Drop_Aux_Table().
void db_init_table | ( | dbTable * | table | ) |
Initialize the table to zero.
table | pointer to dbTable |
Definition at line 56 of file dbmi_base/table.c.
int db_insert | ( | dbCursor * | cursor | ) |
Insert new record into table.
cursor | db cursor |
Definition at line 26 of file c_insert.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_INSERT, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DATA, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, _db_cursor::table, and _db_cursor::token.
void db_interval_range | ( | int | sqltype, |
int * | from, | ||
int * | to | ||
) |
Define range based on SQL data type.
sqltype | SQL data type | |
[out] | from | |
[out] | to |
Definition at line 24 of file interval.c.
References DB_DAY, DB_FRACTION, DB_HOUR, DB_MINUTE, DB_MONTH, DB_SECOND, DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, and DB_YEAR.
Referenced by db_convert_Cstring_to_value_datetime(), db_convert_value_datetime_into_string(), and db_sqltype_name().
int db_isdir | ( | const char * | path | ) |
int db_legal_tablename | ( | const char * | s | ) |
Check if output is legal table name.
Rule: [A-Za-z][A-Za-z0-9_@]*
s | table name to be checked |
Definition at line 31 of file legal_dbname.c.
int db_list_databases | ( | dbDriver * | driver, |
dbString * | path, | ||
int | npaths, | ||
dbHandle ** | handles, | ||
int * | count | ||
) |
List databases.
driver | db driver | |
path | db path | |
npaths | number of given paths | |
[out] | handles | handle infos |
[out] | count | number of handle infos |
Definition at line 30 of file c_listdb.c.
const char* db_list_drivers | ( | void | ) |
Return comma separated list of existing DB drivers, used for driver parameter options.
Definition at line 23 of file c_list_drivers.c.
References list.
List indexes.
driver | db driver | |
table_name | table name | |
[out] | list | list of db indexes |
[out] | dbDriver | number of items in the list |
Definition at line 29 of file c_list_idx.c.
References count, db__set_protocol_fds(), DB_OK, DB_PROC_LIST_INDEXES, DB_RECV_INDEX_ARRAY, DB_RECV_RETURN_CODE, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
List available tables for given connection.
driver | db driver | |
[out] | names | list of table names |
[out] | count | number of items in the list |
system | ? |
Definition at line 39 of file c_list_tabs.c.
References count, db__set_protocol_fds(), DB_OK, DB_PROC_LIST_TABLES, DB_RECV_RETURN_CODE, DB_RECV_STRING_ARRAY, DB_SEND_INT, and DB_START_PROCEDURE_CALL.
void* db_malloc | ( | int | n | ) |
Allocate memory.
On failure is called db_memory_error().
n | number of bytes to be allocated |
Definition at line 47 of file db/dbmi_base/alloc.c.
void db_memory_error | ( | void | ) |
Report memory error.
Definition at line 133 of file db/dbmi_base/error.c.
References _, and db_error().
Add new token.
address | dbAddress of token to be added |
Definition at line 55 of file db/dbmi_base/token.c.
References count, db_realloc(), list, NONE, and NULL.
int db_nocase_compare | ( | const char * | a, |
const char * | b | ||
) |
Compare strings case-insensitive.
a,b | string buffers to be compared |
Definition at line 69 of file case.c.
Referenced by db_convert_Cstring_to_value_datetime().
void db_noproc_error | ( | int | procnum | ) |
Report no procedure error.
procnum | procedure number |
Definition at line 158 of file db/dbmi_base/error.c.
References _, db_error(), and procnum.
Referenced by db__start_procedure_call().
Open database connection.
driver | db driver |
handle | handle info (database and schema name) |
Definition at line 27 of file c_opendb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_OPEN_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, and DB_START_PROCEDURE_CALL.
Referenced by db_start_driver_open_database().
Open insert cursor.
driver | db driver |
cursor | cursor to be opened |
Definition at line 27 of file c_openinsert.c.
References db__set_protocol_fds(), db_get_cursor_table(), DB_OK, DB_PROC_OPEN_INSERT_CURSOR, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_RECV_TOKEN, DB_SEND_TABLE_DEFINITION, DB_START_PROCEDURE_CALL, _db_cursor::driver, driver, _db_cursor::mode, _db_cursor::token, and _db_cursor::type.
Open select cursor.
Open modes:
Data can be fetched by db_fetch().
Cursor should be closed by db_close_cursor().
driver | pointer to dbDriver |
select | SQL select statement (pointer to dbString) |
cursor | pointer to dbCursor to be opened |
mode | open mode |
Definition at line 37 of file c_openselect.c.
Referenced by db_get_table_number_of_rows().
int db_open_update_cursor | ( | dbDriver * | driver, |
dbString * | table_name, | ||
dbString * | select, | ||
dbCursor * | cursor, | ||
int | mode | ||
) |
Open update cursor.
driver | db driver |
table_name | table name |
select | SQL update statement (?) |
cursor | db cursor to be opened |
mode | open mode (?) |
Definition at line 30 of file c_openupdate.c.
void db_print_column_definition | ( | FILE * | fd, |
dbColumn * | column | ||
) |
Print column definition info.
fd | file descriptor |
column | column info |
Definition at line 51 of file printtab.c.
References db_convert_column_default_value_to_string(), db_get_column_description(), db_get_column_length(), db_get_column_name(), db_get_column_precision(), db_get_column_scale(), db_get_column_sqltype(), db_get_string(), db_init_string(), db_sqltype_name(), db_test_column_has_default_value(), and db_test_column_null_allowed().
void db_print_error | ( | void | ) |
Print error.
If not defined, the error message is printed to stderr.
Definition at line 182 of file db/dbmi_base/error.c.
void db_print_index | ( | FILE * | fd, |
dbIndex * | index | ||
) |
Report index.
fd | file where to print index info |
index | pointer to dbIndex |
Definition at line 254 of file db/dbmi_base/index.c.
References db_get_index_column_name(), db_get_index_name(), db_get_index_number_of_columns(), db_get_index_table_name(), and db_test_index_type_unique().
void db_print_table_definition | ( | FILE * | fd, |
dbTable * | table | ||
) |
Print table definition info.
fd | file descriptor |
table | table info |
Definition at line 26 of file printtab.c.
void db_procedure_not_implemented | ( | const char * | name | ) |
Report 'not implemented' error.
name | name of functionality |
Definition at line 144 of file db/dbmi_base/error.c.
References _, db_error(), and name.
Referenced by db__driver_add_column(), db__driver_bind_update(), db__driver_close_cursor(), db__driver_close_database(), db__driver_create_database(), db__driver_delete(), db__driver_delete_database(), db__driver_drop_column(), db__driver_drop_index(), db__driver_drop_table(), db__driver_execute_immediate(), db__driver_find_database(), db__driver_get_num_rows(), db__driver_insert(), db__driver_list_databases(), db__driver_list_indexes(), db__driver_list_tables(), db__driver_open_database(), db__driver_open_insert_cursor(), and db__driver_update().
void db_protocol_error | ( | void | ) |
Report protocol error.
Definition at line 85 of file db/dbmi_base/error.c.
Referenced by db__recv_int(), db__recv_short(), db__send_double_array(), db__send_float_array(), db__send_int(), db__send_int_array(), db__send_short_array(), and db__start_procedure_call().
dbDbmscap* db_read_dbmscap | ( | void | ) |
Read dbmscap.
dbmscap file was used in grass5.0 but it is not used in grass5.7 until we find it necessary. All code for dbmscap file is commented here.
Instead of in dbmscap file db_read_dbmscap() searches for available dbmi drivers in /driver/db/
Definition at line 98 of file dbmscap.c.
References db_dbmscap_filename(), db_syserror(), file, and NULL.
void* db_realloc | ( | void * | s, |
int | n | ||
) |
Reallocate memory.
On failure is called db_memory_error().
s | pointer to memory |
n | number of newly allocated bytes |
Definition at line 93 of file db/dbmi_base/alloc.c.
Referenced by db__add_cursor_to_driver_state(), db_enlarge_string(), and db_new_token().
int db_select_CatValArray | ( | dbDriver * | driver, |
const char * | tab, | ||
const char * | key, | ||
const char * | col, | ||
const char * | where, | ||
dbCatValArray * | cvarr | ||
) |
Select pairs key/value to array, values are sorted by key (must be integer)
driver | DB driver | |
tab | table name | |
key | key column name | |
col | value column name | |
[out] | cvarr | dbCatValArray to store within |
Definition at line 269 of file db/dbmi_client/select.c.
int db_select_int | ( | dbDriver * | driver, |
const char * | tab, | ||
const char * | col, | ||
const char * | where, | ||
int ** | pval | ||
) |
Select array of ordered integers from table/column.
driver | DB driver | |
tab | table name | |
col | column name | |
where | where statement | |
[out] | pval | array of ordered integer values |
Definition at line 103 of file db/dbmi_client/select.c.
Referenced by Vect_cats_set_constraint().
int db_select_value | ( | dbDriver * | driver, |
const char * | tab, | ||
const char * | key, | ||
int | id, | ||
const char * | col, | ||
dbValue * | val | ||
) |
Select one (first) value from table/column for key/id.
driver | DB driver | |
tab | table name | |
key | key column name | |
id | identifier in key column | |
col | name of column to select the value from | |
[out] | val | dbValue to store within |
Definition at line 204 of file db/dbmi_client/select.c.
int db_set_column_description | ( | dbColumn * | column, |
const char * | description | ||
) |
Set column description.
column | pointer to dbColumn |
description | column's description |
Definition at line 432 of file dbmi_base/column.c.
References db_set_string(), and _db_column::description.
void db_set_column_has_defined_default_value | ( | dbColumn * | column | ) |
Set default value identificator.
column | pointer to dbColumn |
Definition at line 164 of file dbmi_base/column.c.
References _db_column::hasDefaultValue.
void db_set_column_has_undefined_default_value | ( | dbColumn * | column | ) |
Unset default value identificator.
column | pointer to dbColumn |
Definition at line 176 of file dbmi_base/column.c.
References _db_column::hasDefaultValue.
void db_set_column_host_type | ( | dbColumn * | column, |
int | type | ||
) |
Set column host data type.
column | pointer to dbColumn |
type | data type |
Definition at line 82 of file dbmi_base/column.c.
void db_set_column_length | ( | dbColumn * | column, |
int | length | ||
) |
Set column's length.
column | pointer to dbColumn |
length | value |
Definition at line 314 of file dbmi_base/column.c.
References _db_column::dataLen.
int db_set_column_name | ( | dbColumn * | column, |
const char * | name | ||
) |
Set column name.
column | pointer to dbColumn |
name | column name |
Definition at line 406 of file dbmi_base/column.c.
References _db_column::columnName, db_set_string(), and name.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
void db_set_column_null_allowed | ( | dbColumn * | column | ) |
Set null value to be allowed.
column | pointer to dbColumn |
Definition at line 268 of file dbmi_base/column.c.
References _db_column::nullAllowed.
void db_set_column_precision | ( | dbColumn * | column, |
int | precision | ||
) |
Set column precision.
column | pointer to dbColumn |
precision | value |
Definition at line 128 of file dbmi_base/column.c.
References _db_column::precision.
void db_set_column_scale | ( | dbColumn * | column, |
int | scale | ||
) |
Set column scale.
column | pointer to dbColumn |
scale | column scale value |
Definition at line 105 of file dbmi_base/column.c.
void db_set_column_select_priv_granted | ( | dbColumn * | column | ) |
Set select privileges to be granted.
column | pointer to dbColumn |
Definition at line 324 of file dbmi_base/column.c.
References DB_GRANTED, and _db_column::select.
void db_set_column_select_priv_not_granted | ( | dbColumn * | column | ) |
Unset select privileges.
column | pointer to dbColumn |
Definition at line 334 of file dbmi_base/column.c.
References DB_NOT_GRANTED, and _db_column::select.
void db_set_column_sqltype | ( | dbColumn * | column, |
int | sqltype | ||
) |
Define column sqltype for column.
The function db_sqltype_name() returns sqltype description.
column | pointer to dbColumn |
sqltype | SQL data type (see list) |
Definition at line 71 of file dbmi_base/column.c.
References _db_column::sqlDataType.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
void db_set_column_update_priv_granted | ( | dbColumn * | column | ) |
Set update privileges to be granted.
column | pointer to dbColumn |
Definition at line 356 of file dbmi_base/column.c.
References DB_GRANTED, and _db_column::update.
void db_set_column_update_priv_not_granted | ( | dbColumn * | column | ) |
Unset update privileges.
column | pointer to dbColumn |
Definition at line 366 of file dbmi_base/column.c.
References DB_NOT_GRANTED, and _db_column::update.
void db_set_column_use_default_value | ( | dbColumn * | column | ) |
Set default value to be used.
column | pointer to dbColumn |
Definition at line 235 of file dbmi_base/column.c.
References _db_column::useDefaultValue.
int db_set_connection | ( | dbConnection * | connection | ) |
Set default DB connection settings.
This function sets environmental variables as DB_DRIVER, DB_DATABASE, DB_SCHEMA, DB_GROUP.
connection | pointer to dbConnection with default settings |
Definition at line 28 of file db/dbmi_base/connect.c.
References _db_connection::databaseName, DB_OK, _db_connection::driverName, G_setenv2(), G_unsetenv2(), G_VAR_MAPSET, _db_connection::group, and _db_connection::schemaName.
Referenced by db_set_default_connection().
void db_set_cursor_column_flag | ( | dbCursor * | cursor, |
int | col | ||
) |
Set column's flag.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 356 of file cursor.c.
References _db_cursor::column_flags.
Referenced by db_set_cursor_column_for_update().
void db_set_cursor_column_for_update | ( | dbCursor * | cursor, |
int | col | ||
) |
Set Column flag to 'update'.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 307 of file cursor.c.
References db_set_cursor_column_flag().
void db_set_cursor_mode | ( | dbCursor * | cursor, |
int | mode | ||
) |
void db_set_cursor_mode_insensitive | ( | dbCursor * | cursor | ) |
Set 'intensive' cursor mode.
cursor | pointer to dbCursor |
Definition at line 226 of file cursor.c.
References DB_INSENSITIVE, and _db_cursor::mode.
void db_set_cursor_mode_scroll | ( | dbCursor * | cursor | ) |
Set 'scroll' cursor mode.
cursor | pointer to dbCursor |
Definition at line 196 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.
Set cursor token.
cursor | pointer to dbCursor |
token | pointer to dbToken |
Definition at line 101 of file cursor.c.
References _db_cursor::token.
void db_set_cursor_type_insert | ( | dbCursor * | cursor | ) |
Set cursor to be writable (insert)
cursor | pointer to dbCursor |
Definition at line 131 of file cursor.c.
References DB_INSERT, and _db_cursor::type.
void db_set_cursor_type_readonly | ( | dbCursor * | cursor | ) |
Set cursor to be read-only (select)
cursor | pointer to dbCursor |
Definition at line 111 of file cursor.c.
References DB_READONLY, and _db_cursor::type.
void db_set_cursor_type_update | ( | dbCursor * | cursor | ) |
Set cursor to be writable (update)
cursor | pointer to dbCursor |
Definition at line 121 of file cursor.c.
References DB_UPDATE, and _db_cursor::type.
int db_set_default_connection | ( | void | ) |
Sets up database connection settings using GRASS default from dbmi.h.
This function ignores current DB connection settings and uses GRASS default settings instead.
Definition at line 95 of file db/dbmi_base/default_name.c.
References _, _db_connection::databaseName, DB_DEFAULT_DRIVER, DB_OK, db_set_connection(), _db_connection::driverName, G_debug(), G_fatal_error(), G_location_path(), G_make_mapset_object_group(), G_mapset(), G_zero(), and GPATH_MAX.
void db_set_error_handler_driver | ( | dbDriver * | driver | ) |
Define standard error handler for open database connection.
This handler:
Note: It's recommended to call this routine after db_start_driver_open_database().
driver | DB driver |
Definition at line 38 of file db/dbmi_client/handler.c.
References G_add_error_handler().
void db_set_error_who | ( | const char * | me | ) |
Set 'who' for error messages.
me | my name |
Definition at line 46 of file db/dbmi_base/error.c.
int db_set_handle | ( | dbHandle * | handle, |
const char * | dbName, | ||
const char * | dbSchema | ||
) |
Set handle (database and schema name)
handle | pointer to dbHandle |
dbName | database name |
dbSchema | schema name |
Definition at line 39 of file handle.c.
References DB_OK, db_set_string(), _db_handle::dbName, and _db_handle::dbSchema.
Referenced by db_find_database(), and db_start_driver_open_database().
int db_set_index_column_name | ( | dbIndex * | index, |
int | column_num, | ||
const char * | name | ||
) |
Set column name.
index | pointer to dbIndex |
column_num | column number |
name | name to be set |
Definition at line 177 of file db/dbmi_base/index.c.
References _, _db_index::columnNames, db_error(), db_get_error_code(), db_set_string(), name, and _db_index::numColumns.
Referenced by db_create_index2().
int db_set_index_name | ( | dbIndex * | index, |
const char * | name | ||
) |
Set index name.
index | pointer to dbIndex |
name | name to be set |
Definition at line 112 of file db/dbmi_base/index.c.
References db_set_string(), _db_index::indexName, and name.
Referenced by db_create_index2().
int db_set_index_table_name | ( | dbIndex * | index, |
const char * | name | ||
) |
Set table name.
index | pointer to dbIndex |
name | name to be set |
Definition at line 138 of file db/dbmi_base/index.c.
References db_set_string(), name, and _db_index::tableName.
Referenced by db_create_index2().
int db_set_index_type_non_unique | ( | dbIndex * | index | ) |
Set index type to non-unique.
index | pointer to dbIndex |
Definition at line 228 of file db/dbmi_base/index.c.
References _db_index::unique.
int db_set_index_type_unique | ( | dbIndex * | index | ) |
Set index type to unique.
index | pointer to dbIndex |
Definition at line 212 of file db/dbmi_base/index.c.
References _db_index::unique.
Referenced by db_create_index2().
int db_set_login | ( | const char * | driver, |
const char * | database, | ||
const char * | user, | ||
const char * | password, | ||
const char * | host, | ||
const char * | port, | ||
int | overwrite | ||
) |
Set login parameters for driver/database.
driver | driver name |
database | database name |
user | user name |
password | password string |
host | host name |
port | |
overwrite | TRUE to overwrite existing connections |
Definition at line 289 of file login.c.
Referenced by db_set_login2().
int db_set_login2 | ( | const char * | driver, |
const char * | database, | ||
const char * | user, | ||
const char * | password, | ||
const char * | host, | ||
const char * | port, | ||
int | overwrite | ||
) |
Set login parameters for driver/database.
driver | driver name |
database | database name |
user | user name |
password | password string |
host | host name |
port | |
overwrite | TRUE to overwrite existing connections |
Definition at line 267 of file login.c.
References db_set_login().
int db_set_string | ( | dbString * | x, |
const char * | s | ||
) |
Inserts string to dbString (enlarge string)
[in,out] | x | pointer to dbString |
s | string to be inserted |
Definition at line 41 of file string.c.
Referenced by db_convert_value_datetime_into_string(), db_convert_value_to_string(), db_delete_table(), db_grant_on_table(), db_gversion(), db_set_column_description(), db_set_column_name(), db_set_handle(), db_set_index_column_name(), db_set_index_name(), and db_set_index_table_name().
int db_set_string_no_copy | ( | dbString * | x, |
char * | s | ||
) |
Set a specific column for given table and column number.
table | Pointer to dbTable |
idx | Column index (starting with '0'). The index must be in range. |
column | Pointer to a dbColumn to insert. A copy of the column stored, so the original column can be deleted. |
Definition at line 356 of file dbmi_base/table.c.
void db_set_table_delete_priv_granted | ( | dbTable * | table | ) |
Grant delete privileges for table.
table | pointer to dbTable |
Definition at line 273 of file dbmi_base/table.c.
void db_set_table_delete_priv_not_granted | ( | dbTable * | table | ) |
Set delete privileges not granted for table.
table | pointer to dbTable |
Definition at line 283 of file dbmi_base/table.c.
int db_set_table_description | ( | dbTable * | table, |
const char * | description | ||
) |
Set the description of the table.
table | pointer to dbTable |
name | description of the table |
Definition at line 114 of file dbmi_base/table.c.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
void db_set_table_insert_priv_granted | ( | dbTable * | table | ) |
Grant insert privileges for table.
table | pointer to dbTable |
Definition at line 241 of file dbmi_base/table.c.
void db_set_table_insert_priv_not_granted | ( | dbTable * | table | ) |
Set insert privileges not granted for table.
table | pointer to dbTable |
Definition at line 251 of file dbmi_base/table.c.
int db_set_table_name | ( | dbTable * | table, |
const char * | name | ||
) |
Set the name of the table.
table | pointer to dbTable |
name | The name of the table |
Definition at line 89 of file dbmi_base/table.c.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
void db_set_table_select_priv_granted | ( | dbTable * | table | ) |
Grant selection privileges for all columns.
table | pointer to dbTable |
Definition at line 177 of file dbmi_base/table.c.
void db_set_table_select_priv_not_granted | ( | dbTable * | table | ) |
Set selection privileges not granted for all columns.
table | pointer to dbTable |
Definition at line 187 of file dbmi_base/table.c.
void db_set_table_update_priv_granted | ( | dbTable * | table | ) |
Grant update privileges for all columns.
table | pointer to dbTable |
Definition at line 209 of file dbmi_base/table.c.
void db_set_table_update_priv_not_granted | ( | dbTable * | table | ) |
Set update privileges not granted for all columns.
table | pointer to dbTable |
Definition at line 219 of file dbmi_base/table.c.
void db_set_value_datetime_current | ( | dbValue * | value | ) |
Set datetime to current.
value | pointer to dbValue |
Definition at line 315 of file value.c.
References _db_date_time::current, db_set_value_not_null(), and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_datetime_not_current | ( | dbValue * | value | ) |
Set value to non-current.
value | pointer to dbValue |
Definition at line 326 of file value.c.
References _db_date_time::current, db_set_value_not_null(), and _db_value::t.
Referenced by db_set_value_day(), db_set_value_hour(), db_set_value_minute(), db_set_value_month(), db_set_value_seconds(), and db_set_value_year().
void db_set_value_day | ( | dbValue * | value, |
int | day | ||
) |
Set day value.
value | pointer to dbValue |
day | day value |
Definition at line 255 of file value.c.
References _db_date_time::day, db_set_value_datetime_not_current(), and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_double | ( | dbValue * | value, |
double | d | ||
) |
void db_set_value_hour | ( | dbValue * | value, |
int | hour | ||
) |
Set hour value.
value | pointer to dbValue |
hour | hour value |
Definition at line 267 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::hour, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_int | ( | dbValue * | value, |
int | i | ||
) |
Set integer value.
value | pointer to dbValue |
i | integer value |
Definition at line 195 of file value.c.
References db_set_value_not_null(), and _db_value::i.
void db_set_value_minute | ( | dbValue * | value, |
int | minute | ||
) |
Set minute value.
value | pointer to dbValue |
minute | minute value |
Definition at line 279 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::minute, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_month | ( | dbValue * | value, |
int | month | ||
) |
Set month value.
value | pointer to dbValue |
month | month value |
Definition at line 243 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::month, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_not_null | ( | dbValue * | value | ) |
Set value to not null.
value | pointer to dbValue |
Definition at line 184 of file value.c.
References _db_value::isNull.
Referenced by db_set_value_datetime_current(), db_set_value_datetime_not_current(), and db_set_value_int().
void db_set_value_null | ( | dbValue * | value | ) |
Set value to null.
value | pointer to dbValue |
Definition at line 174 of file value.c.
References _db_value::isNull.
void db_set_value_seconds | ( | dbValue * | value, |
double | seconds | ||
) |
Set seconds value.
value | pointer to dbValue |
seconds | seconds value |
Definition at line 291 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
int db_set_value_string | ( | dbValue * | value, |
const char * | s | ||
) |
void db_set_value_year | ( | dbValue * | value, |
int | year | ||
) |
Set year value.
value | pointer to dbValue |
year | year value |
Definition at line 231 of file value.c.
References db_set_value_datetime_not_current(), _db_value::t, and _db_date_time::year.
Referenced by db_convert_Cstring_to_value_datetime().
int db_shutdown_driver | ( | dbDriver * | driver | ) |
Closedown the driver, and free the driver structure.
Note: the management of the memory for the driver structure probably should be handled differently.
db_start_driver() could take a pointer to driver structure as an argument, instead of returning the pointer to allocated then there would be no hidden free required
driver | pointer to dbDriver to be freed |
Definition at line 36 of file shutdown.c.
References db__set_protocol_fds(), db_free(), DB_PROC_SHUTDOWN_DRIVER, DB_START_PROCEDURE_CALL, db_unset_error_handler_driver(), G_wait(), and NULL.
Referenced by db_close_database_shutdown_driver(), db_start_driver_open_database(), and IL_write_point_2d().
unsigned int db_sizeof_string | ( | const dbString * | x | ) |
const char* db_sqltype_name | ( | int | sqltype | ) |
Get SQL data type description.
sqltype | SQL data type |
Definition at line 25 of file sqltype.c.
References DB_DATETIME_MASK, DB_DAY, DB_FRACTION, DB_HOUR, db_interval_range(), DB_MINUTE, DB_MONTH, DB_SECOND, DB_SQL_TYPE_CHARACTER, DB_SQL_TYPE_DATE, DB_SQL_TYPE_DECIMAL, DB_SQL_TYPE_DOUBLE_PRECISION, DB_SQL_TYPE_INTEGER, DB_SQL_TYPE_INTERVAL, DB_SQL_TYPE_NUMERIC, DB_SQL_TYPE_REAL, DB_SQL_TYPE_SERIAL, DB_SQL_TYPE_SMALLINT, DB_SQL_TYPE_TEXT, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, DB_YEAR, and strcpy.
Referenced by db_print_column_definition().
int db_sqltype_to_Ctype | ( | int | sqltype | ) |
Get C data type based on given SQL data type.
sqltype | SQL data type |
Definition at line 24 of file sqlCtype.c.
References DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, DB_DATETIME_MASK, DB_SQL_TYPE_DATE, DB_SQL_TYPE_DOUBLE_PRECISION, DB_SQL_TYPE_INTEGER, DB_SQL_TYPE_INTERVAL, DB_SQL_TYPE_REAL, DB_SQL_TYPE_SERIAL, DB_SQL_TYPE_SMALLINT, DB_SQL_TYPE_TIME, and DB_SQL_TYPE_TIMESTAMP.
Referenced by db__recv_column_default_value(), db__recv_column_value(), db__send_column_default_value(), db__send_column_value(), and db_convert_value_to_string().
dbDriver* db_start_driver | ( | const char * | name | ) |
Initialize a new dbDriver for db transaction.
If name is NULL, the db name will be assigned connection.driverName.
name | driver name |
Definition at line 51 of file start.c.
Referenced by db_start_driver_open_database().
dbDriver* db_start_driver_open_database | ( | const char * | drvname, |
const char * | dbname | ||
) |
Open driver/database connection.
drvname | driver name |
dbname | database name |
Definition at line 28 of file db.c.
References _, db_init_handle(), DB_OK, db_open_database(), db_set_handle(), db_shutdown_driver(), db_start_driver(), driver, G_debug(), G_warning(), and NULL.
Referenced by db_delete_table(), and Vect_cats_set_constraint().
char* db_store | ( | const char * | s | ) |
Make a copy of string buffer.
Allocated string buffer should be freed by db_free().
s | source string buffer |
Definition at line 28 of file db/dbmi_base/alloc.c.
Referenced by db__mark_database_open().
void db_strip | ( | char * | buf | ) |
void db_syserror | ( | const char * | s | ) |
Report system error.
s | error message |
Definition at line 101 of file db/dbmi_base/error.c.
Referenced by db_read_dbmscap().
int db_table_exists | ( | const char * | drvname, |
const char * | dbname, | ||
const char * | tabname | ||
) |
Check if table exists.
drvname | driver name |
dbname | database name |
tabname | table name |
Definition at line 32 of file dbmi_client/table.c.
Create SQL CREATE string from table definition.
table | pointer to dbTable |
sql | dbString to store the SQL CREATE string |
Definition at line 428 of file dbmi_base/table.c.
int db_test_column_has_default_value | ( | dbColumn * | column | ) |
Check if column has defined default value.
column | pointer to dbColumn |
Definition at line 199 of file dbmi_base/column.c.
References _db_column::hasDefaultValue.
Referenced by db_print_column_definition().
int db_test_column_has_defined_default_value | ( | dbColumn * | column | ) |
Check if column has defined default value.
column | pointer to dbColumn |
Definition at line 212 of file dbmi_base/column.c.
References _db_column::hasDefaultValue.
int db_test_column_has_undefined_default_value | ( | dbColumn * | column | ) |
Check if column has defined default value.
column | pointer to dbColumn |
Definition at line 225 of file dbmi_base/column.c.
References _db_column::hasDefaultValue.
int db_test_column_null_allowed | ( | dbColumn * | column | ) |
Checks if null value is allowed.
column | pointer to dbColumn |
Definition at line 291 of file dbmi_base/column.c.
References _db_column::nullAllowed.
Referenced by db_print_column_definition().
int db_test_column_use_default_value | ( | dbColumn * | column | ) |
Checks if default value is used.
column | pointer to dbColumn |
Definition at line 258 of file dbmi_base/column.c.
References _db_column::useDefaultValue.
int db_test_cursor_any_column_flag | ( | dbCursor * | cursor | ) |
Checks columns' flag.
Is any cursor column flag set?
cursor | pointer to dbCursor |
Definition at line 413 of file cursor.c.
Referenced by db_d_update(), and db_test_cursor_any_column_for_update().
int db_test_cursor_any_column_for_update | ( | dbCursor * | cursor | ) |
Check if columns' flag is 'update'.
cursor | pointer to dbCursor |
Definition at line 345 of file cursor.c.
References db_test_cursor_any_column_flag().
int db_test_cursor_column_flag | ( | dbCursor * | cursor, |
int | col | ||
) |
Checks column's flag.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 383 of file cursor.c.
References _db_cursor::column_flags.
Referenced by db_test_cursor_column_for_update().
int db_test_cursor_column_for_update | ( | dbCursor * | cursor, |
int | col | ||
) |
Check if column flag is 'update'.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 332 of file cursor.c.
References db_test_cursor_column_flag().
int db_test_cursor_mode_insensitive | ( | dbCursor * | cursor | ) |
Check if cursor mode is 'intensive'.
cursor | pointer to dbCursor |
Definition at line 262 of file cursor.c.
References DB_INSENSITIVE, and _db_cursor::mode.
int db_test_cursor_mode_scroll | ( | dbCursor * | cursor | ) |
Check if cursor mode is 'scroll'.
cursor | pointer to dbCursor |
Definition at line 249 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.
int db_test_cursor_type_fetch | ( | dbCursor * | cursor | ) |
Check cursor type.
cursor | pointer to dbCursor |
Definition at line 144 of file cursor.c.
References DB_INSERT, DB_READONLY, DB_UPDATE, and _db_cursor::type.
int db_test_cursor_type_insert | ( | dbCursor * | cursor | ) |
Check if cursor type is 'insert'.
cursor | pointer to dbCursor |
Definition at line 171 of file cursor.c.
References DB_INSERT, and _db_cursor::type.
Referenced by db_d_insert().
int db_test_cursor_type_update | ( | dbCursor * | cursor | ) |
Check if cursor type is 'update'.
cursor | pointer to dbCursor |
Definition at line 158 of file cursor.c.
References DB_UPDATE, and _db_cursor::type.
Referenced by db_d_delete(), and db_d_update().
int db_test_index_type_unique | ( | dbIndex * | index | ) |
Test if type is unique.
index | pointer to dbIndex |
Definition at line 243 of file db/dbmi_base/index.c.
References _db_index::unique.
Referenced by db_print_index().
int db_test_value_datetime_current | ( | dbValue * | value | ) |
Check if datatime is current.
value | pointer to dbValue |
Definition at line 305 of file value.c.
References _db_date_time::current, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
int db_test_value_isnull | ( | dbValue * | value | ) |
Check of value is null.
value | pointer to dbValue |
Definition at line 26 of file value.c.
References _db_value::isNull.
Referenced by db_convert_value_to_string().
void db_unset_column_has_default_value | ( | dbColumn * | column | ) |
Unset default value identificator.
column | pointer to dbColumn |
Definition at line 186 of file dbmi_base/column.c.
References _db_column::hasDefaultValue.
void db_unset_column_null_allowed | ( | dbColumn * | column | ) |
Unset null value to be allowed.
column | pointer to dbColumn |
Definition at line 278 of file dbmi_base/column.c.
References _db_column::nullAllowed.
void db_unset_column_use_default_value | ( | dbColumn * | column | ) |
Unset default value to be used.
column | pointer to dbColumn |
Definition at line 245 of file dbmi_base/column.c.
References _db_column::useDefaultValue.
void db_unset_cursor_column_flag | ( | dbCursor * | cursor, |
int | col | ||
) |
Unset column's flag.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 368 of file cursor.c.
References _db_cursor::column_flags.
Referenced by db_unset_cursor_column_for_update().
void db_unset_cursor_column_for_update | ( | dbCursor * | cursor, |
int | col | ||
) |
Unset 'update' column flag.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 318 of file cursor.c.
References db_unset_cursor_column_flag().
void db_unset_cursor_mode | ( | dbCursor * | cursor | ) |
Unset cursor mode.
cursor | pointer to dbCursor |
Definition at line 216 of file cursor.c.
References _db_cursor::mode.
void db_unset_cursor_mode_insensitive | ( | dbCursor * | cursor | ) |
Unset 'intensive' cursor mode.
cursor | pointer to dbCursor |
Definition at line 236 of file cursor.c.
References DB_INSENSITIVE, and _db_cursor::mode.
void db_unset_cursor_mode_scroll | ( | dbCursor * | cursor | ) |
Unset 'scroll' cursor mode.
cursor | pointer to dbCursor |
Definition at line 206 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.
void db_unset_error_handler_driver | ( | dbDriver * | driver | ) |
Remove error handler before closing the driver.
driver | DB driver |
Definition at line 48 of file db/dbmi_client/handler.c.
References G_remove_error_handler().
Referenced by db_shutdown_driver().
int db_update | ( | dbCursor * | cursor | ) |
?
cursor | db cursor |
Definition at line 26 of file c_update.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_UPDATE, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DATA, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, _db_cursor::table, and _db_cursor::token.
const char* db_whoami | ( | void | ) |
Who am i?
Check environmental variable LOGNAME
Definition at line 26 of file db/dbmi_base/whoami.c.
References G_store().
void db_zero | ( | void * | s, |
int | n | ||
) |
Zero allocated space.
s | pointer to memory |
n | number of bytes |
Definition at line 23 of file db/dbmi_base/zero.c.
Referenced by db__init_driver_state(), db_init_column(), and db_zero_string().
void db_zero_string | ( | dbString * | x | ) |
Zero string.
x | pointer to dbString |
Definition at line 79 of file string.c.
References db_get_string(), db_zero(), and x.
Referenced by IL_write_point_2d().