Top |
Functions
Functions
gda_connection_internal_set_provider_data ()
void gda_connection_internal_set_provider_data (GdaConnection *cnc
,GdaServerProviderConnectionData *data
,GDestroyNotify destroy_func
);
Note: calling this function more than once will not make it call destroy_func
on any previously
set opaque data
, you'll have to do it yourself.
Note: destroy_func
, needs to free the memory associated to data
, if necessary.
Parameters
cnc |
a GdaConnection object |
|
data |
a GdaServerProviderConnectionData, which can be extended as needed by the provider for which |
|
destroy_func |
function to call when the connection closes and |
gda_connection_internal_get_provider_data_error ()
GdaServerProviderConnectionData * gda_connection_internal_get_provider_data_error (GdaConnection *cnc
,GError **error
);
Get the opaque pointer previously set using gda_connection_internal_set_provider_data()
.
If it's not set, then add a connection event and returns NULL
Returns
the pointer to the opaque structure set using gda_connection_internal_set_provider_data()
, or NULL
.
[nullable]
Since: 5.0.2
gda_connection_internal_get_worker ()
GdaWorker *
gda_connection_internal_get_worker (GdaServerProviderConnectionData *data
);
Retreive a pointer to the GdaWorker used internally by the connection. This function is reserved to database provider's implementation and should not be used otherwise.
gda_connection_point_available_event ()
GdaConnectionEvent * gda_connection_point_available_event (GdaConnection *cnc
,GdaConnectionEventType type
);
Use this method to get a pointer to the next available connection event which can then be customized
and taken into account using gda_connection_add_event()
.
Returns
a pointer to the next available connection event, or NULL
if event should
be ignored.
[transfer full]
Since: 4.2
gda_connection_add_event ()
void gda_connection_add_event (GdaConnection *cnc
,GdaConnectionEvent *event
);
Adds an event to the given connection. This function is usually called by providers, to inform clients of events that happened during some operation.
As soon as a provider (or a client, it does not matter) calls this
function with an event
object which is an error,
the connection object emits the "error" signal, to which clients can connect to be
informed of events.
WARNING: the reference to the event
object is stolen by this function!
Parameters
cnc |
a GdaConnection object. |
|
event |
is stored internally, so you don't need to unref it. |
[transfer full] |
gda_connection_add_event_string ()
GdaConnectionEvent * gda_connection_add_event_string (GdaConnection *cnc
,const gchar *str
,...
);
Adds a new error to the given connection object. This is just a convenience function that simply creates a GdaConnectionEvent and then calls gda_server_connection_add_error.
Parameters
cnc |
a GdaConnection object. |
|
str |
a format string (see the printf(3) documentation). |
|
... |
the arguments to insert in the error message. |
Returns
a new GdaConnectionEvent object, however the caller does not hold a reference to the returned object, and if need be the caller must call g_object_ref()
on it.
[transfer none]
gda_connection_clear_events_list ()
void
gda_connection_clear_events_list (GdaConnection *cnc
);
This function lets you clear the list of GdaConnectionEvent's of the given connection.
gda_connection_internal_transaction_started ()
void gda_connection_internal_transaction_started (GdaConnection *cnc
,const gchar *parent_trans
,const gchar *trans_name
,GdaTransactionIsolation isol_level
);
Internal functions to be called by database providers when a transaction has been started to keep track of the transaction status of the connection.
Note: this function should not be called if gda_connection_internal_statement_executed()
has already been called because a statement's execution was necessary to perform
the action.
gda_connection_internal_transaction_rolledback ()
void gda_connection_internal_transaction_rolledback (GdaConnection *cnc
,const gchar *trans_name
);
Internal functions to be called by database providers when a transaction has been rolled back to keep track of the transaction status of the connection
Note: this function should not be called if gda_connection_internal_statement_executed()
has already been called because a statement's execution was necessary to perform
the action.
gda_connection_internal_transaction_committed ()
void gda_connection_internal_transaction_committed (GdaConnection *cnc
,const gchar *trans_name
);
Internal functions to be called by database providers when a transaction has been committed to keep track of the transaction status of the connection
Note: this function should not be called if gda_connection_internal_statement_executed()
has already been called because a statement's execution was necessary to perform
the action.
gda_connection_internal_statement_executed ()
void gda_connection_internal_statement_executed (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GdaConnectionEvent *error
);
Internal functions to be called by database providers when a statement has been executed to keep track of the transaction status of the connection
Parameters
cnc |
||
stmt |
a GdaStatement which has been executed |
|
params |
execution's parameters. |
[nullable] |
error |
a GdaConnectionEvent if the execution failed, or |
[transfer none] |
gda_connection_internal_savepoint_added ()
void gda_connection_internal_savepoint_added (GdaConnection *cnc
,const gchar *parent_trans
,const gchar *svp_name
);
Internal functions to be called by database providers when a savepoint has been added to keep track of the transaction status of the connection
Note: this function should not be called if gda_connection_internal_statement_executed()
has already been called because a statement's execution was necessary to perform
the action.
gda_connection_internal_savepoint_rolledback ()
void gda_connection_internal_savepoint_rolledback (GdaConnection *cnc
,const gchar *svp_name
);
Internal functions to be called by database providers when a savepoint has been rolled back to keep track of the transaction status of the connection
Note: this function should not be called if gda_connection_internal_statement_executed()
has already been called because a statement's execution was necessary to perform
the action.
gda_connection_internal_savepoint_removed ()
void gda_connection_internal_savepoint_removed (GdaConnection *cnc
,const gchar *svp_name
);
Internal functions to be called by database providers when a savepoint has been removed to keep track of the transaction status of the connection
Note: this function should not be called if gda_connection_internal_statement_executed()
has already been called because a statement's execution was necessary to perform
the action.
gda_connection_internal_change_transaction_state ()
void gda_connection_internal_change_transaction_state (GdaConnection *cnc
,GdaTransactionStatusState newstate
);
Internal function to be called by database providers to force a transaction status change.
gda_connection_internal_reset_transaction_status ()
void
gda_connection_internal_reset_transaction_status
(GdaConnection *cnc
);
Internal function to be called by database providers to reset the transaction status.
gda_connection_add_prepared_statement ()
void gda_connection_add_prepared_statement (GdaConnection *cnc
,GdaStatement *gda_stmt
,GdaPStmt *prepared_stmt
);
Declares that prepared_stmt
is a prepared statement object associated to gda_stmt
within the connection
(meaning the connection increments the reference counter of prepared_stmt
).
If gda_stmt
changes or is destroyed, the the association will be lost and the connection will lose the
reference it has on prepared_stmt
.
Parameters
cnc |
a GdaConnection object |
|
gda_stmt |
a GdaStatement object |
|
prepared_stmt |
a prepared statement object (as a GdaPStmt object, or more likely a descendant) |
gda_connection_del_prepared_statement ()
void gda_connection_del_prepared_statement (GdaConnection *cnc
,GdaStatement *gda_stmt
);
Removes any prepared statement associated to gda_stmt
in cnc
: this undoes what
gda_connection_add_prepared_statement()
does.
gda_connection_get_prepared_statement ()
GdaPStmt * gda_connection_get_prepared_statement (GdaConnection *cnc
,GdaStatement *gda_stmt
);
Retrieves a pointer to an object representing a prepared statement for gda_stmt
within cnc
. The
association must have been done using gda_connection_add_prepared_statement()
.
gda_connection_open_sqlite ()
GdaConnection * gda_connection_open_sqlite (const gchar *directory
,const gchar *filename
,gboolean auto_unlink
);
Opens an SQLite connection even if the SQLite provider is not installed, to be used by database providers which need a temporary database to store some information.
Types and Values
GdaServerProviderConnectionData
typedef struct { GdaWorker * GSEAL(worker); GDestroyNotify GSEAL(provider_data_destroy_func); gpointer GSEAL(pad1); gpointer GSEAL(pad2); } GdaServerProviderConnectionData;
Opaque structure extended by database providers to store per-connection information (usually C handles to the connection as required by the C API they use).
Note: worker
part is created in _gda_server_provider_open_connection()
by the provider itself, which allows it to
either create a GdaWorker for each connection, or create only one GdaWorker for all connections (if the underlying
for example does not support multi-threading at all)