Creates a new #GdaBatch object the new object Copy constructor a the new copy of @orig Add @stmt to the list of statements managed by @batch. A #GdaStatement object can be added multiple times to a #GdaBatch object. a statement to add to @batch's statements list Removes @stmt from the list of statements managed by @batch. If @stmt is present several times in @batch's statements' list, then only the first one is removed. a statement to remove from @batch's statements list Creates a string representing the contents of @batch. a string containing the serialized version of @batch Get a list of the #GdaStatement objects contained in @batch a list of #GdaStatement which should not be modified. Get a new #GdaSet object which groups all the execution parameters which @batch needs for all the statements it includes. This new object is returned though @out_params. Note that if @batch does not need any parameter, then @out_params is set to %NULL. TRUE if no error occurred. a place to store a new #GdaSet object, or %NULL provider should have added an error (a #GdaConnectionEvent) to the connection. the length of the blob in bytes. In case of error, -1 is returned and the Reads a chunk of bytes from the BLOB accessible through @op into @blob. provider should have added an error to the connection. the number of bytes actually read. In case of error, -1 is returned and the a #GdaBlob to read data to offset to read from the start of the blob (starts at 0) maximum number of bytes to read. Writes a chunk of bytes from a @blob to the BLOB accessible through @op, @blob is unchanged after this call. If @blob has an associated #GdaBlobOp (ie. if @blob->op is not %NULL) then the data to be written using @op is the data fetched using @blob->op. provider should have added an error to the connection. the number of bytes written. In case of error, -1 is returned and the a #GdaBlob which contains the data to write offset to write from the start of the blob (starts at 0) Writes the whole contents of @blob into the blob manipulated by @op. If necessary the resulting blob is truncated from its previous length. TRUE on success a #GdaBlob which contains the data to write provider should have added an error (a #GdaConnectionEvent) to the connection. the length of the blob in bytes. In case of error, -1 is returned and the Reads a chunk of bytes from the BLOB accessible through @op into @blob. provider should have added an error to the connection. the number of bytes actually read. In case of error, -1 is returned and the a #GdaBlob to read data to offset to read from the start of the blob (starts at 0) maximum number of bytes to read. Reads the whole contents of the blob manipulated by @op into @blob TRUE if @blob->data contains the whole BLOB manipulated by @op a #GdaBlob to read data to Writes a chunk of bytes from a @blob to the BLOB accessible through @op, @blob is unchanged after this call. If @blob has an associated #GdaBlobOp (ie. if @blob->op is not %NULL) then the data to be written using @op is the data fetched using @blob->op. provider should have added an error to the connection. the number of bytes written. In case of error, -1 is returned and the a #GdaBlob which contains the data to write offset to write from the start of the blob (starts at 0) Writes the whole contents of @blob into the blob manipulated by @op. If necessary the resulting blob is truncated from its previous length. TRUE on success a #GdaBlob which contains the data to write the length of the blob in bytes. In case of error, -1 is returned and the the number of bytes actually read. In case of error, -1 is returned and the a #GdaBlob to read data to offset to read from the start of the blob (starts at 0) maximum number of bytes to read. the number of bytes written. In case of error, -1 is returned and the a #GdaBlob which contains the data to write offset to write from the start of the blob (starts at 0) TRUE on success a #GdaBlob which contains the data to write a newly allocated #GdaColumn object. Creates a new #GdaColumn object from an existing one. in @column. a newly allocated #GdaColumn with a copy of the data the column's description, in any Sets the column's description title name. the name of @column. Sets the name of @column to @name. the new name of @column. the database type of @column. Defines @column's database type a string the type of @column. Sets the type of @column to @type. the new type of @column. Gets the 'allow null' flag of the given column. whether the given column allows null values or not (%TRUE or %FALSE). Sets the 'allow null' flag of the given column. whether the given column should allows null values or not. whether the given column is an auto incremented one (%TRUE or %FALSE). Sets the auto increment flag for the given column. auto increment status. containing data model. the position of the column refer to in the Sets the position of the column refer to in the containing data model. the wanted position of the column in the containing data model. @column's default value, as a #GValue object. Sets @column's default #GValue. default #GValue for the column Get the value associated to a named attribute. Attributes can have any name, but Libgda proposes some default names, see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>. a read-only #GValue, or %NULL if not attribute named @attribute has been set for @column attribute name as a string Set the value associated to a named attribute. The @attribute string is 'stolen' by this method, and the memory it uses will be freed using the @destroy function when no longer needed (if @destroy is %NULL, then the string will not be freed at all). Attributes can have any name, but Libgda proposes some default names, see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>. If there is already an attribute named @attribute set, then its value is replaced with the new value (@value is copied), except if @value is %NULL, in which case the attribute is removed. For example one would use it as: <code> gda_column_set_attribute (holder, g_strdup (my_attribute), g_free, my_value); gda_column_set_attribute (holder, GDA_ATTRIBUTE_NAME, NULL, my_value); </code> does it modify the table definition of the tables used by a SELECT statement is the model was created from a SELECT statement). attribute name as a static string a #GValue, or %NULL a function to be called when @attribute is not needed anymore, or %NULL Get a pointer to the global GdaConfig object a non %NULL pointer to a #GdaConfig Get information about the DSN named @dsn_name. and optionally &lt;password&gt; are provided, they are ignored). Also see the gda_dsn_split() utility function. a pointer to read-only #GdaDsnInfo structure, or %NULL if not found the name of the DSN to look for Add or update a DSN from the definition in @info TRUE if no error occurred a pointer to a filled GdaDsnInfo structure Remove the DSN named @dsn_name TRUE if no error occurred the name of the DSN to remove Tells if the data source identified as @dsn_name needs any authentication. If a &lt;username&gt; and optionally a &lt;password&gt; are specified, they are ignored. TRUE if an authentication is needed the name of a DSN, in the "[&lt;username&gt;[:&lt;password&gt;]@]&lt;DSN&gt;" format Get a #GdaDataModel representing all the configured DSN, and keeping itself up to date with the changes in the declared DSN. The returned data model is composed of the following columns: <itemizedlist> <listitem><para>DSN name</para></listitem> <listitem><para>Provider name</para></listitem> <listitem><para>Description</para></listitem> <listitem><para>Connection string</para></listitem> <listitem><para>Username if it exists</para></listitem> </itemizedlist> a new #GdaDataModel Tells if the global (system) configuration can be modified (considering system permissions and settings) TRUE if system-wide configuration can be modified Get the number of defined DSN the number of defined DSN Get the index (starting at 0) of the DSN named @dsn_name the index or -1 if not found a DSN Get a pointer to a read-only #GdaDsnInfo at the @index position the pointer or %NULL if no DSN exists at position @index an index Get some information about the a database provider (adapter) named a pointer to read-only #GdaProviderInfo structure, or %NULL if not found a database provider Get a pointer to the session-wide #GdaServerProvider for the provider named @provider_name. The caller must not call g_object_unref() on the returned object. a pointer to the #GdaServerProvider, or %NULL if an error occurred a database provider Get a #GdaDataModel representing all the installed database providers. The returned data model is composed of the following columns: <itemizedlist> <listitem><para>Provider name</para></listitem> <listitem><para>Description</para></listitem> <listitem><para>DSN parameters</para></listitem> <listitem><para>Authentication parameters</para></listitem> <listitem><para>File name of the plugin</para></listitem> </itemizedlist> a new #GdaDataModel This function is the way of opening database connections with libgda, 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_open_from_string() instead of this method. (if &lt;username&gt; and/or &lt;password&gt; are provided, and @auth_string is %NULL, then these username and passwords will be used). Note that if provided, &lt;username&gt; and &lt;password&gt; 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 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. The actual named parameters required depend on the provider being used, and that list is available as the <parameter>auth_params</parameter> 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-4.0 -L" command to list the possible named parameters. a new #GdaConnection if connection opening was sucessfull or %NULL if there was an error. data source name. authentication string, or %NULL options for the connection (see #GdaConnectionOptions). 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 &lt;key&gt;=&lt;value&gt; 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-4.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 <constant>"DB_DIR=.;DB_NAME=my_data"</constant>. "[&lt;provider&gt;://][&lt;username&gt;[:&lt;password&gt;]@]&lt;connection_params&gt;" (if &lt;username&gt; and/or &lt;password&gt; are provided, and @auth_string is %NULL, then these username and passwords will be used, and if &lt;provider&gt; is provided and @provider_name is %NULL then this provider will be used). Note that if provided, &lt;username&gt;, &lt;password&gt; and &lt;provider&gt; 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 <parameter>auth_params</parameter> 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-4.0 -L" command to list the possible named parameters. Additionally, it is possible to have the connection string respect the "&lt;provider_name&gt;://&lt;real cnc string&gt;" 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). a new #GdaConnection if connection opening was sucessfull or %NULL if there was an error. provider ID to connect to, or %NULL connection string. authentication string, or %NULL options for the connection (see #GdaConnectionOptions). 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. a new #GdaConnection, or %NULL if an error occurred the directory the database file will be in, or %NULL for the default TMP directory the database file name if %TRUE, then the database file will be removed afterwards Tries to open the connection. TRUE if the connection is opened, and FALSE otherwise. Closes the connection to the underlying data source, but first emits the "conn-to-close" signal. Closes the connection to the underlying data source, without emiting any warning signal. Checks whether a connection is open or not. %TRUE if the connection is open, %FALSE if it's not. Gets the #GdaConnectionOptions used to open this connection. the connection options. Gets a pointer to the #GdaServerProvider object used to access the database the #GdaServerProvider (NEVER NULL) Gets the name (identifier) of the database provider used by @cnc a non modifiable string 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. of operation or if an error occurred a new #GdaServerOperation object, or %NULL in the connection's provider does not support the @type type the type of operation requested an optional list of parameters 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. TRUE if no error occurred a #GdaServerOperation object to. the data source name the connection object is connected 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. the connection string used when opening the connection. Gets the user name used to open this connection. the user name. 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. a #GList of #GdaConnectionEvent objects (the list should not be modified) 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(). a new #GdaSqlParser object, or %NULL 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. a new list of #GObject objects a #GdaBatch object which contains all the statements to execute a #GdaSet object (which can be obtained using gda_batch_get_parameters()), or %NULL specifies how the returned data model(s) will be used, as a #GdaStatementModelUsage enum 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: <itemizedlist> <listitem><para>if @id is a reserved SQL keyword (such as SELECT, INSERT, ...)</para></listitem> <listitem><para>if @id contains non allowed characters such as spaces, or if it starts with a digit</para></listitem> <listitem><para>in any other event as necessary for @cnc, depending on the the options passed when opening the @cnc connection, and specifically the <link linkend="GDA-CONNECTION-OPTIONS-SQL-IDENTIFIERS-CASE-SENSITIVE:CAPS"> GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE</link> option.</para></listitem> </itemizedlist> One can safely pass an already quoted @id to this method, either with quoting characters allowed by @cnc or using the double quote (") character. a new string, to free with g_free() once not needed anymore an SQL identifier Renders @stmt as an SQL statement, adapted to the SQL dialect used by @cnc a new string, or %NULL if an error occurred a #GdaStatement object a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL SQL rendering flags, as #GdaStatementSqlFlag OR'ed values a place to store the list of individual #GdaHolder objects within @params which have been used 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 <![CDATA["SELECT * FROM ##tablename::string"]]> because database usually don't allow variables to be used in place of a table name). TRUE if no error occurred. a #GdaStatement object Executes @stmt. As @stmt can, by desing (and if not abused), contain only one SQL statement, the return object will either be: <itemizedlist> <listitem><para>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.</para></listitem> <listitem><para>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: <itemizedlist> <listitem><para>a (gint) #GdaHolder named "IMPACTED_ROWS"</para></listitem> <listitem><para>a (GObject) #GdaHolder named "EVENT" which contains a #GdaConnectionEvent</para></listitem> </itemizedlist></para></listitem> </itemizedlist> If @last_insert_row is not %NULL and @stmt is an INSERT statement, then it will contain (if the provider used by @cnc supports it) a new #GdaSet object composed of value holders named "+&lt;column number&gt;" 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: <itemizedlist> <listitem><para>one with the '+0' ID which may for example contain 1 (note that its "name" property should be "id")</para></listitem> <listitem><para>one with the '+1' ID which will contain 'joe' (note that its "name" property should be "name")</para></listitem> </itemizedlist> This method may fail with a %GDA_SERVER_PROVIDER_ERROR domain error (see the #GdaServerProviderError error codes). be executed and this method will return %NULL. invalid parameters, then the statement can't be executed and this method will return %NULL, unless the 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 <link linkend="GdaDataSelect--auto-reset">auto-reset</link> property for more information. GDA_STATEMENT_MODEL_CURSOR_FORWARD flags, then the default will be to return a random access data model 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 <link linkend="gen:blobs">Binary large objects (BLOBs)</link> for more information. Also see the <link linkend="limitations">provider's limitations</link>, and the <link linkend="data-select">Advanced GdaDataSelect usage</link> sections. a #GObject, or %NULL if an error occurred a #GdaStatement object a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL in the case where @stmt is a SELECT statement, specifies how the returned data model will be used a place to store a new #GdaSet object which contains the values of the last inserted row, or %NULL Executes a selection command on the given connection. The gda_execute_select_command() method can be easier to use if one prefers to use some SQL directly. 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. data source, or %NULL if an error occurred a #GdaDataModel containing the data returned by the a #GdaStatement object. a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL 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. data source, or %NULL if an error occurred a #GdaDataModel containing the data returned by the a #GdaStatement object. a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL specifies how the returned data model will be used as a #GdaStatementModelUsage enum a place to store an error, or %NULL 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. data source, or %NULL if an error occurred a #GdaDataModel containing the data returned by the a #GdaStatement object. a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL specifies how the returned data model will be used as a #GdaStatementModelUsage enum 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. @col_types can also be %NULL if no column type is specified. Executes a non-selection statement on the given connection. The gda_execute_non_select_command() method can be easier to use if one prefers to use some SQL directly. 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. the number of rows affected (&gt;=0) or -1 or -2 a #GdaStatement object. a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL a place to store a new #GdaSet object which contains the values of the last inserted row, or %NULL This method is similar to gda_connection_statement_execute() but is asynchronous as it method returns immediately with a task ID. It's up to the caller to use gda_connection_async_fetch_result() regularly to check if the statement's execution is finished. It is possible to call the method several times to request several statements to be executed asynchronously, the statements will be executed in the order in which they were requested. The parameters, if present, are copied and can be discarded or modified before the statement is actually executed. The @stmt object is not copied but simply referenced (for performance reasons), and if it is modified before it is actually executed, then its execution will not occur. It is however safe to call g_object_unref() on it if it's not needed anymore. The execution failure of any statement has no impact on the execution of other statements except for example if the connection has a transaction started and the failure invalidates the transaction (as decided by the database server). but any other error) a task ID, or 0 if an error occurred (not an error regarding @stmt itself as its execution has not yet started a #GdaStatement object a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL in the case where @stmt is a SELECT statement, specifies how the returned data model will be used an array of GType to request each returned #GdaDataModel's column's GType, terminated with the G_TYPE_NONE TRUE if the values of the last interted row must be computed Use this method to obtain the result of the execution of a statement which has been executed asynchronously by calling gda_connection_async_statement_execute(). This function is non locking and will return %NULL (and no error will be set) if the statement has not been executed yet. If the statement has been executed, this method returns the same value as gda_connection_statement_execute() would have if the statement had been executed synchronously. a #GObject, or %NULL if an error occurred a task ID returned by gda_connection_async_statement_execute() a place to store a new #GdaSet object which contains the values of the last inserted row, or %NULL Requests that a task be cancelled. This operation may of may not have any effect depending on the task's status, even if it returns %TRUE. If it returns %FALSE, then the task has not been cancelled. TRUE if no error occurred a task ID returned by gda_connection_async_statement_execute() 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. 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. a new list of #GObject pointers (see gda_connection_statement_execute() for more information about what they a #GdaRepetitiveStatement object specifies how the returned data model will be used as a #GdaStatementModelUsage enum an array of GType to request each returned GdaDataModel's column's GType, see gda_connection_statement_execute_select_full() for more information set to TRUE if the method has to stop on the first error. Starts a transaction on the data source, identified by the Before starting a transaction, you can check whether the underlying provider does support transactions or not by using the gda_connection_supports_feature() function. otherwise. %TRUE if the transaction was started successfully, %FALSE the name of the transation to start, or %NULL the requested transaction level (%GDA_TRANSACTION_ISOLATION_UNKNOWN if not specified) Commits the given transaction to the backend database. You need to call gda_connection_begin_transaction() first. %FALSE otherwise. %TRUE if the transaction was finished successfully, the name of the transation to commit, or %NULL 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. %TRUE if the operation was successful, %FALSE otherwise. the name of the transation to commit, or %NULL Adds a SAVEPOINT named @name. TRUE if no error occurred name of the savepoint to add Rollback all the modifications made after the SAVEPOINT named @name. TRUE if no error occurred name of the savepoint to rollback to Delete the SAVEPOINT named @name when not used anymore. TRUE if no error occurred name of the savepoint to delete 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 a #GdaTransactionStatus object, or %NULL Asks the underlying provider for if a specific feature is supported. %TRUE if the provider supports it, %FALSE if not. feature to ask for. Get or initializes the #GdaMetaStore associated to @cnc a #GdaMetaStore object Updates @cnc's associated #GdaMetaStore. If @context is not %NULL, then only the parts described by 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 may be useful for example in the following situations: <itemizedlist> <listitem><para>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 </para></listitem> <listitem><para>One is only interrested in the list of views, and may request that only the information about views may be updated</para></listitem> </itemizedlist> 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 <link linkend="information_schema:sql_identifiers"> meta data section about SQL identifiers</link> for more information, and the documentation about the gda_sql_identifier_quote() function which will be most useful. Note however that usually <emphasis>more</emphasis> information will be updated than strictly requested by the @context argument. For more information, see the <link linkend="information_schema">Database structure</link> section, and the <link linkend="howto-meta2">Update the meta data about a table</link> howto. TRUE if no error occurred description of which part of @cnc's associated #GdaMetaStore should be updated, or %NULL 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. 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 <link linkend="GdaConnectionMetaTypeHead">this description</link>. 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 <link linkend="information_schema:sql_identifiers"> meta data section about SQL identifiers</link> for more information, and the documentation about the gda_sql_identifier_quote() function which will be most useful. for freeing the returned model using g_object_unref(). a #GdaDataModel containing the data required. The caller is responsible describes which data to get. a place to store errors, or %NULL the number of filters in the @... argument see #gda_connection_get_meta_store_data for freeing the returned model using g_object_unref(). a #GdaDataModel containing the data required. The caller is responsible describes which data to get. a #GList of #GdaHolder objects set opaque @data, you'll have to do it yourself. an opaque structure, known only to the provider for which @cnc is opened function to call when the connection closes and @data needs to be destroyed 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 the pointer to the opaque structure set using gda_connection_internal_set_provider_data() 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. is stored internally, so you don't need to unref it. 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. 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. a format string (see the printf(3) documentation). This function lets you clear the list of #GdaConnectionEvent's of the given connection. Internal functions to be called by database providers when a transaction has been started to keep track of the transaction status of the connection. has already been called because a statement's execution was necessary to perform the action. name of the parent transaction, or %NULL transaction's name, or %NULL isolation level. 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 has already been called because a statement's execution was necessary to perform the action. transaction's name, or %NULL Internal functions to be called by database providers when a transaction has been committed to keep track of the transaction status of the connection has already been called because a statement's execution was necessary to perform the action. transaction's name, or %NULL Internal functions to be called by database providers when a statement has been executed to keep track of the transaction status of the connection a #GdaStatement which has been executed execution's parameters a #GdaConnectionEvent if the execution failed, or %NULL Internal functions to be called by database providers when a savepoint has been added to keep track of the transaction status of the connection has already been called because a statement's execution was necessary to perform the action. name of the parent transaction, or %NULL savepoint's name, or %NULL 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 has already been called because a statement's execution was necessary to perform the action. savepoint's name, or %NULL Internal functions to be called by database providers when a savepoint has been removed to keep track of the transaction status of the connection has already been called because a statement's execution was necessary to perform the action. savepoint's name, or %NULL Internal function to be called by database providers to force a transaction status change. the new state Internal function to be called by database providers to reset the transaction status. 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. a #GdaStatement object a prepared statement object (as a #GdaPStmt object, or more likely a descendant) gda_connection_add_prepared_statement() does. a #GdaStatement object 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(). the prepared statement, or %NULL if no association exists a #GdaStatement object Creates a new uninitialized event object. This class is used for communicating events from the different providers to the clients. the event object. the type of event Sets @event's severity (from a simple notice to a fatal event) This function should not be called directly. the severity of the event Get @event's severity (from a simple notice to a fatal event) the event type Get the description of the event. Note that is @event's type is GDA_CONNECTION_EVENT_COMMAND, the the description is the SQL of the command. @event's description. Sets @event's @description. This function should not be called directly. a description. @event's code (the code is specific to the provider being used) If you want to have a common understanding of the event codes, use gda_connection_event_get_gda_code() instead. This function should not be called directly a code. Retrieve the code associated to @event. the #GdaConnectionEventCode event's code library. If you want to specify the corresponding provider specific code, use gda_connection_event_get_code() or gda_connection_event_get_sqlstate() instead. This function should not be called directly a code @event's source. Sets @event's @source; this function should not be called directly a source. Get the SQLSTATE value of @event. Even though the SQLSTATE values are specified by ANSI SQL and ODBC, consult each DBMS for the possible values. However, the "00000" (success) value means that there is no error, and the "HY000" (general error) value means an error but no better error code available. @event's SQL state. Changes the SQLSTATE code of @event, this function should not be called directly Sets @event's SQL state. SQL state. Used with gda_connection_get_meta_store_data() to describe what meta data to extract from a connection's associated #GdaMetaStore. Specifies some aspects of a connection when opening it. Additional information about the GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE flag: <itemizedlist> <listitem><para>For example without this flag, if the table name specified in a #GdaServerOperation to create a table is <emphasis>MyTable</emphasis>, then usually the database will create a table named <emphasis>mytable</emphasis>, whereas with this flag, the table will be created as <emphasis>MyTable</emphasis> (note that in the end the database may still decide to name the table <emphasis>mytable</emphasis> or differently if it can't do otherwise).</para></listitem> <listitem><para>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</para></listitem> </itemizedlist> Additional information about the GDA_CONNECTION_OPTIONS_THREAD_SAFE and GDA_CONNECTION_OPTIONS_THREAD_ISOLATED flags: The GDA_CONNECTION_OPTIONS_THREAD_SAFE flag specifies that it has to be able to use the returned connection object from several threads at once (locking is ensured by the #GdaConnection itself). Depending on the database provider's implementation and on the native libraries it uses, the "normal" connection object might not respect this requirement, and in this case a specific thread is started and used as the unique thread which will manipulate the actual connection, while a "wrapper connection" is actually returned and used by the caller (that wrapper connection passes method calls from the calling thread to the actual connection's specific thread, and gets the results back). The GDA_CONNECTION_OPTIONS_THREAD_ISOLATED forces using a specific thread and a "wrapper connection" even if the "normal" connection would itself be thread safe; this is usefull for example to be sure the asynchronous API can always be used (see gda_connection_async_statement_execute()). Having a specific thread and a "wrapper connection" definitely has an impact on the performances (because it involves messages passing between threads for every method call), so using the GDA_CONNECTION_OPTIONS_THREAD_SAFE or GDA_CONNECTION_OPTIONS_THREAD_ISOLATED flags should be carefully considered. Creates a new #GdaDataModel object which buffers the rows of @model. This object is useful only if @model can only be accessed using cursor based method. a pointer to the newly created #GdaDataModel. a #GdaDataModel all the computed differences (as #GdaDiff structures) to @old_model, the resulting data model should have the same contents as @new_model. a new #GdaDataComparator object Data model to which the modifications should be applied Target data model. Defines the columns which will be used as a key when searching data. This is not mandatory but will speed things up as less data will be processed. an array of @nb_cols values the size of the @col_numbers array Actually computes the differences between the data models for which @comp is defined. For each difference computed, stored in a #GdaDiff structure, the "diff-computed" signal is emitted. If one connects to this signal and returns FALSE in the signal handler, then computing differences will be stopped and an error will be returned. TRUE if all the differences have been sucessfully computed, and FALSE if an error occurred Get the number of differences as computed by the last time gda_data_comparator_compute_diff() was called. the number of computed differences Get a pointer to the #GdaDiff structure representing the difference which number is @pos a pointer to a #GdaDiff, or %NULL if @pos is invalid the requested difference number (starting at 0) Get the attributes of @model such as how to access the data it contains if it's modifiable, etc. an ORed value of #GdaDataModelAccessFlags flags the number of rows in the given data model, or -1 if the number of rows is not known the number of columns in the given data model. Queries the underlying data model implementation for a description of a given column. That description is returned in the form of a #GdaColumn structure, which contains all the information about the given column in the data model. and should not be destroyed; any modification will affect the whole data model. the description of the column. column number. Get the index of the first column named @name in @model. the column index, or -1 if no column named @name was found a column name the name for the given column in a data model object. column number. Sets the @name of the given @col in @model, and if its title is not set, also sets the title to @name. column number name for the given column. the title for the given column in a data model object. column number. Sets the @title of the given @col in @model. column number title for the given column. Retrieves the data stored in the given position (identified by the @col and @row parameters) on a data model. This is the main function for accessing data in a model which allows random access to its data. To access data in a data model using a cursor, use a #GdaDataModelIter object, obtained using gda_data_model_create_iter(). occur if you do so). which means if you want to keep the value, a copy must be made, however it will remain valid as long as the only Libgda usage is calling gda_data_model_get_value_at() for different values of the same row. If you want to modify a value stored in a #GdaDataModel, use the gda_data_model_set_value_at() or gda_data_model_set_values() methods. position, or %NULL on error (out-of-bound position, etc). a #GValue containing the value stored in the given a valid column number. a valid row number. This method is similar to gda_data_model_get_value_at(), except that it also allows one to specify the expected #GType of the value to get: if the data model returned a #GValue of a type different than the expected one, then this method returns %NULL and an error code. position, or %NULL on error (out-of-bound position, wrong data type, etc). a #GValue containing the value stored in the given a valid column number. a valid row number. the expected data type of the returned value if TRUE, then NULL values (value of type %GDA_TYPE_NULL) will not generate any error Get the attributes of the value stored at (row, col) in @model, which is an ORed value of #GdaValueAttribute flags. As a special case, if if a row was added to @model. the attributes as an ORed value of #GdaValueAttribute a valid column number a valid row number, or -1 Creates a new iterator object #GdaDataModelIter object which can be used to iterate through rows in @model. Depending on the data model's implementation, a new #GdaDataModelIter object may be created, or a reference to an already existing #GdaDataModelIter may be returned. If a new #GdaDataModelIter is created, then the row it represents is undefined. For models which can be accessed randomly, any row can be set using gda_data_model_iter_move_to_row(), and for models which are accessible sequentially only then use gda_data_model_iter_move_next() (and gda_data_model_iter_move_prev() if supported). a #GdaDataModelIter object, or %NULL if an error occurred Disables notifications of changes on the given data model. To re-enable notifications again, you should call the #gda_data_model_thaw function. Re-enables notifications of changes on the given data model. Modifies a value in @model, at (@col, @row). TRUE if the value in the data model has been updated and no error occurred column number. row number. a #GValue (not %NULL) In a similar way to gda_data_model_set_value_at(), this method modifies a data model's contents by setting several values at once. If any value in @values is actually %NULL, then the value in the corresponding column is left unchanged. TRUE if the value in the data model has been updated and no error occurred row number. a list of #GValue, one for at most the number of columns of @model Appends a row to the data model (the new row will possibly have NULL values for all columns, or some other values depending on the data model implementation) the number of the added row, or -1 if an error occurred Appends a row to the given data model. If any value in @values is actually %NULL, then it is considered as a default value. the number of the added row, or -1 if an error occurred #GList of #GValue* representing the row to add. The length must match model's column count. These #GValue are value-copied (the user is still responsible for freeing them). Removes a row from the data model. %TRUE if successful, %FALSE otherwise. the row number to be removed. Returns the first row where all the values in @values at the columns identified at the requested row number, of -1 if not found a list of #GValue values (no %NULL is allowed) an array of #gint containing the column number to match each value of @values Sends a hint to the data model. The hint may or may not be handled by the data model, depending on its implementation a hint to send to the model an optional value to specify the hint, or %NULL Exports data contained in @model to a string; the format is specified using the @format argument, see the gda_data_model_export_to_file() documentation for more information about the @options argument (except for the "OVERWRITE" option). a new string. the format in which to export data an array containing which columns of @model will be exported, or %NULL for all columns the number of columns in @cols an array containing which rows of @model will be exported, or %NULL for all rows the number of rows in @rows list of options for the export Exports data contained in @model to the @file file; the format is specified using the @format argument. Specifically, the parameters in the @options list can be: <itemizedlist> <listitem><para>"SEPARATOR": a string value of which the first character is used as a separator in case of CSV export </para></listitem> <listitem><para>"QUOTE": a string value of which the first character is used as a quote character in case of CSV export </para></listitem> <listitem><para>"FIELD_QUOTE": a boolean value which can be set to FALSE if no quote around the individual fields is requeted, in case of CSV export</para></listitem> <listitem><para>"NAME": a string value used to name the exported data if the export format is XML</para></listitem> <listitem><para>"OVERWRITE": a boolean value which tells if the file must be over-written if it already exists. </para></listitem> </itemizedlist> TRUE if no error occurred the format in which to export data the filename to export to an array containing which columns of @model will be exported, or %NULL for all columns the number of columns in @cols an array containing which rows of @model will be exported, or %NULL for all rows the number of rows in @rows list of options for the export Copy the contents of the @from data model to the @to data model. The copy stops as soon as an error orrurs. The @cols_trans is a hash table for which keys are @to columns numbers and the values are the corresponding column numbers in the @from data model. To set the values of a column in @to to NULL, create an entry in the hash table with a negative value. TRUE if no error occurred. the source #GdaDataModel TRUE if @to is completely overwritten by @from's data, and FALSE if @from's data is appended to @to a #GHashTable for columns translating, or %NULL Loads the data from @string into @model. TRUE if no error occurred. the string to import data from a hash table containing which columns of @model will be imported, or %NULL for all columns, see gda_data_model_import_from_model() list of options for the export Imports data contained in the @file file into @model; the format is detected. TRUE if no error occurred the filename to import from a #GHashTable for columns translating, or %NULL, see gda_data_model_import_from_model() list of options for the export Dumps a textual representation of the @model into a new string The following environment variables can affect the resulting output: <itemizedlist> <listitem><para>GDA_DATA_MODEL_DUMP_ROW_NUMBERS: if set, the first column of the output will contain row numbers</para></listitem> <listitem><para>GDA_DATA_MODEL_DUMP_TITLE: if set, also dump the data model's title</para></listitem> <listitem><para>GDA_DATA_MODEL_DUMP_NULL_AS_EMPTY: if set, replace the 'NULL' string with an empty string for NULL values </para></listitem> </itemizedlist> a new string. Makes a copy of @src into a new #GdaDataModelArray object a new data model, or %NULL if an error occurred Emits the 'row_inserted' and 'changed' signals on @model. This method should only be used by #GdaDataModel implementations to signal that a row has been inserted. row number. Emits the 'row_updated' and 'changed' signals on @model. This method should only be used by #GdaDataModel implementations to signal that a row has been updated. row number. Emits the 'row_removed' and 'changed' signal on @model. This method should only be used by #GdaDataModel implementations to signal that a row has been removed row number. Emits the 'reset' and 'changed' signal on @model. Adds the data from an XML node to the given data model (see the DTD for that node in the $prefix/share/libgda/dtd/libgda-array.dtd file). %TRUE if successful, %FALSE otherwise. an XML node representing a &lt;gda_array_data&gt; XML node. Creates a new #GdaDataModel object with the column types as specified. a pointer to the newly created #GdaDataModel. number of columns for rows in this data model. Creates a new #GdaDataModel object without initializing the column types. Using gda_data_model_array_new_with_g_types() is usually better. a pointer to the newly created #GdaDataModel. number of columns for rows in this data model. Get a pointer to a row in @model the #GdaRow, or %NULL if an error occurred row number (starting from 0) Sets the number of columns for rows inserted in this model. Also clears @model's contents. number of columns for rows this data model should use. Frees all the rows in @model. Creates a new #GdaDataModel object to access the contents of the Berkeley DB file @file, for the database @db_name if not %NULL a new #GdaDataModel name of the file containing the database the name of the database within @filename, or %NULL Get the list of errors which have occurred while using @model a read-only list of #GError pointers, or %NULL if no error has occurred Reset the list of errors which have occurred while using @model Struture to hold information about each database object (tables, views, ...), its contents must not be modified. one must use gda_sql_identifier_quote() to know if is it is necessary to surround by double quotes before using in an SQL statement Get an ordered list of the tables @store knows about. The tables are ordered in a way that tables dependencies list. but the strings present in the list must not be modified. a new list of tables names (as gchar*), the list must be freed when no longer needed, This structure specifies a #GdaMetaDbObject to represent a table's specific attributes, its contents must not be modified. This structure represents a table of view's column, its contents must not be modified. This structure represents a foreign key constraint, its contents must not be modified. This structure specifies a #GdaMetaDbObject to represent a view's specific attributes, its contents must not be modified. Creates a new #GdaSet object, and populates it with the list given as argument. The list can then be freed as it is copied. All the value holders in @holders are referenced counted and modified, so they should not be used anymore afterwards. a new #GdaSet object a list of #GdaHolder objects Creates a new #GdaSet containing holders defined by each triplet in ... For each triplet (id, Glib type and value), the value must be of the correct type (gchar * if type is G_STRING, ...) Note that this function is a utility function and that only a limited set of types are supported. Trying to use an unsupported type will result in a warning, and the returned value holder holding a safe default value. a new #GdaSet object the number of value holders which will be contained in the new #GdaSet Creates a new #GdaSet object from the @xml_spec specifications a new object, or %NULL if an error occurred a string Creates a new #GdaSet object from the @xml_spec specifications a new object, or %NULL if an error occurred a #xmlNodePtr for a &lt;holders&gt; tag Creates a new #GdaSet object, copy of @set a new #GdaSet object Set the value of the #GdaHolder which ID is @holder_id to a specified value TRUE if no error occurred and the value was set correctly a place to store errors, or %NULL the ID of the holder to set the value Get the value of the #GdaHolder which ID is @holder_id the requested GValue, or %NULL (see gda_holder_get_value()) the ID of the holder to set the value Finds a #GdaHolder using its ID the requested #GdaHolder or %NULL the ID of the requested value holder Finds a #GdaHolder using its position the requested #GdaHolder or %NULL the position of the requested #GdaHolder, starting at %0 Adds @holder to the list of holders managed within @set. will not be added to the set (even if @holder's type or value is not the same as the one already in @set). with the same ID) TRUE if @holder has been added to @set (and FALSE if it has not been added because there is another #GdaHolder a #GdaHolder object Removes a #GdaHolder from the list of holders managed by @set the #GdaHolder to remove from @set Add to @set all the holders of @set_to_merge. a #GdaSet object This method tells if all @set's #GdaHolder objects are valid, and if they represent a valid combination of values, as defined by rules error, then the returned value is TRUE, otherwise the return value is FALSE as soon as a signal handler returns an error. TRUE if the set is valid Finds a #GdaSetNode holding information for @holder, don't modify the returned structure the requested #GdaSetNode or %NULL a #GdaHolder object Finds the #GdaSetSource structure used in @set for which @model is a the data model (the returned structure should not be modified). the requested #GdaSetSource pointer or %NULL. a #GdaDataModel object Finds a #GdaSetSource which contains the #GdaDataModel restricting the possible values of the requested #GdaSetSource or %NULL a #GdaHolder object Finds a #GdaSetGroup which lists a #GdaSetNode containing @holder, don't modify the returned structure. the requested #GdaSetGroup or %NULL a #GdaHolder object Creates a new #GdaSqlParser object the new object contains more than one statement, then the remaining part of the string is not parsed at all, and @remain (if not %NULL) will point at the first non parsed character. To include variables in the @sql string, see the <link linkend="GdaSqlParser.description">GdaSqlParser's object description</link>. a new #GdaStatement object, or %NULL if an error occurred the SQL string to parse location to store a pointer to remaining part of @sql in case @sql has multiple statement, or %NULL Parse @sql and creates a #GdaBatch object which contains all the #GdaStatement objects created while parsing (one object per SQL statement). Empty statements (composed of spaces only) do not appear in the resulting object. at some point, then the parsing stops and @remain may contain a non %NULL pointer, @error may be set, and %NULL is returned. if @sql is %NULL, then the returned #GdaBatch object will contain no statement. To include variables in the @sql string, see the <link linkend="GdaSqlParser.description">GdaSqlParser's object description</link>. a new #GdaBatch object, or %NULL if an error occurred the SQL string to parse location to store a pointer to remaining part of @sql in case an error occurred while parsing @sql, or %NULL Parse @filename's contents and creates a #GdaBatch object which contains all the #GdaStatement objects created while parsing (one object per SQL statement). at some point, then the parsing stops, @error may be set and %NULL is returned if @sql is %NULL, then the returned #GdaBatch object will contain no statement. a new #GdaBatch object, or %NULL if an error occurred name of the file to parse Creates a new #GdaStatement object the new object Copy constructor a the new copy of @orig Creates a string representing the contents of @stmt. a string containing the serialized version of @stmt Get a new #GdaSet object which groups all the execution parameters which @stmt needs. This new object is returned though @out_params. Note that if @stmt does not need any parameter, then @out_params is set to %NULL. TRUE if no error occurred. a place to store a new #GdaSet object, or %NULL Renders @stmt as an SQL statement, with some control on how it is rendered. If @cnc is not %NULL, then the rendered SQL will better be suited to be used by @cnc (in particular it may include some SQL tweaks and/or proprietary extensions specific to the database engine used by @cnc): in this case the result is similar to calling gda_connection_statement_to_sql(). a new string if no error occurred a #GdaConnection object, or %NULL parameters contained in a single #GdaSet object a set of flags to control the rendering a place to store the list of actual #GdaHolder objects in @params used to do the rendering, or %NULL Get the type of statement held by @stmt. It returns GDA_SQL_STATEMENT_NONE if the statement type Tells if @stmt is composed only of spaces (that is it has no real SQL code), and is completely useless as such. TRUE if executing @stmt does nothing Checks that @stmt's structure is correct. TRUE if @stmt's structure is correct If @cnc is not %NULL then checks that every object (table, field, function) used in @stmt actually exists in @cnc's database If @cnc is %NULL, then cleans anything related to @cnc in @stmt. See gda_sql_statement_check_validity() for more information. TRUE if every object actually exists in @cnc's database a #GdaConnection object, or %NULL "Normalizes" some parts of @stmt, see gda_sql_statement_normalize() for more information. TRUE if no error occurred a #GdaConnection object Renders @stmt to its SQL representation, using @context to specify how each part of @stmt must be rendered. This function is mainly used by database provider's implementations which require to specialize some aspects of SQL rendering to be adapted to the database,'s own SQL dialect (for example SQLite rewrites the 'FALSE' and 'TRUE' literals as '0' and 'NOT 0'). a new string, or %NULL if an error occurred a #GdaSqlRenderingContext context