Top | ![]() |
![]() |
![]() |
![]() |
char * | auth-string | Read / Write |
char * | cnc-string | Read / Write |
char * | dsn | Read / Write |
int | events-history-size | Read / Write |
guint | execution-slowdown | Read / Write |
gboolean | execution-timer | Read / Write |
GdaMetaStore * | meta-store | Read / Write |
GdaConnectionOptions | options | Read / Write |
GdaServerProvider * | provider | Read / Write |
void | closed | Run Last |
void | dsn-changed | Run Last |
void | error | Run Last |
void | opened | Run First |
void | status-changed | Run Last |
void | transaction-status-changed | Run Last |
GdaConnection | |
enum | GdaConnectionStatus |
enum | GdaConnectionOptions |
enum | GdaConnectionError |
#define | GDA_CONNECTION_ERROR |
enum | GdaConnectionFeature |
enum | GdaConnectionMetaType |
GEnum ├── GdaConnectionError ├── GdaConnectionFeature ├── GdaConnectionMetaType ╰── GdaConnectionStatus GFlags ╰── GdaConnectionOptions GObject ╰── GdaConnection ╰── GdaVirtualConnection
Each connection to a database is represented by a GdaConnection object. A connection is created
using gda_connection_new_from_dsn()
if a data source has been defined, or gda_connection_new_from_string()
otherwise. It is not recommended to create a GdaConnection object using g_object_new()
as the results are
unpredictable (some parts won't correctly be initialized).
Once the connection has been created, it can be opened using gda_connection_open()
or gda_connection_open_async()
.
By default these functions will block, unless you speficy a GMainContext from which events will be processed
while opening the connection using gda_connection_set_main_context()
.
The same gda_connection_set_main_context()
allows the program to still handle events while a
potentially blocking operation (such as executing a statement) is being carried out (this is a change compared to the
GdaConnection object in Libgda versions before 6.x, where asynchronous execution was featured
using a set of specific functions like gda_connection_async_statement_execute()
).
The GdaConnection object implements its own locking mechanism so it is thread-safe. If a GMainContext has been
specified using gda_connection_set_main_context()
, then the events will continue to be processed while the
lock on the connection is being acquired.
GdaConnection * gda_connection_new_from_dsn (GdaDsnInfo *dsn
,const gchar *auth_string
,GdaConnectionOptions options
,GError **error
);
This function creates a new connection, using a pre-defined data source (DSN), see
gda_config_define_dsn()
for more information about how to define a DSN. If you don't want to
define a DSN, it is possible to use gda_connection_new_from_string()
instead of this method.
The auth_string
can contain the authentication information for the server
to accept the connection. It is a string containing semi-colon seperated named value, usually
like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. Note that each
name and value must be encoded as per RFC 1738, see gda_rfc1738_encode()
for more information.
If auth_string
is given, it wil be used, otherwise auth_string of GdaDsnInfo will be used.
The actual named parameters required depend on the provider being used, and that list is available
as the auth_params
member of the GdaProviderInfo structure for each installed
provider (use gda_config_get_provider_info()
to get it). Also one can use the "gda-sql-6.0 -L" command
to list the possible named parameters.
This method may fail with a GDA_CONNECTION_ERROR domain error (see the GdaConnectionError error codes)
or a GDA_CONFIG_ERROR
domain error (see the GdaConfigError error codes).
The returned connection is not yet opened, you need to call gda_connection_open()
or gda_connection_open_async()
.
dsn |
data source name. |
|
auth_string |
authentication string, or |
[nullable] |
options |
options for the connection (see GdaConnectionOptions). |
|
error |
a place to store an error, or |
Since: 6.0
GdaConnection * gda_connection_new_from_dsn_name (const gchar *dsn_name
,const gchar *auth_string
,GdaConnectionOptions options
,GError **error
);
This function creates a new function, using a pre-defined data source (DSN) name,
see gda_config_define_dsn()
for more information about how to define a DSN. If you don't want to define
a DSN, it is possible to use gda_connection_new_from_string()
instead of this method.
The dsn
string must have the following format: "[<username>[:<password>]@]<DSN>"
(if <username> and/or <password> are provided, and auth_string
is NULL
, then these username
and passwords will be used). Note that if provided, <username> and <password>
must be encoded as per RFC 1738, see gda_rfc1738_encode()
for more information.
The auth_string
can contain the authentication information for the server
to accept the connection. It is a string containing semi-colon separated named value, usually
like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. Note that each
name and value must be encoded as per RFC 1738, see gda_rfc1738_encode()
for more information.
The actual named parameters required depend on the provider being used, and that list is available
as the auth_params
member of the GdaProviderInfo structure for each installed
provider (use gda_config_get_provider_info()
to get it). Also one can use the "gda-sql-6.0 -L" command
to list the possible named parameters.
This method may fail with a GDA_CONNECTION_ERROR domain error (see the GdaConnectionError error codes)
or a GDA_CONFIG_ERROR
domain error (see the GdaConfigError error codes).
The returned connection is not yet opened, you need to call gda_connection_open()
or gda_connection_open_async()
.
dsn_name |
data source name. |
|
auth_string |
authentication string, or |
[nullable] |
options |
options for the connection (see GdaConnectionOptions). |
|
error |
a place to store an error, or |
Since: 6.0
GdaConnection * gda_connection_new_from_string (const gchar *provider_name
,const gchar *cnc_string
,const gchar *auth_string
,GdaConnectionOptions options
,GError **error
);
Opens a connection given a provider ID and a connection string. This
allows applications to open connections without having to create
a data source (DSN) in the configuration. The format of cnc_string
is
similar to PostgreSQL and MySQL connection strings. It is a semicolumn-separated
series of <key>=<value> pairs, where each key and value are encoded as per RFC 1738,
see gda_rfc1738_encode()
for more information.
The possible keys depend on the provider, the "gda-sql-6.0 -L" command can be used to list the actual keys for each installed database provider.
For example the connection string to open an SQLite connection to a database
file named "my_data.db" in the current directory would be "DB_DIR=.;DB_NAME=my_data"
.
The cnc_string
string must have the following format:
"<provider>://@]<connection_params>"
(if <username> and/or <password> are provided, and auth_string
is NULL
, then these username
and passwords will be used, and if <provider> is provided and provider_name
is NULL
then this
provider will be used). Note that if provided, <username>, <password> and <provider>
must be encoded as per RFC 1738, see gda_rfc1738_encode()
for more information.
The auth_string
must contain the authentication information for the server
to accept the connection. It is a string containing semi-colon seperated named values, usually
like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. Note that each
name and value must be encoded as per RFC 1738, see gda_rfc1738_encode()
for more information.
The actual named parameters required depend on the provider being used, and that list is available
as the auth_params
member of the GdaProviderInfo structure for each installed
provider (use gda_config_get_provider_info()
to get it). Similarly to the format of the connection
string, use the "gda-sql-6.0 -L" command to list the possible named parameters.
Additionally, it is possible to have the connection string
respect the "<provider_name>://<real cnc string>" format, in which case the provider name
and the real connection string will be extracted from that string (note that if provider_name
is not NULL
then it will still be used as the provider ID).
This method may fail with a GDA_CONNECTION_ERROR domain error (see the GdaConnectionError error codes)
or a GDA_CONFIG_ERROR
domain error (see the GdaConfigError error codes).
The returned connection is not yet opened, you need to call gda_connection_open()
or gda_connection_open_async()
.
provider_name |
provider ID to connect to, or |
[nullable] |
cnc_string |
connection string. |
|
auth_string |
authentication string, or |
[nullable] |
options |
options for the connection (see GdaConnectionOptions). |
|
error |
a place to store an error, or |
Since: 5.0.2
gboolean gda_connection_open (GdaConnection *cnc
,GError **error
);
Tries to open the connection. The function either blocks or, if a GMaincontext has been specified using
gda_connection_set_main_context()
, processes the events for that main context until either the
connection opening has succeeded or failed.
If the connection is already opened, then this function returns TRUE
immediately.
GdaConnection * gda_connection_open_from_dsn (GdaDsnInfo *dsn
,const gchar *auth_string
,GdaConnectionOptions options
,GError **error
);
This function creates a connection and opens it, using a DSN. If opening fails, then no connection is created.
See gda_connection_new_from_dsn()
for more information.
dsn |
data sourcename. |
|
auth_string |
authentication string, or |
[nullable] |
options |
options for the connection (see GdaConnectionOptions). |
|
error |
a place to store an error, or |
a new GdaConnection if connection opening was successful or NULL
if there was an error.
[transfer full]
Since: 6.0
GdaConnection * gda_connection_open_from_dsn_name (const gchar *dsn_name
,const gchar *auth_string
,GdaConnectionOptions options
,GError **error
);
This function creates a connection and opens it, using a DSN name. If opening fails, then no connection is created. The named DSN should be available.
See gda_connection_new_from_dsn_name()
for more information.
dsn_name |
data source name. |
|
auth_string |
authentication string, or |
[nullable] |
options |
options for the connection (see GdaConnectionOptions). |
|
error |
a place to store an error, or |
a new GdaConnection if connection opening was successful or NULL
if there was an error.
[transfer full]
GdaConnection * gda_connection_open_from_string (const gchar *provider_name
,const gchar *cnc_string
,const gchar *auth_string
,GdaConnectionOptions options
,GError **error
);
This function creates a connection and opens it, using a connection string. If opening fails, then no connection is created.
See gda_connection_new_from_string()
for more information.
provider_name |
provider ID to connect to, or |
[nullable] |
cnc_string |
connection string. |
|
auth_string |
authentication string, or |
[nullable] |
options |
options for the connection (see GdaConnectionOptions). |
|
error |
a place to store an error, or |
a new GdaConnection if connection opening was successful or NULL
if there was an error.
[transfer full]
void (*GdaConnectionOpenFunc) (GdaConnection *cnc
,guint job_id
,gboolean result
,GError *error
,gpointer data
);
guint gda_connection_open_async (GdaConnection *cnc
,GdaConnectionOpenFunc callback
,gpointer data
,GError **error
);
This function requests that the connection be opened.
If the connection is already opened, then this function returns an error (with the GDA_CONNECTION_ALREADY_OPENED_ERROR
code).
Note: callback
function will be called when processing events from the GMainContext defined by
gda_connection_set_main_context()
, for example when there is a main loop for that main context.
cnc |
a GdaConnection object |
|
callback |
a GdaConnectionOpenFunc which will be called after the connection has been opened (of failed to open). |
[scope notified] |
data |
data to pass to |
[nullable] |
error |
a place to store errors, or |
Since: 6.0
gboolean gda_connection_close (GdaConnection *cnc
,GError **error
);
Closes the connection to the underlying data source.
gboolean
gda_connection_is_opened (GdaConnection *cnc
);
Checks whether a connection is open or not.
GdaConnectionStatus
gda_connection_get_status (GdaConnection *cnc
);
Get the current status of cnc
. Note that this function needs to lock the connection (see GdaLockable)
to obtain the result.
Since: 6.0
void gda_connection_set_main_context (GdaConnection *cnc
,GThread *thread
,GMainContext *context
);
Defines the GMainContext which will still process events while a potentially blocking operation is performed using
cnc
. If cnc
is NULL
, then this function applies to all the connections, except the ones for which a different
context has been defined (be it user defined connections or internal connections used in other objects).
On the other hand, if cnc
is not NULL
, then the setting only applied to cnc
.
For exemple if there is a GUI which needs to continue to handle events, then you can use this function to pass the default GMainContext used for the UI refreshing, for example:
GMainContext *context; cnc = gda_connection_new_...; context = g_main_context_ref_thread_default (); gda_connection_set_main_context (cnc, NULL, context); g_main_context_unref (context); GError *error = NULL; if (! gda_connection_open (cnc, &error)) ...
If context
is NULL
, then potentially blocking operation will actually block any event from being processed
while the blocking operation is being performed.
cnc |
a GdaConnection, or |
[nullable] |
thread |
the GThread in which |
[nullable] |
context |
a GMainContext, or |
[nullable] |
Since: 6.0
GMainContext * gda_connection_get_main_context (GdaConnection *cnc
,GThread *thread
);
Get the GMainContext used while a potentially blocking operation is performed using nc
, see
gda_connection_set_main_context()
. If cnc
is NULL
, then the setting applies to all the connections for which
no other similar setting has been set.
If no main context has been defined, then some function calls (for example connection opening) may block until the operation has finished.
cnc |
a GdaConnection, or |
[nullable] |
thread |
the GThread in which |
[nullable] |
Since: 6.0
GdaSqlParser *
gda_connection_create_parser (GdaConnection *cnc
);
Creates a new parser object able to parse the SQL dialect understood by cnc
.
If the GdaServerProvider object internally used by cnc
does not have its own parser,
then NULL
is returned, and a general SQL parser can be obtained
using gda_sql_parser_new()
.
gchar * gda_connection_value_to_sql_string (GdaConnection *cnc
,GValue *from
);
Produces a fully quoted and escaped string from a GValue
gchar * gda_connection_quote_sql_identifier (GdaConnection *cnc
,const gchar *id
);
Use this method to get a correctly quoted (if necessary) SQL identifier which can be used
in SQL statements, from id
. If id
is already correctly quoted for cnc
, then a copy of id
may be returned.
This method may add double quotes (or other characters) around id
:
if id
is a reserved SQL keyword (such as SELECT, INSERT, ...)
if id
contains non allowed characters such as spaces, or if it starts with a digit
in any other event as necessary for cnc
, depending on the the options passed when opening the cnc
connection, and specifically the
GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE option.
One can safely pass an already quoted id
to this method, either with quoting characters allowed by cnc
or using the
double quote (") character.
Since: 4.0.3
gchar * gda_connection_statement_to_sql (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GdaStatementSqlFlag flags
,GSList **params_used
,GError **error
);
Renders stmt
as an SQL statement, adapted to the SQL dialect used by cnc
cnc |
a GdaConnection object, or |
[nullable] |
stmt |
a GdaStatement object |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
flags |
SQL rendering flags, as GdaStatementSqlFlag OR'ed values |
|
params_used |
a place to store the list of individual GdaHolder objects within |
[nullable][element-type Gda.Holder][out][transfer container] |
error |
a place to store errors, or |
gboolean gda_connection_statement_prepare (GdaConnection *cnc
,GdaStatement *stmt
,GError **error
);
Ask the database accessed through the cnc
connection to prepare the usage of stmt
. This is only useful
if stmt
will be used more than once (however some database providers may always prepare statements
before executing them).
This function is also useful to make sure stmt
is fully understood by the database before actually executing it.
Note however that it is also possible that gda_connection_statement_prepare()
fails when
gda_connection_statement_execute()
does not fail (this will usually be the case with statements such as
"SELECT * FROM ##tablename::string" because database usually don't allow variables to be used in place of a
table name).
GObject * gda_connection_statement_execute (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GdaStatementModelUsage model_usage
,GdaSet **last_insert_row
,GError **error
);
Executes stmt
.
As stmt
can, by design (and if not abused), contain only one SQL statement, the
return object will either be:
a GdaDataSelect object (which is also a GdaDataModel) if stmt
is a SELECT statement
(usually a GDA_SQL_STATEMENT_SELECT, see GdaSqlStatementType)
containing the results of the SELECT. The resulting data model is by default read only, but
modifications can be enabled, see the GdaDataSelect's documentation for more information.
a GdaSet for any other SQL statement which correctly executed. In this case (if the provider supports it), then the GdaSet may contain value holders named:
a (gint) GdaHolder named "IMPACTED_ROWS"
a (GObject) GdaHolder named "EVENT" which contains a GdaConnectionEvent
If last_insert_row
is not NULL
and stmt
is an INSERT statement, then it will contain a new GdaSet
object composed of value holders named "+<column number>"
starting at column 0 which contain the actual inserted values. For example if a table is composed of an 'id' column
which is auto incremented and a 'name' column then the execution of a "INSERT INTO mytable (name) VALUES ('joe')"
query will return a GdaSet with two holders:
one with the '+0' ID which may for example contain 1 (note that its "name" property should be "id")
one with the '+1' ID which will contain 'joe' (note that its "name" property should be "name")
Note that the value pointer by last_insert_row
may be NULL
after the function call if either the database provider
does not support it, or if the last interted row could not be determined (for example with SQLite if the table
in which the data is inserted has the WITHOUT ROWID optimization).
This method may fail with a GDA_SERVER_PROVIDER_ERROR
domain error (see the GdaServerProviderError error codes).
Note1: If stmt
is a SELECT statement which has some parameters and if params
is NULL
, then the statement can't
be executed and this method will return NULL
.
Note2: If stmt
is a SELECT statement which has some parameters and if params
is not NULL
but contains some
invalid parameters, then the statement can't be executed and this method will return NULL
, unless the
model_usage
has the GDA_STATEMENT_MODEL_ALLOW_NOPARAM flag.
Note3: If stmt
is a SELECT statement which has some parameters and if params
is not NULL
but contains some
invalid parameters and if model_usage
has the GDA_STATEMENT_MODEL_ALLOW_NOPARAM flag, then the returned
data model will contain no row but will have all the correct columns (even though some of the columns might
report as GDA_TYPE_NULL). In this case, if (after this method call) any of params
' parameters change
then the resulting data model will re-run itself, see the GdaDataSelect's
Note4: if model_usage
does not contain the GDA_STATEMENT_MODEL_RANDOM_ACCESS or
GDA_STATEMENT_MODEL_CURSOR_FORWARD flags, then the default will be to return a random access data model
Note5: If stmt
is a SELECT statement which returns blob values (of type GDA_TYPE_BLOB
), then an implicit
transaction will have been started by the database provider, and it's up to the caller to close the transaction
(which will then be locked) once all the blob ressources have been
liberated (when the returned data model is destroyed). See the section about
Also see the provider's limitations, and the
Advanced GdaDataSelect usage sections.cnc |
||
stmt |
a GdaStatement object |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
model_usage |
in the case where |
|
last_insert_row |
a place to store a new GdaSet object which contains the values of the last inserted row, or |
[out][transfer full][nullable] |
error |
a place to store errors, or |
GdaDataModel * gda_connection_statement_execute_select (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GError **error
);
Executes a selection command on the given connection.
This function returns a GdaDataModel resulting from the SELECT statement, or NULL
if an error occurred.
This function is just a convenience function around the gda_connection_statement_execute()
function.
See the documentation of the gda_connection_statement_execute()
for information
about the params
list of parameters.
cnc |
a GdaConnection object. |
|
stmt |
a GdaStatement object. |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
error |
a place to store an error, or |
a GdaDataModel containing the data returned by the
data source, or NULL
if an error occurred.
[transfer full]
GdaDataModel * gda_connection_statement_execute_select_full (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GdaStatementModelUsage model_usage
,GType *col_types
,GError **error
);
Executes a selection command on the given connection.
This function returns a GdaDataModel resulting from the SELECT statement, or NULL
if an error occurred.
This function is just a convenience function around the gda_connection_statement_execute()
function.
See the documentation of the gda_connection_statement_execute()
for information
about the params
list of parameters.
cnc |
a GdaConnection object. |
|
stmt |
a GdaStatement object. |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
model_usage |
specifies how the returned data model will be used as a GdaStatementModelUsage enum |
|
col_types |
an array of GType to request each returned GdaDataModel's column's GType, terminated with the G_TYPE_NONE
value. Any value left to 0 will make the database provider determine the real GType. |
[array][nullable] |
error |
a place to store an error, or |
a GdaDataModel containing the data returned by the
data source, or NULL
if an error occurred.
[transfer full]
GdaDataModel * gda_connection_statement_execute_select_fullv (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GdaStatementModelUsage model_usage
,GError **error
,...
);
Executes a selection command on the given connection.
This function returns a GdaDataModel resulting from the SELECT statement, or NULL
if an error occurred.
This function is just a convenience function around the gda_connection_statement_execute()
function.
See the documentation of the gda_connection_statement_execute()
for information
about the params
list of parameters.
cnc |
a GdaConnection object. |
|
stmt |
a GdaStatement object. |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
model_usage |
specifies how the returned data model will be used as a GdaStatementModelUsage enum |
|
error |
a place to store an error, or |
|
... |
a (-1 terminated) list of (column number, GType) specifying for each column mentioned the GType of the column in the returned GdaDataModel. |
a GdaDataModel containing the data returned by the
data source, or NULL
if an error occurred.
[transfer full]
gint gda_connection_statement_execute_non_select (GdaConnection *cnc
,GdaStatement *stmt
,GdaSet *params
,GdaSet **last_insert_row
,GError **error
);
Executes a non-selection statement on the given connection.
This function returns the number of rows affected by the execution of stmt
, or -1
if an error occurred, or -2 if the connection's provider does not return the number of rows affected.
This function is just a convenience function around the gda_connection_statement_execute()
function.
See the documentation of the gda_connection_statement_execute()
for information
about the params
list of parameters.
See gda_connection_statement_execute()
form more information about last_insert_row
.
cnc |
a GdaConnection object. |
|
stmt |
a GdaStatement object. |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
last_insert_row |
a place to store a new GdaSet object which contains the values of the last inserted row, or |
[out][transfer full][nullable] |
error |
a place to store an error, or |
GSList * gda_connection_repetitive_statement_execute (GdaConnection *cnc
,GdaRepetitiveStatement *rstmt
,GdaStatementModelUsage model_usage
,GType *col_types
,gboolean stop_on_error
,GError **error
);
Executes the statement upon which rstmt
is built. Note that as several statements can actually be executed by this
method, it is recommended to be within a transaction.
If error
is not NULL
and stop_on_error
is FALSE
, then it may contain the last error which occurred.
cnc |
||
rstmt |
a GdaRepetitiveStatement object |
|
model_usage |
specifies how the returned data model will be used as a GdaStatementModelUsage enum |
|
col_types |
an array of GType to request each returned GdaDataModel's column's GType, see |
[array][nullable] |
stop_on_error |
set to TRUE if the method has to stop on the first error. |
|
error |
a place to store errors, or |
a new list of GObject pointers (see gda_connection_statement_execute()
for more information about what they
represent), one for each actual execution of the statement upon which rstmt
is built. If stop_on_error
is FALSE
, then
the list may contain some NULL
pointers which refer to statements which failed to execute.
[transfer full][element-type GObject]
Since: 4.2
GSList * gda_connection_batch_execute (GdaConnection *cnc
,GdaBatch *batch
,GdaSet *params
,GdaStatementModelUsage model_usage
,GError **error
);
Executes all the statements contained in batch
(in the order in which they were added to batch
), and
returns a list of GObject objects, at most one GObject for each statement; see gda_connection_statement_execute()
for details about the returned objects.
If one of the statement fails, then none of the subsequent statement will be executed, and the method returns the list of GObject created by the correct execution of the previous statements. If a transaction is required, then it should be started before calling this method.
cnc |
a GdaConnection object |
|
batch |
a GdaBatch object which contains all the statements to execute |
|
params |
a GdaSet object (which can be obtained using |
[nullable] |
model_usage |
specifies how the returned data model(s) will be used, as a GdaStatementModelUsage enum |
|
error |
a place to store errors, or |
gboolean gda_connection_begin_transaction (GdaConnection *cnc
,const gchar *name
,GdaTransactionIsolation level
,GError **error
);
Starts a transaction on the data source, identified by the name
parameter.
Before starting a transaction, you can check whether the underlying
provider does support transactions or not by using the gda_connection_supports_feature()
function.
cnc |
a GdaConnection object. |
|
name |
the name of the transation to start, or |
[nullable] |
level |
the requested transaction level (use |
|
error |
a place to store errors, or |
gboolean gda_connection_commit_transaction (GdaConnection *cnc
,const gchar *name
,GError **error
);
Commits the given transaction to the backend database. You need to call
gda_connection_begin_transaction()
first.
cnc |
a GdaConnection object. |
|
name |
the name of the transation to commit, or |
[nullable] |
error |
a place to store errors, or |
gboolean gda_connection_rollback_transaction (GdaConnection *cnc
,const gchar *name
,GError **error
);
Rollbacks the given transaction. This means that all changes
made to the underlying data source since the last call to
gda_connection_begin_transaction()
or gda_connection_commit_transaction()
will be discarded.
cnc |
a GdaConnection object. |
|
name |
the name of the transation to commit, or |
[nullable] |
error |
a place to store errors, or |
gboolean gda_connection_add_savepoint (GdaConnection *cnc
,const gchar *name
,GError **error
);
Adds a SAVEPOINT named name
.
cnc |
a GdaConnection object |
|
name |
name of the savepoint to add. |
[nullable] |
error |
a place to store errors or |
gboolean gda_connection_rollback_savepoint (GdaConnection *cnc
,const gchar *name
,GError **error
);
Rollback all the modifications made after the SAVEPOINT named name
.
cnc |
a GdaConnection object |
|
name |
name of the savepoint to rollback to. |
[nullable] |
error |
a place to store errors or |
gboolean gda_connection_delete_savepoint (GdaConnection *cnc
,const gchar *name
,GError **error
);
Delete the SAVEPOINT named name
when not used anymore.
cnc |
a GdaConnection object |
|
name |
name of the savepoint to delete. |
[nullable] |
error |
a place to store errors or |
GdaTransactionStatus *
gda_connection_get_transaction_status (GdaConnection *cnc
);
Get the status of cnc
regarding transactions. The returned object should not be modified
or destroyed; however it may be modified or destroyed by the connection itself.
If NULL
is returned, then no transaction has been associated with cnc
GdaConnectionOptions
gda_connection_get_options (GdaConnection *cnc
);
Gets the GdaConnectionOptions used to open this connection.
GdaServerProvider *
gda_connection_get_provider (GdaConnection *cnc
);
Gets a pointer to the GdaServerProvider object used to access the database
const gchar *
gda_connection_get_provider_name (GdaConnection *cnc
);
Gets the name (identifier) of the database provider used by cnc
const gchar *
gda_connection_get_cnc_string (GdaConnection *cnc
);
Gets the connection string used to open this connection.
The connection string is the string sent over to the underlying database provider, which describes the parameters to be used to open a connection on the underlying data source.
const gchar *
gda_connection_get_authentication (GdaConnection *cnc
);
Gets the user name used to open this connection.
gboolean gda_connection_get_date_format (GdaConnection *cnc
,GDateDMY *out_first
,GDateDMY *out_second
,GDateDMY *out_third
,gchar *out_sep
,GError **error
);
This function allows you to determine the actual format for the date values.
cnc |
a GdaConnection object |
|
out_first |
the place to store the first part of the date, or |
[out][nullable] |
out_second |
the place to store the second part of the date, or |
[out][nullable] |
out_third |
the place to store the third part of the date, or |
[out][nullable] |
out_sep |
the place to store the separator (used between year, month and day parts) part of the date, or |
[out][nullable] |
error |
a place to store errors, or |
[nullable] |
Since: 5.2
const GList *
gda_connection_get_events (GdaConnection *cnc
);
Retrieves a list of the last errors occurred during the connection. The returned list is chronologically ordered such as that the most recent event is the GdaConnectionEvent of the first node.
Warning: the cnc
object may change the list if connection events occur
a GList of GdaConnectionEvent objects (the list should not be modified).
[transfer none][element-type Gda.ConnectionEvent]
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()
.
a pointer to the next available connection event, or NULL
if event should
be ignored.
[transfer full]
Since: 4.2
GdaServerOperation * gda_connection_create_operation (GdaConnection *cnc
,GdaServerOperationType type
,GdaSet *options
,GError **error
);
Creates a new GdaServerOperation object which can be modified in order
to perform the type type of action. It is a wrapper around the gda_server_provider_create_operation()
method.
cnc |
a GdaConnection object |
|
type |
the type of operation requested |
|
options |
an optional list of parameters. |
[nullable] |
error |
a place to store an error, or |
a new GdaServerOperation object, or NULL
in the connection's provider does not support the type
type
of operation or if an error occurred.
[transfer full]
gboolean gda_connection_perform_operation (GdaConnection *cnc
,GdaServerOperation *op
,GError **error
);
Performs the operation described by op
(which should have been created using
gda_connection_create_operation()
). It is a wrapper around the gda_server_provider_perform_operation()
method.
cnc |
a GdaConnection object |
|
op |
a GdaServerOperation object |
|
error |
a place to store an error, or |
gboolean gda_connection_supports_feature (GdaConnection *cnc
,GdaConnectionFeature feature
);
Asks the underlying provider for if a specific feature is supported.
GdaMetaStore *
gda_connection_get_meta_store (GdaConnection *cnc
);
Get or initializes the GdaMetaStore associated to cnc
gboolean gda_connection_update_meta_store (GdaConnection *cnc
,GdaMetaContext *context
,GError **error
);
Updates cnc
's associated GdaMetaStore. If context
is not NULL
, then only the parts described by
context
will be updated, and if it is NULL
, then the complete meta store will be updated. Detailed
explanations follow:
In order to keep the meta store's contents in a consistent state, the update process involves updating the contents of all the tables related to one where the contents change. For example the "_columns" table (which lists all the columns of a table) depends on the "_tables" table (which lists all the tables in a schema), so if a row is added, removed or modified in the "_tables", then the "_columns" table's contents needs to be updated as well regarding that row.
If context
is NULL
, then the update process will simply overwrite any data that was present in all the
meta store's tables with new (up to date) data even if nothing has changed, without having to build the
tables' dependency tree. This is the recommended way of proceeding when dealing with a meta store which
might be outdated.
On the other hand, if context
is not NULL
, then a tree of the dependencies has to be built (depending on
context
) and only some parts of the meta store are updated following that dependencies tree. Specifying a
context may be useful for example in the following situations:
One knows that a database object has changed (for example a table created), and
may use the context
to request that only the information about that table be updated
One is only interested in the list of views, and may request that only the information about views may be updated
When context
is not NULL
, and contains specified SQL identifiers (for example the "table_name" of the "_tables"
table), then each SQL identifier has to match the convention the GdaMetaStore has adopted regarding
case sensitivity, using gda_connection_quote_sql_identifier()
or gda_meta_store_sql_identifier_quote()
.
see the gda_sql_identifier_quote()
function which will be most useful.
Note however that usually more information will be updated than strictly requested by
the context
argument.
For more information, see the Database structure section, and the Update the meta data about a table howto.
cnc |
a GdaConnection object. |
|
context |
description of which part of |
[nullable] |
error |
a place to store errors, or |
GdaDataModel * gda_connection_get_meta_store_data (GdaConnection *cnc
,GdaConnectionMetaType meta_type
,GError **error
,gint nb_filters
,...
);
Retrieves data stored in cnc
's associated GdaMetaStore object. This method is useful
to easily get some information about the meta-data associated to cnc
, such as the list of
tables, views, and other database objects.
Note: it's up to the caller to make sure the information contained within cnc
's associated GdaMetaStore
is up to date using gda_connection_update_meta_store()
(it can become outdated if the database's schema
is modified).
For more information about the returned data model's attributes, or about the meta_type
and ... filter arguments,
see this description.
Also, when using filters involving data which are SQL identifiers, make sure each SQL identifier
is represented using the GdaMetaStore convention, using gda_meta_store_sql_identifier_quote()
or
gda_meta_store_sql_identifier_quote()
.
See the gda_sql_identifier_quote()
function which will be most useful.
[skip]
cnc |
a GdaConnection object. |
|
meta_type |
describes which data to get. |
|
error |
a place to store errors, or |
|
nb_filters |
the number of filters in the @... argument |
|
... |
a list of (filter name (gchar *), filter value (GValue*)) pairs specifying
the filter to apply to the returned data model's contents (there must be |
a GdaDataModel containing the data required. The caller is responsible
for freeing the returned model using g_object_unref()
.
[transfer full]
GdaDataModel * gda_connection_get_meta_store_data_v (GdaConnection *cnc
,GdaConnectionMetaType meta_type
,GList *filters
,GError **error
);
see gda_connection_get_meta_store_data
[rename-to gda_connection_get_meta_store_data]
cnc |
a GdaConnection object. |
|
meta_type |
describes which data to get. |
|
error |
a place to store errors, or |
|
filters |
a GList of GdaHolder objects. |
[element-type GdaHolder] |
a GdaDataModel containing the data required. The caller is responsible
for freeing the returned model using g_object_unref()
.
[transfer full]
GdaStatement * gda_connection_parse_sql_string (GdaConnection *cnc
,const gchar *sql
,GdaSet **params
,GError **error
);
This function helps to parse a SQL string which uses parameters and store them at params
.
cnc |
a GdaConnection object, or |
[nullable] |
sql |
an SQL command to parse, not |
|
params |
a place to store a new GdaSet, for parameters used in SQL command, or |
[out][nullable][transfer full] |
error |
a place to store errors, or |
Since: 4.2.3
GdaDataModel * gda_connection_execute_select_command (GdaConnection *cnc
,const gchar *sql
,GError **error
);
Execute a SQL SELECT command over an opened connection.
cnc |
an opened connection |
|
sql |
a query statement that must begin with "SELECT" |
|
error |
a place to store errors, or |
Since: 4.2.3
gint gda_connection_execute_non_select_command (GdaConnection *cnc
,const gchar *sql
,GError **error
);
This is a convenience function to execute a SQL command over the opened connection. For the
returned value, see gda_connection_statement_execute_non_select()
's documentation.
cnc |
an opened connection |
|
sql |
a query statement that must not begin with "SELECT" |
|
error |
a place to store errors, or |
Since: 4.2.3
gboolean gda_connection_insert_row_into_table (GdaConnection *cnc
,const gchar *table
,GError **error
,...
);
This is a convenience function, which creates an INSERT statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.
The equivalent SQL command is: INSERT INTO <table> (<column_name> [,...]) VALUES (<column_name> = <new_value> [,...]).
A simple example to add a row in database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
GdaConnection *cnc; // Open connection here GError *error = NULL; GValue *v_first_name = gda_value_new_from_string (first_name, G_TYPE_STRING); GValue *v_last_name = gda_value_new_from_string (last_name, G_TYPE_STRING); GValue *v_email = gda_value_new_from_string (email, G_TYPE_STRING); GValue *v_cod = gda_value_new (G_TYPE_INT); g_value_set_int (v_cod, cod); if (!gda_connection_insert_row_into_table (cnc, "TABLE_CONTACTS", &error, "col_first_name", v_first_name, "col_last_name", v_last_name, "col_email", v_email, "col_cod", v_cod, NULL)) { g_error ("It was not possible to add a new row in the table: %s\n", error && error->message ? error->message : "No detail"); } gda_value_free (v_first_name); gda_value_free (v_last_name); gda_value_free (v_email); gda_value_free (v_cod); g_error_free (error); |
cnc |
an opened connection |
|
table |
table's name to insert into |
|
error |
a place to store errors, or |
|
... |
a list of string/GValue pairs with the name of the column to use and the
GValue pointer containing the value to insert for the column (value can be |
Since: 4.2.3
gboolean gda_connection_insert_row_into_table_v (GdaConnection *cnc
,const gchar *table
,GSList *col_names
,GSList *values
,GError **error
);
col_names
and values
must have length (>= 1).
This is a convenience function, which creates an INSERT statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.
The equivalent SQL command is: INSERT INTO <table> (<column_name> [,...]) VALUES (<column_name> = <new_value> [,...]).
cnc |
an opened connection |
|
table |
table's name to insert into |
|
col_names |
a list of column names (as const gchar *). |
[element-type utf8] |
values |
a list of values (as GValue). |
[element-type GValue] |
error |
a place to store errors, or |
Since: 4.2.3
gboolean gda_connection_update_row_in_table (GdaConnection *cnc
,const gchar *table
,const gchar *condition_column_name
,GValue *condition_value
,GError **error
,...
);
This is a convenience function, which creates an UPDATE statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.
The equivalent SQL command is: UPDATE <table> SET <column_name> = <new_value> [,...] WHERE <condition_column_name> = <condition_value>.
A simple example for updating a specific row in the table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
GdaConnection *cnc; //Open connection here GError *error = NULL; GValue *v_id = gda_value_new (G_TYPE_INT); GValue *v_first_name = gda_value_new_from_string (first_name, G_TYPE_STRING); GValue *v_last_name = gda_value_new_from_string (last_name, G_TYPE_STRING); GValue *v_email = gda_value_new_from_string (email, G_TYPE_STRING); GValue *v_cod = gda_value_new (G_TYPE_INT); g_value_set_int (v_id, id); g_value_set_int (v_cod, cod); if (!gda_connection_update_row_in_table (cnc, "TABLE_CONTACTS", "col_id", v_id, &error, "col_first_name", v_first_name, "col_last_name", v_last_name, "col_email", v_email, "col_cod", v_cod, NULL)) { g_error ("Could not update row in table: %s\n", error && error->message ? error->message : "No detail"); } gda_value_free (v_id); gda_value_free (v_first_name); gda_value_free (v_last_name); gda_value_free (v_email); gda_value_free (v_cod); g_error_free (error); |
cnc |
an opened connection |
|
table |
the table's name with the row's values to be updated |
|
condition_column_name |
the name of the column to used in the WHERE condition clause |
|
condition_value |
the |
|
error |
a place to store errors, or |
|
... |
a list of string/GValue pairs with the name of the column to use and the
GValue pointer containing the value to update the column to (value can be |
Since: 4.2.3
gboolean gda_connection_update_row_in_table_v (GdaConnection *cnc
,const gchar *table
,const gchar *condition_column_name
,GValue *condition_value
,GSList *col_names
,GSList *values
,GError **error
);
col_names
and values
must have length (>= 1).
This is a convenience function, which creates an UPDATE statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.
The equivalent SQL command is: UPDATE <table> SET <column_name> = <new_value> [,...] WHERE <condition_column_name> = <condition_value>.
cnc |
an opened connection |
|
table |
the table's name with the row's values to be updated |
|
condition_column_name |
the name of the column to used in the WHERE condition clause |
|
condition_value |
the |
|
col_names |
a list of column names (as const gchar *). |
[element-type utf8] |
values |
a list of values (as GValue). |
[element-type GValue] |
error |
a place to store errors, or |
Since: 4.2.3
gboolean gda_connection_delete_row_from_table (GdaConnection *cnc
,const gchar *table
,const gchar *condition_column_name
,GValue *condition_value
,GError **error
);
This is a convenience function, which creates a DELETE statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.
The equivalent SQL command is: DELETE FROM <table> WHERE <condition_column_name> = <condition_value>.
A simple example to remove a row in database.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
GdaConnection *cnc; //Open connection here GError *error = NULL; GValue *v_id = gda_value_new (G_TYPE_INT); GValue *v_name = gda_value_new_from_string ("Aldibino Refinino", G_TYPE_STRING); //The number 10 represents a primary key record in the table g_value_set_int (v_id, 10); //Delete a record with a specific ID in the col_id column if (!gda_connection_delete_row_from_table (cnc, "TABLE_CONTACTS", "col_id", v_id, &error)) { g_error ("Could not delete row in table: %s\n", error && error->message ? error->message : "No detail"); } //Delete a record with a specific NAME in the col_name column if (!gda_connection_delete_row_from_table (cnc, "TABLE_CONTACTS", "col_name", v_name, &error)) { g_error ("Could not delete row in table: %s\n", error && error->message ? error->message : "No detail"); } gda_value_free (v_id); gda_value_free (v_name); g_error_free (error); |
cnc |
an opened connection |
|
table |
the table's name with the row's values to be updated |
|
condition_column_name |
the name of the column to used in the WHERE condition clause |
|
condition_value |
the |
|
error |
a place to store errors, or |
Since: 4.2.3
GdaServerOperation * gda_connection_prepare_operation_create_table (GdaConnection *cnc
,const gchar *table_name
,GList *arguments
,GError **error
);
Add more arguments if the flag needs them:
GDA_SERVER_OPERATION_CREATE_TABLE_FKEY_FLAG:
string with the table's name referenced
an integer with the number pairs "local_field", "referenced_field" used in the reference
Pairs of "local_field", "referenced_field" to use, must match the number specified above.
a string with the action for ON DELETE; can be: "RESTRICT", "CASCADE", "NO ACTION", "SET NULL" and "SET DEFAULT". Example: "ON UPDATE CASCADE".
a string with the action for ON UPDATE (see above).
Create a GdaServerOperation object using an opened connection, taking three
arguments, a column's name the column's GType and GdaServerOperationCreateTableFlag
flag, you need to finish the list using NULL
.
You'll be able to modify the GdaServerOperation object to add custom options to the operation. When finished call gda_server_operation_perform_create_table or gda_server_provider_perform_operation in order to execute the operation.
cnc |
an opened connection |
|
table_name |
name of the table to create |
|
arguments |
list of arguments as GdaServerOperationPrepareCreateTableArg containing column's name, column's GType and a GdaServerOperationCreateTableFlag flag. |
[element-type GdaServerOperationCreateTableArg] |
error |
a place to store errors, or |
Since: 6.0
GdaServerOperation * gda_connection_prepare_operation_create_table_v (GdaConnection *cnc
,const gchar *table_name
,GError **error
,...
);
Convenient funtion for table creation.
For details about arguments see
.gda_server_operation_prepare_create_table_v()
cnc |
an opened connection |
|
table_name |
name of the table to create |
|
error |
a place to store errors, or |
|
... |
group of three arguments for column's name, column's GType
and a GdaServerOperationCreateTableFlag flag, finished with |
Since: 6.0
GdaServerOperation * gda_connection_prepare_operation_drop_table (GdaConnection *cnc
,const gchar *table_name
,GError **error
);
This is just a convenient function to create a GdaServerOperation to drop a table in an opened connection.
cnc |
an opened connection |
|
table_name |
name of the table to drop |
|
error |
a place to store errors, or |
a new GdaServerOperation or NULL
if couldn't create the opereration.
[transfer full][nullable]
Since: 6.0
gchar * gda_connection_operation_get_sql_identifier_at (GdaConnection *cnc
,GdaServerOperation *op
,const gchar *path_format
,GError **error
,...
);
This method is similar to gda_server_operation_get_value_at()
, but for SQL identifiers: a new string
is returned instead of a GValue. Also the returned string is assumed to represents an SQL identifier
and will correctly be quoted to be used with cnc
.
cnc |
||
op |
a GdaServerOperation object |
|
path_format |
a complete path to a node (starting with "/") |
|
error |
a place to store errors, or |
[nullable] |
... |
arguments to use with |
a new string, or NULL
if the value is undefined or
if the path
is not defined or path
does not hold any value, or if the value held is not a string
(in that last case a warning is shown).
[transfer full][nullable]
Since: 6.0
gchar * gda_connection_operation_get_sql_identifier_at_path (GdaConnection *cnc
,GdaServerOperation *op
,const gchar *path
,GError **error
);
This method is similar to gda_server_operation_get_value_at()
, but for SQL identifiers: a new string
is returned instead of a GValue. Also the returned string is assumed to represents an SQL identifier
and will correctly be quoted to be used with cnc
.
op |
a GdaServerOperation object |
|
cnc |
a GdaConnection, or |
[nullable] |
path |
a complete path to a node (starting with "/") |
|
error |
a place to store errors, or |
[nullable] |
a new string, or NULL
if the value is undefined or
if the path
is not defined or path
does not hold any value, or if the value held is not a string or
a valid SQL identifier.
[transfer full][nullable]
Since: 6.0
GdaDbCatalog *
gda_connection_create_db_catalog (GdaConnection *cnc
);
A convenient method to create a new GdaDbCatalog instance and set the current cnc
as a
property. If for some reason, this approach doesn't fit well, the same task can be achieved
by the following code:
GdaDbCatalog *catalog = gda_db_catalog_new()
;
g_object_set (catalog, "connection", cnc, NULL);
A new instance of GdaDbCatalog. The new object should be deallocated
using g_object_unref()
.
[transfer full]
Since: 6.0
Indicates the current status of a connection. The possible status and the transitions between those status are indicated in the diagram below:
Specifies some aspects of a connection when opening it.
Additional information about the GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE flag:
For example without this flag, if the table name specified in a GdaServerOperation to create a table is MyTable, then usually the database will create a table named mytable, whereas with this flag, the table will be created as MyTable (note that in the end the database may still decide to name the table mytable or differently if it can't do otherwise).
Libgda will not apply this rule when parsing SQL code, the SQL code being parsed has to be conform to the database it will be used with
Note about the GDA_CONNECTION_OPTIONS_AUTO_META_DATA
flag:
Every time a DDL statement is successfully executed, the associated meta data, if defined, will be updated, which has a impact on performances
If a transaction is started and some DDL statements are executed and the transaction is not rolled back or committed, then the meta data may end up being wrong
no specific aspect |
||
this flag specifies that the connection to open should be in a read-only mode (this policy is not correctly enforced at the moment) |
||
this flag specifies that SQL identifiers submitted as input to Libgda have to keep their case sensitivity. |
||
this flags specifies that if a GdaMetaStore has been associated to the connection, then it is kept up to date with the evolutions in the database's structure. Be aware however that there are some drawbacks explained below. |
Used in gda_connection_supports_feature()
and gda_server_provider_supports_feature()
to test if a connection
or a database provider supports some specific feature.
Used with gda_connection_get_meta_store_data()
to describe what meta data to extract from
a connection's associated GdaMetaStore.
“auth-string”
property “auth-string” char *
Authentication string to use.
Owner: GdaConnection
Flags: Read / Write
Default value: NULL
“cnc-string”
property “cnc-string” char *
Connection string to use.
Owner: GdaConnection
Flags: Read / Write
Default value: NULL
“dsn”
property “dsn” char *
DSN to use.
Owner: GdaConnection
Flags: Read / Write
Default value: NULL
“events-history-size”
property “events-history-size” int
Defines the number of GdaConnectionEvent objects kept in memory which can
be fetched using gda_connection_get_events()
.
Owner: GdaConnection
Flags: Read / Write
Allowed values: >= 5
Default value: 5
Since: 4.2
“execution-slowdown”
property “execution-slowdown” guint
Artificially slows down the execution of queries. This property can be used to debug some problems. If non zero, this value is the number of microseconds waited before actually executing each query. NB: this parameter is ignored during the meta store update (it is set to 0 before the meta data update and restored to its state after).
Owner: GdaConnection
Flags: Read / Write
Default value: 0
Since: 5.2.0
“execution-timer”
property “execution-timer” gboolean
Computes execution times for each statement executed.
Owner: GdaConnection
Flags: Read / Write
Default value: FALSE
Since: 4.2.9
“meta-store”
property“meta-store” GdaMetaStore *
GdaMetaStore used by the connection.
Owner: GdaConnection
Flags: Read / Write
“options”
property“options” GdaConnectionOptions
Options.
Owner: GdaConnection
Flags: Read / Write
“provider”
property“provider” GdaServerProvider *
Provider to use.
Owner: GdaConnection
Flags: Read / Write
“closed”
signalvoid user_function (GdaConnection *cnc, gpointer user_data)
Gets emitted when the connection to the database has been closed
Flags: Run Last
“dsn-changed”
signalvoid user_function (GdaConnection *cnc, gpointer user_data)
Gets emitted when the DSN used by cnc
has been changed
Flags: Run Last
“error”
signalvoid user_function (GdaConnection *cnc, GdaConnectionEvent *event, gpointer user_data)
Gets emitted whenever a connection event occurs. Check the nature of event
to
see if it's an error or a simple notification
cnc |
the GdaConnection |
|
event |
a GdaConnectionEvent object |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“opened”
signalvoid user_function (GdaConnection *cnc, gpointer user_data)
Gets emitted when the connection has been opened to the database
Flags: Run First
“status-changed”
signalvoid user_function (GdaConnection *cnc, GdaConnectionStatus status, gpointer user_data)
Gets emitted when the cnc
's status has changed (usually when a the connection is being used to execute
a statement)
cnc |
the GdaConnection |
|
status |
the new connection status. |
[type GdaConnectionStatus] |
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 6.0
“transaction-status-changed”
signalvoid user_function (GdaConnection *cnc, gpointer user_data)
Gets emitted when the transaction status of cnc
has changed (a transaction has been
started, rolled back, a savepoint added,...)
Flags: Run Last