- 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 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 bool close () throws Error
Closes the connection to the underlying data source.
- public bool commit_transaction (string? name) throws Error
Commits the given transaction to the backend database.
- public DbCatalog create_db_catalog ()
A convenient method to create a new
DbCatalog instance and set the current this as a
property.
- 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 MainContext get_main_context (Thread? thread)
Get the MainContext used while a
potentially blocking operation is performed using nc
, see
set_main_context.
- public unowned MetaStore get_meta_store ()
Get or initializes the
MetaStore associated to this
- public DataModel get_meta_store_data_v (ConnectionMetaType meta_type, List<Holder> filters) throws Error
see gda_connection_get_meta_store_data
- 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 ConnectionStatus get_status ()
Get the current status of this.
- public unowned TransactionStatus get_transaction_status ()
Get the status of this regarding
transactions.
- 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 (&
gt;= 1).
- public void internal_change_transaction_state (TransactionStatusState newstate)
Internal function to be called by database providers to force a
transaction status change.
- public ServerProviderConnectionData? internal_get_provider_data_error () throws Error
- public void internal_reset_transaction_status ()
Internal function to be called by database providers to reset the
transaction status.
- public void internal_savepoint_added (string? parent_trans, string svp_name)
Internal functions to be called by database providers when a savepoint
has been added to keep track of the transaction status of the connection
- public void internal_savepoint_removed (string? svp_name)
Internal functions to be called by database providers when a savepoint
has been removed to keep track of the transaction status of the connection
- public void internal_savepoint_rolledback (string? svp_name)
Internal functions to be called by database providers when a savepoint
has been rolled back to keep track of the transaction status of the connection
- public void internal_set_provider_data (ServerProviderConnectionData data, DestroyNotify destroy_func)
Note: calling this function more than once will not make it call
destroy_func
on any previously set opaque data
, you'll have to do it yourself.
- public void internal_statement_executed (Statement stmt, Set? @params, ConnectionEvent error)
Internal functions to be called by database providers when a statement
has been executed to keep track of the transaction status of the connection
- public void internal_transaction_committed (string? trans_name)
Internal functions to be called by database providers when a
transaction has been committed to keep track of the transaction status of the connection
- public void internal_transaction_rolledback (string? trans_name)
Internal functions to be called by database providers when a
transaction has been rolled back to keep track of the transaction status of the connection
- public void internal_transaction_started (string? parent_trans, string trans_name, TransactionIsolation isol_level)
Internal functions to be called by database providers when a
transaction has been started to keep track of the transaction status of the connection.
- public bool is_opened ()
Checks whether a connection is open or not.
- public bool open () throws Error
Tries to open the connection.
- public uint open_async (ConnectionOpenFunc callback) throws Error
This function requests that the connection be opened.
- public string? operation_get_sql_identifier_at_path (ServerOperation op, string path) throws Error
This method is similar to gda_server_operation_get_value_at
, but for SQL identifiers: a new string is returned instead of a Value.
- public Statement parse_sql_string (string sql, out Set? @params = null) 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 ServerOperation? prepare_operation_create_table (string table_name, List<ServerOperationCreateTableArg> arguments) throws Error
Add more arguments if the flag needs them:
- public ServerOperation? prepare_operation_drop_table (string table_name) throws Error
This is just a convenient function to create a
ServerOperation to drop a table in an opened connection.
- 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 void set_main_context (Thread? thread, MainContext? context)
Defines the MainContext which will still
process events while a potentially blocking operation is performed using this.
- public Object statement_execute (Statement stmt, Set? @params, StatementModelUsage model_usage, out Set? last_insert_row = null) throws Error
Executes stmt
.
- public int statement_execute_non_select (Statement stmt, Set? @params = null, out Set? last_insert_row = null) throws Error
Executes a non-selection statement on the given connection.
- public DataModel statement_execute_select (Statement stmt, Set? @params = null) 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 = null) throws 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_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 (&
gt;= 1).
- public string value_to_sql_string (Value from)
Produces a fully quoted and escaped string from a GValue