1 /* dbfncs.h header file for dbfncs.c */ 2 /* markus@mhoenicka.de 2002-08-06 */ 3 /* $Id: dbfncs.h,v 1.6.2.5 2005/09/11 19:58:10 mhoenicka Exp $ */ 4 5 /* 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 21 22 struct db_caps { 23 char multiple_db[2]; /* if t, SELECT can address tables in more than 24 one db */ 25 char sql_enum[2]; /* if t, the db engine supports an enum type */ 26 char rlike[13]; /* what SELECT uses to implement a regexp like */ 27 char not_rlike[17]; /* what SELECT uses to implement a regexp not like */ 28 char transaction[2]; /* if t, the db engine supports transactions */ 29 char localhost[10]; /* the string used to access the db engine on 30 localhost */ 31 char encoding[16]; /* command fragment to request char encodings */ 32 char groups[3]; /* if t, db engine uses groups to manage users */ 33 char admin_systable[11]; /* a table that only the admin may access */ 34 char listall[3]; /* the string used in SELECT to list all entries */ 35 char bigint[2]; /* if t, db engine supports unsigned long long */ 36 char sql_union[2]; /* if t, the db engine supports UNION in SELECT */ 37 char named_seq[2]; /* if t, sequence_last() needs seq name */ 38 char charlength[12]; /* the SQL function returning the length of a string */ 39 char substring[10]; /* the SQL function used to retrieve a substring */ 40 char substring_from[7]; /* the from part of the substring function */ 41 char substring_for[6]; /* the for part of the substring function */ 42 char sql_except[2]; /* if t, supports EXCEPT in SELECT clauses */ 43 char defval[2]; /* default return value if nothing else helps */ 44 char unix_regexp[2]; /* if t, supports unix regular expressions */ 45 int has_versioninfo; /* if non-zero, struct was updated with db 46 engine version-specific information */ 47 }; 48 49 struct db_caps* new_db_caps(struct CLIENT_REQUEST* ptr_clrequest); 50 void free_db_caps(struct db_caps* ptr_caps); 51 int create_tables_mysql(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest, int is_temp); 52 int create_xdup_tables_mysql(dbi_conn conn); 53 int create_tables_pgsql(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest, int is_temp); 54 int create_xdup_tables_pgsql(dbi_conn conn); 55 int create_tables_sqlite(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest, int is_temp); 56 int create_xdup_tables_sqlite(dbi_conn conn); 57 int create_tables_sqlite3(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest, int is_temp); 58 int create_xdup_tables_sqlite3(dbi_conn conn); 59 int is_user_pgsql(dbi_conn conn, const char* username); 60 int is_group_pgsql(dbi_conn conn, const char* dbname, int is_readonly); 61 int create_temporary_tables(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); 62 const char* my_dbi_driver_regexp(dbi_driver driver, int like); 63 int my_dbi_conn_begin(dbi_conn conn); 64 int my_dbi_conn_rollback(dbi_conn conn); 65 int my_dbi_conn_commit(dbi_conn conn); 66 int my_dbi_conn_lock(dbi_conn conn, int replace_ref); 67 int my_dbi_conn_lock_note(dbi_conn conn); 68 int my_dbi_conn_unlock(dbi_conn conn); 69 const char* my_dbi_conn_get_cap(dbi_conn conn, const char* cap); 70 const char* my_dbi_driver_get_cap(dbi_driver driver, const char* cap); 71 unsigned long long my_dbi_result_get_idval(dbi_result dbires, const char* fieldname); 72 unsigned long long my_dbi_result_get_idval_idx(dbi_result dbires, unsigned int idx); 73 unsigned int my_dbi_result_get_int_idval(dbi_result dbires, const char* fieldname); 74 unsigned int my_dbi_result_get_int_idval_idx(dbi_result dbires, unsigned int idx); 75 int my_dbi_conn_get_versioninfo(dbi_conn conn, struct VERSIONINFO* ptr_ver); 76 77 78 79 80