GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
DBMI Library (base) - columns management. More...
Go to the source code of this file.
Functions | |
dbValue * | db_get_column_value (dbColumn *column) |
Returns column value for given column structure. More... | |
dbValue * | db_get_column_default_value (dbColumn *column) |
Returns column default value for given column structure. More... | |
void | db_set_column_sqltype (dbColumn *column, int sqltype) |
Define column sqltype for column. More... | |
void | db_set_column_host_type (dbColumn *column, int type) |
Set column host data type. More... | |
int | db_get_column_scale (dbColumn *column) |
Get column scale. More... | |
void | db_set_column_scale (dbColumn *column, int scale) |
Set column scale. More... | |
int | db_get_column_precision (dbColumn *column) |
Get column precision. More... | |
void | db_set_column_precision (dbColumn *column, int precision) |
Set column precision. More... | |
int | db_get_column_sqltype (dbColumn *column) |
Returns column sqltype for column. More... | |
int | db_get_column_host_type (dbColumn *column) |
Get column host type. More... | |
void | db_set_column_has_defined_default_value (dbColumn *column) |
Set default value identificator. More... | |
void | db_set_column_has_undefined_default_value (dbColumn *column) |
Unset default value identificator. More... | |
void | db_unset_column_has_default_value (dbColumn *column) |
Unset default value identificator. More... | |
int | db_test_column_has_default_value (dbColumn *column) |
Check if column has defined default value. More... | |
int | db_test_column_has_defined_default_value (dbColumn *column) |
Check if column has defined default value. More... | |
int | db_test_column_has_undefined_default_value (dbColumn *column) |
Check if column has defined default value. More... | |
void | db_set_column_use_default_value (dbColumn *column) |
Set default value to be used. More... | |
void | db_unset_column_use_default_value (dbColumn *column) |
Unset default value to be used. More... | |
int | db_test_column_use_default_value (dbColumn *column) |
Checks if default value is used. More... | |
void | db_set_column_null_allowed (dbColumn *column) |
Set null value to be allowed. More... | |
void | db_unset_column_null_allowed (dbColumn *column) |
Unset null value to be allowed. More... | |
int | db_test_column_null_allowed (dbColumn *column) |
Checks if null value is allowed. More... | |
int | db_get_column_length (dbColumn *column) |
Get column's length. More... | |
void | db_set_column_length (dbColumn *column, int length) |
Set column's length. More... | |
void | db_set_column_select_priv_granted (dbColumn *column) |
Set select privileges to be granted. More... | |
void | db_set_column_select_priv_not_granted (dbColumn *column) |
Unset select privileges. More... | |
int | db_get_column_select_priv (dbColumn *column) |
Get select privileges. More... | |
void | db_set_column_update_priv_granted (dbColumn *column) |
Set update privileges to be granted. More... | |
void | db_set_column_update_priv_not_granted (dbColumn *column) |
Unset update privileges. More... | |
int | db_get_column_update_priv (dbColumn *column) |
Get update privileges. More... | |
void | db_init_column (dbColumn *column) |
Initialize dbColumn. More... | |
int | db_set_column_name (dbColumn *column, const char *name) |
Set column name. More... | |
const char * | db_get_column_name (dbColumn *column) |
Returns column name for given column. More... | |
int | db_set_column_description (dbColumn *column, const char *description) |
Set column description. More... | |
const char * | db_get_column_description (dbColumn *column) |
Returns column description for given column. More... | |
void | db_free_column (dbColumn *column) |
Frees column structure. More... | |
dbColumn * | db_copy_column (dbColumn *dest, dbColumn *src) |
Copy a db column from source to destination. More... | |
DBMI Library (base) - columns management.
(C) 1999-2009, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file dbmi_base/column.c.
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 473 of file dbmi_base/column.c.
Referenced by db_append_table_column(), and db_set_table_column().
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().
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().
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_init_string(), and db_zero().
Referenced by db_d_add_column().
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, and db_set_string().
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_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.
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.