35 return (table =
NULL);
42 return (table =
NULL);
45 for (i = 0; i < ncols; i++)
143 static void set_all_column_privs(
dbTable * table,
void (*set_column_priv) ())
149 for (col = 0; col < ncols; col++) {
151 set_column_priv(column);
155 static int get_all_column_privs(
dbTable * table,
int (*get_column_priv) ())
157 int priv, col, ncols;
161 for (col = 0; col < ncols; col++) {
163 priv = get_column_priv(column);
328 for(i = 0; i <
columns; i++ ) {
403 for(i = 0; i < n; i++)
438 for (col = 0; col < ncols; col++) {
463 G_warning(
"Type TEXT converted to 'VARCHAR(250)'");
487 G_warning(
"Unknown column type (%s)", colname);
void * db_realloc(void *, int)
Reallocate memory.
int db_table_to_sql(dbTable *table, dbString *sql)
Create SQL CREATE sring from table definition.
#define DB_SQL_TYPE_INTEGER
#define DB_SQL_TYPE_INTERVAL
#define DB_SQL_TYPE_TIMESTAMP
dbTable * db_alloc_table(int ncols)
Allocate a table with a specific number of columns.
int db_get_column_length(dbColumn *)
Get column's length.
const char * db_get_column_name(dbColumn *)
Returns column name for given column.
int db_set_table_name(dbTable *table, const char *name)
Set the name of the table.
void db_init_string(dbString *)
Initialize dbString.
int db_get_table_select_priv(dbTable *table)
Get table select privileges.
void db_set_table_update_priv_not_granted(dbTable *table)
Set update privileges not granted for all columns.
void db_zero(void *, int)
Zero allocated space.
void db_set_table_update_priv_granted(dbTable *table)
Grant update privileges for all columns.
dbColumn * db_get_table_column_by_name(dbTable *table, const char *name)
Returns column structure for given table and column name.
int db_get_column_select_priv(dbColumn *)
Get select privileges.
char * db_get_string(const dbString *)
Get string.
int db_copy_string(dbString *, const dbString *)
Copy dbString.
void db_free(void *)
Free allocated memory.
#define DB_SQL_TYPE_CHARACTER
int db_set_string(dbString *, const char *)
Inserts string to dbString (enlarge string)
dbTable * db_clone_table(dbTable *src)
Make a new exact copy of an existing table.
int db_get_column_update_priv(dbColumn *)
Get update privileges.
int db_get_table_update_priv(dbTable *table)
Get table update privileges.
void db_set_table_insert_priv_granted(dbTable *table)
Grant insert privileges for table.
int db_get_column_sqltype(dbColumn *)
Returns column sqltype for column.
const char * db_sqltype_name(int)
Get SQL data type description.
int db_append_string(dbString *, const char *)
Append string to dbString.
int db_append_table_column(dbTable *table, dbColumn *column)
Append a specific column to given table.
const char * db_get_table_description(dbTable *table)
Get the description of the table.
int db_get_table_number_of_columns(dbTable *table)
Return the number of columns of the table.
void db_init_column(dbColumn *)
Initialize dbColumn.
int db_get_table_delete_priv(dbTable *table)
Get table delete privileges.
int db_sqltype_to_Ctype(int)
Get C data type based on given SQL data type.
int db_set_table_column(dbTable *table, int idx, dbColumn *column)
Set a specific column for given table and column number.
#define DB_SQL_TYPE_NUMERIC
void * db_calloc(int, int)
Allocate memory.
void db_set_column_select_priv_granted(dbColumn *)
Set select privileges to be granted.
#define DB_SQL_TYPE_DOUBLE_PRECISION
void db_set_table_insert_priv_not_granted(dbTable *table)
Set insert privileges not granted for table.
int db_get_table_insert_priv(dbTable *table)
Get table insert privileges.
void db_init_table(dbTable *table)
Initialize the table to zero.
void db_set_table_select_priv_granted(dbTable *table)
Grant selection privileges for all columns.
void db_free_table(dbTable *table)
Free the table.
void db_set_column_update_priv_granted(dbColumn *)
Set update privileges to be granted.
void db_set_table_delete_priv_granted(dbTable *table)
Grant delete privileges for table.
void G_warning(const char *,...) __attribute__((format(printf
int db_set_table_description(dbTable *table, const char *description)
Set the description of the table.
#define DB_SQL_TYPE_SMALLINT
void db_set_column_update_priv_not_granted(dbColumn *)
Unset update privileges.
void db_set_table_delete_priv_not_granted(dbTable *table)
Set delete privileges not granted for table.
void db_set_table_select_priv_not_granted(dbTable *table)
Set selection privileges not granted for all columns.
void * db_malloc(int)
Allocate memory.
#define DB_SQL_TYPE_DECIMAL
struct _db_column dbColumn
const char * db_get_table_name(dbTable *table)
Get the name of the table.
dbColumn * db_get_table_column(dbTable *table, int idx)
Returns column structure for given table and column number.
void db_set_column_select_priv_not_granted(dbColumn *)
Unset select privileges.
dbColumn * db_copy_column(dbColumn *, dbColumn *)
Copy a db column from source to destination.
int G_debug(int, const char *,...) __attribute__((format(printf
void db_free_string(dbString *)
Free allocated space for dbString.
void db_free_column(dbColumn *)
Frees column structure.