Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

Database Module

The functions in the database module provide the interface to the database drivers and database connections. More...


Files

file  d_mysql_f.c
 Forms version of MySQL driver.

file  d_mysql_f.h
 Include file for Forms version of MySQL driver.

file  d_postgres_f.c
 Forms version of the PostgreSQL driver.

file  d_postgres_f.h
 Include file for PostgreSQL driver.

file  d_xpath_f.c
 Experimental XPath driver.

file  d_xpath_f.h
 Include file for Forms version of XPath driver.

file  db_conn.c
 Functions for manipulating DBConnection's.

file  db_conn.h
 Defines the database driver interface.

file  dbapi.c
 Public database API.

file  dbapi.h
 Public database API.

file  dburl.c
 URL handling functions.

file  dburl.h
 Interface ti URL handling functions.


Data Structures

struct  _dbconnector
 Data passed from the application to the driver when initiating a connection. More...

struct  _keyword
 Auto-completion keyword list. More...

struct  db_conn
 Per-connection database structure. More...

struct  DBFieldDef
 Field record. More...

struct  DBTableDef
 Table record. More...


Typedefs

typedef _dbconnector DBConnector
 DBConnector is the type used to refer to the _dbconnector structure.

typedef _keyword Keyword
 Auto-completion keyword list.

typedef db_conn DBConnection
 DBConnection is the type used to refer to the db_conn structure.

typedef DBConnector *(* db_register_func )(void(*error_dialog)(char *, char *))
 Returns an initialised DBConnector for the database driver.


Enumerations

enum  QueryStatus
 Query Status codes.

enum  ConnectStatus
 How to connect.


Functions

DBConnectiondb_connect (DBConnector *dbc)
 Connects to the database defined in the current workspace.

DBConnectiondb_connect_url (char *url)
 Connects to the database specified in th URL.

void db_disconnect (DBConnection *conn, void(*display_error)(char *, char *))
 Disconnect from database.

DBConnectordbconnector_new (void)
 Allocates a new empty DBConnector.


Detailed Description

The functions in the database module provide the interface to the database drivers and database connections.

All calls from other parts of the program to the database system should be through the interface defined in this module.

All calls from other parts of the program to the database system should be through the interface defined in this module.

There are two main structures provided by the module:


Function Documentation

DBConnection* db_connect DBConnector   dbc
 

Connects to the database defined in the current workspace.

Parameters:
dbc  The connector to use.
Returns:
A pointer to the new DBConnection structure, or NULL on error.

Definition at line 76 of file dbapi.c.

References db_conn::connectionStatus, and _dbconnector::db_connect_callback.

Referenced by db_connect_dialog_reconnect().

DBConnection* db_connect_url char *    url
 

Connects to the database specified in th URL.

Parameters:
url  The database URL to connect to.
Returns:
The DBConnection.

Definition at line 42 of file dbapi.c.

References db_conn::connectionStatus, _dbconnector::db_connect_callback, _dbconnector::db_frm, dburl_get_connector(), and _dbconnector::url_to_form.

Referenced by cfg_parse_cmdline(), and lic_connect().

void db_disconnect DBConnection   conn,
void(*    display_error)(char *, char *)
 

Disconnect from database.

Parameters:
conn  The connection to disconnect.
display_error  A pointer to an error function with this signature: void display_error(char *title, char *msg). If not NULL, this function is called to display error messages if required.

Definition at line 91 of file dbapi.c.

References db_conn::DBdisconnect, and display_error().

Referenced by gui_disconnect().

DBConnector* dbconnector_new void   
 

Allocates a new empty DBConnector.

All fields are NULL-filled.

Returns:
A pointer to a new DBConnector.

Definition at line 68 of file dbapi.c.

Referenced by register_PostgreSQL(), and register_XPath().


Generated on Sun May 9 19:19:27 2004 for GtkSQL by doxygen1.2.18