- Synchronous / asynchronous mode
- Multi threaded environment
- Methods - provider's information
- Methods - connection management
- Methods - DDL queries
- Methods - transactions management
- Methods - DML queries
- Methods - data representation
- Methods - metadata
- Methods - misc.
Database providers usually (that is except for virtual providers explained later) subclass the GdaServerProvider class and implement at least the mandatory virtual methods.
Virtual providers are database providers when the database engine accessed does not support SQL (or supports it poorly), such as Berkeley databases or MDB (or even LDAP). These provider's implementation's design is to create GdaDataModel data model objects and make each of them appear as a named table once the connection is opened. For example the MDB provider creates a read-only data model for each table in an MDB file and make it appear using the original table name used in MS Access (the tables cannot be modified but it is possible to use all SQLite's SQL to make SELECT queries).
Virtual providers inherit the GdaVproviderDataModel class and not the GdaServerProvider as "normal" providers do, and the number of virtual methods to implement is very limited: only the get_name(), get_version(), get_server_version(), open_connection() and get_database() should be implemented, optionnally the close_connection() can also be implemented.
All the provider's commands are executed in a synchronous mode (the caller is blocked until the provider's
method terminates). However some virtual methods have the a
exec_cb callback function pointer and
cb_data parameter which can be set when an asynchronous mode
is required; asynchronous mode is requested if and only if the
exec_cb parmeter is not NULL.
When an asynchronous mode is requested, the method should return TRUE if it returns a boolean or NULL if it returns a
pointer and set a task identifier
task_id parameter if not NULL. The task identifier is passed again when
exec_cb callback functions are called by the
provider when the execution is finished.
When the provider's method terminates, it then should call the function passed as
cb_data as last parameters.