- public void add_event (owned ConnectionEvent event)
Adds an event to the given connection.
- public void add_prepared_statement (Statement gda_stmt, PStmt prepared_stmt)
Declares that prepared_stmt
is a prepared statement
object associated to gda_stmt
within the connection (meaning the connection increments the reference counter of
prepared_stmt
).
- public bool add_savepoint (string? name) throws Error
Adds a SAVEPOINT named name
.
- public bool async_cancel (uint task_id) throws Error
Requests that a task be cancelled.
- public Object async_fetch_result (uint task_id, out Set last_insert_row) throws Error
Use this method to obtain the result of the execution of a statement
which has been executed asynchronously by calling
async_statement_execute.
- public uint async_statement_execute (Statement stmt, Set? @params, StatementModelUsage model_usage, Type[]? col_types, bool need_last_insert_row) throws Error
This method is similar to
statement_execute but is asynchronous as it method returns
immediately with a task ID.
- public SList<Object> batch_execute (Batch batch, Set? @params, StatementModelUsage model_usage) throws Error
Executes all the statements contained in batch
(in the
order in which they were added to batch
), and returns a list of Object objects, at most one
Object for each statement; see
statement_execute for details about the returned objects.
- public bool begin_transaction (string? name, TransactionIsolation level) throws Error
Starts a transaction on the data source, identified by the name
parameter.
- public void clear_events_list ()
This function lets you clear the list of
ConnectionEvent's of the given connection.
- public void close ()
Closes the connection to the underlying data source, but first emits
the "conn-to-close" signal.
- public void close_no_warning ()
Closes the connection to the underlying data source, without emiting
any warning signal.
- public bool commit_transaction (string? name) throws Error
Commits the given transaction to the backend database.
- public ServerOperation create_operation (ServerOperationType type, Set? options) throws Error
Creates a new
ServerOperation object which can be modified in order to perform the type type of action.
- public SqlParser create_parser ()
Creates a new parser object able to parse the SQL dialect understood
by this.
- public void del_prepared_statement (Statement gda_stmt)
- public bool delete_row_from_table (string table, string condition_column_name, Value condition_value) throws Error
This is a convenience function, which creates a DELETE statement and
executes it using the values provided.
- public bool delete_savepoint (string? name) throws Error
Delete the SAVEPOINT named name
when not used anymore.
- public int execute_non_select_command (string sql) throws Error
This is a convenience function to execute a SQL command over the
opened connection.
- public DataModel execute_select_command (string sql) throws Error
Execute a SQL SELECT command over an opened connection.
- public unowned string get_authentication ()
Gets the user name used to open this connection.
- public unowned string get_cnc_string ()
Gets the connection string used to open this connection.
- public bool get_date_format (out DateDMY out_first, out DateDMY out_second, out DateDMY out_third, out string out_sep) throws Error
This function allows you to determine the actual format for the date
values.
- public unowned string get_dsn ()
- public unowned List<ConnectionEvent> get_events ()
Retrieves a list of the last errors occurred during the connection.
- public unowned MetaStore get_meta_store ()
Get or initializes the
MetaStore associated to this
- public DataModel get_meta_store_data (ConnectionMetaType meta_type, Error error, int nb_filters, ...)
Retrieves data stored in this's
associated MetaStore object.
- public DataModel get_meta_store_data_v (ConnectionMetaType meta_type, List<Holder> filters) throws Error
- public ConnectionOptions get_options ()
- public unowned PStmt get_prepared_statement (Statement gda_stmt)
Retrieves a pointer to an object representing a prepared statement for
gda_stmt
within this.
- public unowned ServerProvider get_provider ()
Gets a pointer to the
ServerProvider object used to access the database
- public unowned string get_provider_name ()
Gets the name (identifier) of the database provider used by
this
- public unowned TransactionStatus get_transaction_status ()
Get the status of this regarding
transactions.
- public bool insert_row_into_table (string table, Error error, ...)
This is a convenience function, which creates an INSERT statement and
executes it using the values provided.
- public bool insert_row_into_table_v (string table, SList<string> col_names, SList<Value?> values) throws Error
col_names
and values
must have length (>=
1).
- public bool is_opened ()
Checks whether a connection is open or not.
- public bool open () throws Error
Tries to open the connection.
- public Statement parse_sql_string (string sql, out Set @params) throws Error
This function helps to parse a SQL string which uses parameters and
store them at params
.
- public bool perform_operation (ServerOperation op) throws Error
Performs the operation described by op
(which should have
been created using create_operation).
- public ConnectionEvent point_available_event (ConnectionEventType type)
Use this method to get a pointer to the next available connection
event which can then be customized and taken into account using add_event.
- public string quote_sql_identifier (string id)
Use this method to get a correctly quoted (if necessary) SQL
identifier which can be used in SQL statements, from id
.
- public SList<Object> repetitive_statement_execute (RepetitiveStatement rstmt, StatementModelUsage model_usage, Type[]? col_types, bool stop_on_error) throws Error
Executes the statement upon which rstmt
is built.
- public bool rollback_savepoint (string? name) throws Error
Rollback all the modifications made after the SAVEPOINT named
name
.
- public bool rollback_transaction (string? name) throws Error
Rollbacks the given transaction.
- public Object statement_execute (Statement stmt, Set? @params, StatementModelUsage model_usage, out Set last_insert_row) throws Error
Executes stmt
.
- public int statement_execute_non_select (Statement stmt, Set? @params, out Set last_insert_row) throws Error
Executes a non-selection statement on the given connection.
- public DataModel statement_execute_select (Statement stmt, Set? @params) throws Error
Executes a selection command on the given connection.
- public DataModel statement_execute_select_full (Statement stmt, Set? @params, StatementModelUsage model_usage, Type[]? col_types) throws Error
Executes a selection command on the given connection.
- public DataModel statement_execute_select_fullv (Statement stmt, Set? @params, StatementModelUsage model_usage, Error error, ...)
Executes a selection command on the given connection.
- public bool statement_prepare (Statement stmt) throws Error
Ask the database accessed through the this
connection to prepare the usage of stmt
.
- public string statement_to_sql (Statement stmt, Set? @params, StatementSqlFlag flags, out SList<unowned Holder> params_used) throws Error
Renders stmt
as an SQL statement, adapted to the SQL
dialect used by this
- public bool supports_feature (ConnectionFeature feature)
Asks the underlying provider for if a specific feature is supported.
- public bool update_meta_store (MetaContext? context) throws Error
- public bool update_row_in_table (string table, string condition_column_name, Value condition_value, Error error, ...)
This is a convenience function, which creates an UPDATE statement and
executes it using the values provided.
- public bool update_row_in_table_v (string table, string condition_column_name, Value condition_value, SList<string> col_names, SList<Value?> values) throws Error
col_names
and values
must have length (>=
1).
- public string value_to_sql_string (Value from)
Produces a fully quoted and escaped string from a GValue