Top | ![]() |
![]() |
![]() |
![]() |
void gda_server_provider_set_impl_functions (GdaServerProviderClass *klass
,GdaServerProviderFunctionsType type
,gpointer functions_set
);
Upon creation, used by provider's implementors to set the implementation functions. Passing NULL
as the functions_set
has no effect.
If some pointers of functions_set
are NULL
, they are replaced by functions from the parent class of
provider
.
Warning: this function must only be called once for each different values of type
and for each klass
klass |
a GdaServerProviderClass object |
|
type |
||
functions_set |
a pointer to the function set, or |
[allow-none] |
Since: 6.0
gpointer gda_server_provider_get_impl_functions_for_class (GObjectClass *klass
,GdaServerProviderFunctionsType type
);
Represents the different types of sets of virtual functions which can be implemented for each provider
typedef struct { /* functions called from any thread */ const gchar *(* get_name) (GdaServerProvider *provider); const gchar *(* get_version) (GdaServerProvider *provider); const gchar *(* get_server_version) (GdaServerProvider *provider, GdaConnection *cnc); gboolean (* supports_feature) (GdaServerProvider *provider, GdaConnection *cnc, GdaConnectionFeature feature); GdaWorker *(* create_worker) (GdaServerProvider *provider, gboolean for_cnc); GdaConnection *(* create_connection) (GdaServerProvider *provider); /* may be NULL */ GdaSqlParser *(* create_parser) (GdaServerProvider *provider, GdaConnection *cnc); /* may be NULL */ GdaDataHandler *(* get_data_handler) (GdaServerProvider *provider, GdaConnection *cnc, /* may be NULL */ GType g_type, const gchar *dbms_type); const gchar *(* get_def_dbms_type) (GdaServerProvider *provider, GdaConnection *cnc, GType g_type); /* may be NULL */ gboolean (* supports_operation) (GdaServerProvider *provider, GdaConnection *cnc, GdaServerOperationType type, GdaSet *options); GdaServerOperation *(* create_operation) (GdaServerProvider *provider, GdaConnection *cnc, GdaServerOperationType type, GdaSet *options, GError **error); gchar *(* render_operation) (GdaServerProvider *provider, GdaConnection *cnc, GdaServerOperation *op, GError **error); /** * statement_to_sql: * @provider: a #GdaServerProvider * @cnc: a #GdaConnection * @stmt: a #GdaStatement * @params: (allow-none): a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL * @flags: SQL rendering flags, as #GdaStatementSqlFlag OR'ed values * @params_used: (allow-none) (element-type Gda.Holder) (out) (transfer container): a place to store the list of individual #GdaHolder objects within @params which have been used * @error: a place to store errors, or %NULL * * Renders @stmt as an SQL statement, adapted to the SQL dialect used by @cnc * * Returns: a new string, or %NULL if an error occurred */ gchar *(* statement_to_sql) (GdaServerProvider *provider, GdaConnection *cnc, GdaStatement *stmt, GdaSet *params, GdaStatementSqlFlag flags, GSList **params_used, GError **error); /** * identifier_quote: * @provider: a #GdaServerProvider * @cnc: (allow-none): a #GdaConnection, or %NULL * @id: a string * @for_meta_store: if %TRUE, then the result have to respect the #GdaMetaStore convention * @force_quotes: if %TRUE, then quotes have to be added * * Create a new string in which @id can be used in an SQL statement, for example by adding quotes if * it is a reserved keyword, or if it is case sensitive. * * If not %NULL, @cnc can either be opened or closed. * * Returns: (transfer full): a new string */ gchar *(* identifier_quote) (GdaServerProvider *provider, GdaConnection *cnc, /* may be NULL */ const gchar *id, gboolean for_meta_store, gboolean force_quotes); GdaSqlStatement *(* statement_rewrite) (GdaServerProvider *provider, GdaConnection *cnc, GdaStatement *stmt, GdaSet *params, GError **error); /** * open_connection: * @provider: a #GdaServerProvider * @cnc: a #GdaConnection * @params: (transfer none): a #GdaQuarkList containing the connection parameters (HOST, DATABASE, etc.) * @auth: (transfer none) (allow-none): a #GdaQuarkList containing the connection authentification parameters (USERNAME, PASSWORD, etc.), or %NULL * * Open the connection. @params and @auth must be left unchanged. * * Returns: %TRUE if the connection was opened. */ gboolean (* open_connection) (GdaServerProvider *provider, GdaConnection *cnc, GdaQuarkList *params, GdaQuarkList *auth); gboolean (* prepare_connection) (GdaServerProvider *provider, GdaConnection *cnc, GdaQuarkList *params, GdaQuarkList *auth); gboolean (* close_connection) (GdaServerProvider *provider, GdaConnection *cnc); gchar *(* escape_string) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *str); /* may be NULL */ gchar *(* unescape_string) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *str); /* may be NULL */ gboolean (* perform_operation) (GdaServerProvider *provider, GdaConnection *cnc, /* may be NULL */ GdaServerOperation *op, GError **error); gboolean (* begin_transaction) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *name, GdaTransactionIsolation level, GError **error); gboolean (* commit_transaction) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *name, GError **error); gboolean (* rollback_transaction) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *name, GError **error); gboolean (* add_savepoint) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *name, GError **error); gboolean (* rollback_savepoint) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *name, GError **error); gboolean (* delete_savepoint) (GdaServerProvider *provider, GdaConnection *cnc, const gchar *name, GError **error); gboolean (* statement_prepare) (GdaServerProvider *provider, GdaConnection *cnc, GdaStatement *stmt, GError **error); GObject *(* statement_execute) (GdaServerProvider *provider, GdaConnection *cnc, GdaStatement *stmt, GdaSet *params, GdaStatementModelUsage model_usage, GType *col_types, GdaSet **last_inserted_row, GError **error); } GdaServerProviderBase;
Functions implementing basic features.
A pointer to this structure is returned by _gda_server_provider_get_impl_functions()
when requesting
GDA_SERVER_PROVIDER_FUNCTIONS_BASE
functions.
typedef struct { /* _information_schema_catalog_name */ gboolean (*_info) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); /* _builtin_data_types */ gboolean (*_btypes) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); /* _udt */ gboolean (*_udt) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*udt) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *udt_catalog, const GValue *udt_schema); /* _udt_columns */ gboolean (*_udt_cols) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*udt_cols) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *udt_catalog, const GValue *udt_schema, const GValue *udt_name); /* _enums */ gboolean (*_enums) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*enums) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *udt_catalog, const GValue *udt_schema, const GValue *udt_name); /* _domains */ gboolean (*_domains) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*domains) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *domain_catalog, const GValue *domain_schema); /* _domain_constraints */ gboolean (*_constraints_dom) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*constraints_dom) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *domain_catalog, const GValue *domain_schema, const GValue *domain_name); /* _element_types */ gboolean (*_el_types) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*el_types) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *specific_name); /* _collations */ gboolean (*_collations) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*collations) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *collation_catalog, const GValue *collation_schema, const GValue *collation_name_n); /* _character_sets */ gboolean (*_character_sets) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*character_sets) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *chset_catalog, const GValue *chset_schema, const GValue *chset_name_n); /* _schemata */ gboolean (*_schemata) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*schemata) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *catalog_name, const GValue *schema_name_n); /* _tables or _views */ gboolean (*_tables_views) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*tables_views) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name_n); /* _columns */ gboolean (*_columns) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*columns) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name); /* _view_column_usage */ gboolean (*_view_cols) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*view_cols) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *view_catalog, const GValue *view_schema, const GValue *view_name); /* _table_constraints */ gboolean (*_constraints_tab) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*constraints_tab) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *constraint_name_n); /* _referential_constraints */ gboolean (*_constraints_ref) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*constraints_ref) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *constraint_name); /* _key_column_usage */ gboolean (*_key_columns) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*key_columns) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *constraint_name); /* _check_column_usage */ gboolean (*_check_columns) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*check_columns) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *constraint_name); /* _triggers */ gboolean (*_triggers) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*triggers) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name); /* _routines */ gboolean (*_routines) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*routines) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *routine_catalog, const GValue *routine_schema, const GValue *routine_name_n); /* _routine_columns */ gboolean (*_routine_col) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*routine_col) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *rout_catalog, const GValue *rout_schema, const GValue *rout_name); /* _parameters */ gboolean (*_routine_par) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*routine_par) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *rout_catalog, const GValue *rout_schema, const GValue *rout_name); /* _table_indexes */ gboolean (*_indexes_tab) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*indexes_tab) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *index_name_n); /* _index_column_usage */ gboolean (*_index_cols) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error); gboolean (*index_cols) (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *meta, GdaMetaContext *ctx, GError **error, const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *index_name); } GdaServerProviderMeta;
These methods must be implemented by providers to update a connection's associated metadata (in a GdaMetaStore object), see the Virtual methods for providers/Methods - metadata for more information.
typedef struct { gboolean (*xa_start) (GdaServerProvider *prov, GdaConnection *cnc, const GdaXaTransactionId *trx, GError **error); gboolean (*xa_end) (GdaServerProvider *prov, GdaConnection *cnc, const GdaXaTransactionId *trx, GError **error); gboolean (*xa_prepare) (GdaServerProvider *prov, GdaConnection *cnc, const GdaXaTransactionId *trx, GError **error); gboolean (*xa_commit) (GdaServerProvider *prov, GdaConnection *cnc, const GdaXaTransactionId *trx, GError **error); gboolean (*xa_rollback) (GdaServerProvider *prov, GdaConnection *cnc, const GdaXaTransactionId *trx, GError **error); GList *(*xa_recover) (GdaServerProvider *prov, GdaConnection *cnc, GError **error); } GdaServerProviderXa;
Functions implementing distributed transactions.