[libgda/metat: 7/9] sqlite-provider: sckeleton to implement GdaProviderMeta interface
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/metat: 7/9] sqlite-provider: sckeleton to implement GdaProviderMeta interface
- Date: Wed, 7 Nov 2018 15:37:12 +0000 (UTC)
commit d108a13f3174d75fc618f05c35095bf693432baa
Author: Daniel Espinosa <esodan gmail com>
Date: Mon Aug 20 16:00:17 2018 -0500
sqlite-provider: sckeleton to implement GdaProviderMeta interface
libgda/gda-provider-meta.c | 17 +-
libgda/gda-provider-meta.h | 5 +-
libgda/sqlite/gda-sqlite-provider.c | 675 ++++++++++++++++++++++++++++++++++++
3 files changed, 692 insertions(+), 5 deletions(-)
---
diff --git a/libgda/gda-provider-meta.c b/libgda/gda-provider-meta.c
index 90c42faa7..d39fdf791 100644
--- a/libgda/gda-provider-meta.c
+++ b/libgda/gda-provider-meta.c
@@ -56,6 +56,7 @@ gda_provider_meta_default_init (GdaProviderMetaInterface *iface) {
* gda_provider_meta_execute_query:
* @prov: a #GdaProviderMeta
* @sql: a string with the SQL to execute on provider
+ * @params: (nullable): a #GdaSet with all paramaters to use in query
* @error: place to store errors or %NULL
*
* SQL is specific for current provider.
@@ -66,14 +67,15 @@ gda_provider_meta_default_init (GdaProviderMetaInterface *iface) {
*/
GdaDataModel *gda_provider_meta_execute_query (GdaProviderMeta *prov,
const gchar *sql,
+ GdaSet *params,
GError **error)
{
g_return_val_if_fail (prov, NULL);
g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
g_return_val_if_fail (sql, NULL);
- GdaDataModel *model = NULL;
GdaConnection *cnc = NULL;
+ GdaStatement *stmt;
g_object_get (G_OBJECT (prov), "connection", &cnc, NULL);
if (cnc == NULL) {
g_set_error (error, GDA_PROVIDER_META_ERROR, GDA_PROVIDER_META_NO_CONNECTION_ERROR,
@@ -85,8 +87,14 @@ GdaDataModel *gda_provider_meta_execute_query (GdaProviderMeta *prov,
_("Connection is no opened"));
return NULL;
}
- model = gda_connection_execute_select_command (cnc, sql, error);
- return model;
+ stmt = gda_connection_parse_sql_string (cnc, sql, params, error);
+ if (stmt == NULL) {
+ return NULL;
+ }
+ if (!gda_connection_statement_prepare (cnc, stmt, error)) {
+ return NULL;
+ }
+ return gda_connection_statement_execute_select (cnc, stmt, params, error);
}
/**
@@ -104,10 +112,11 @@ GdaDataModel *gda_provider_meta_execute_query (GdaProviderMeta *prov,
GdaRow*
gda_provider_meta_execute_query_row (GdaProviderMeta *prov,
const gchar *sql,
+ GdaSet *params,
GError **error)
{
GdaDataModel *model = NULL;
- model = gda_provider_meta_execute_query (prov, sql, error);
+ model = gda_provider_meta_execute_query (prov, sql, params, error);
if (model == NULL) {
return NULL;
}
diff --git a/libgda/gda-provider-meta.h b/libgda/gda-provider-meta.h
index 557c5bbe7..95b1fee7f 100644
--- a/libgda/gda-provider-meta.h
+++ b/libgda/gda-provider-meta.h
@@ -26,7 +26,8 @@
G_BEGIN_DECLS
typedef enum {
- GDA_PROVIDER_META_NO_CONNECTION_ERROR
+ GDA_PROVIDER_META_NO_CONNECTION_ERROR,
+ GDA_PROVIDER_META_QUERY_ERROR
} GdaProviderMetaError;
extern GQuark gda_provider_meta_error_quark (void);
@@ -238,10 +239,12 @@ struct _GdaProviderMetaInterface
GdaDataModel *gda_provider_meta_execute_query (GdaProviderMeta *prov,
const gchar *sql,
+ GdaSet *params,
GError **error);
GdaRow *gda_provider_meta_execute_query_row (GdaProviderMeta *prov,
const gchar *sql,
+ GdaSet *params,
GError **error);
GdaConnection *gda_provider_meta_get_connection (GdaProviderMeta *prov);
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index ec36fa1e3..54794e30b 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -385,6 +385,204 @@ static CollationFunction collation_functions[] = {
{"DCASE", dcase_collate_func}
};
+
+/* GdaProviderMeta methods declarations */
+static GdaDataModel *gda_sqlite_provider_meta_btypes (GdaProviderMeta *prov,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_udts (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_udt (GdaProviderMeta *prov,
+ const gchar *udt_catalog, const gchar *udt_schema,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_udt_cols (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_udt_col (GdaProviderMeta *prov,
+ const gchar *udt_catalog, const gchar *udt_schema,
+ const gchar *udt_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_enums_type (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_enum_type (GdaProviderMeta *prov,
+ const gchar *udt_catalog, const gchar *udt_schema, const gchar *udt_name,
GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_domains (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_domain (GdaProviderMeta *prov,
+ const gchar *domain_catalog, const gchar *domain_schema, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_domains_constraints (GdaProviderMeta *prov,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_domain_constraints (GdaProviderMeta *prov,
+ const gchar *domain_catalog, const gchar *domain_schema,
+ const gchar *domain_name, GError **error);
+static GdaRow *gda_sqlite_provider_meta_domain_constraint (GdaProviderMeta *prov,
+ const gchar *domain_catalog, const gchar *domain_schema,
+ const gchar *domain_name, const gchar *contraint_name,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_element_types (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_element_type (GdaProviderMeta *prov,
+ const gchar *specific_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_collations (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_collation (GdaProviderMeta *prov,
+ const gchar *collation_catalog, const gchar *collation_schema,
+ const gchar *collation_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_character_sets (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_character_set (GdaProviderMeta *prov,
+ const gchar *chset_catalog, const gchar *chset_schema,
+ const gchar *chset_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_schematas (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_schemata (GdaProviderMeta *prov,
+ const gchar *catalog_name, const gchar *schema_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_tables_views (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_table_view (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_columns (GdaProviderMeta *prov,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_table_columns (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name, GError **error);
+static GdaRow *gda_sqlite_provider_meta_table_column (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *column_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_views_cols (GdaProviderMeta *prov,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_view_cols (GdaProviderMeta *prov,
+ const gchar *view_catalog, const gchar *view_schema,
+ const gchar *view_name, GError **error);
+static GdaRow *gda_sqlite_provider_meta_view_col (GdaProviderMeta *prov,
+ const gchar *view_catalog, const gchar *view_schema,
+ const gchar *view_name,
+ const gchar *column_name,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_constraints_tables (GdaProviderMeta *prov, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_constraints_table (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_constraint_table (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *constraint_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_constraints_ref (GdaProviderMeta *prov,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_constraints_ref_table (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema, const gchar *table_name,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_constraint_ref (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema, const gchar *table_name,
+ const gchar *constraint_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_key_columns (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_key_column (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *constraint_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_check_columns (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_check_column (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *constraint_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_triggers (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_trigger (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_routines (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_routine (GdaProviderMeta *prov,
+ const gchar *routine_catalog, const gchar *routine_schema,
+ const gchar *routine_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_routines_col (GdaProviderMeta *prov, GError **error);
+static GdaRow *gda_sqlite_provider_meta_routine_col (GdaProviderMeta *prov,
+ const gchar *rout_catalog, const gchar *rout_schema,
+ const gchar *rout_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_routines_pars (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_routine_pars (GdaProviderMeta *prov,
+ const gchar *rout_catalog, const gchar *rout_schema,
+ const gchar *rout_name, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_indexes_tables (GdaProviderMeta *prov,
+ GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_indexes_table (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name, GError **error);
+static GdaRow *gda_sqlite_provider_meta_index_table (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *index_name_n, GError **error);
+static GdaDataModel *gda_sqlite_provider_meta_index_cols (GdaProviderMeta *prov,
+ GError **error);
+static GdaRow *gda_sqlite_provider_meta_index_col (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *index_name, GError **error);
+
+static void
+gda_sqlite_provider_mate_iface_init (GdaProviderMetaInterface *iface) {
+ iface->btypes = gda_sqlite_provider_meta_btypes;
+ iface->udts = gda_sqlite_provider_meta_udts;
+ iface->udt = gda_sqlite_provider_meta_udt;
+ iface->udt_cols = gda_sqlite_provider_meta_udt_cols;
+ iface->udt_col = gda_sqlite_provider_meta_udt_col;
+ iface->enums_type = gda_sqlite_provider_meta_enums_type;
+ iface->enum_type = gda_sqlite_provider_meta_enum_type;
+ iface->domains = gda_sqlite_provider_meta_domains;
+ iface->domain = gda_sqlite_provider_meta_domain;
+ iface->domains_constraints = gda_sqlite_provider_meta_domains_constraints;
+ iface->domain_constraints = gda_sqlite_provider_meta_domain_constraints;
+ iface->domain_constraint = gda_sqlite_provider_meta_domain_constraint;
+ iface->element_types = gda_sqlite_provider_meta_element_types;
+ iface->element_type = gda_sqlite_provider_meta_element_type;
+ iface->collations = gda_sqlite_provider_meta_collations;
+ iface->collation = gda_sqlite_provider_meta_collation;
+ iface->character_sets = gda_sqlite_provider_meta_character_sets;
+ iface->character_set = gda_sqlite_provider_meta_character_set;
+ iface->schematas = gda_sqlite_provider_meta_schematas;
+ iface->schemata = gda_sqlite_provider_meta_schemata;
+ iface->tables_views = gda_sqlite_provider_meta_tables_views;
+ iface->table_view = gda_sqlite_provider_meta_table_view;
+ iface->columns = gda_sqlite_provider_meta_columns;
+ iface->table_columns = gda_sqlite_provider_meta_table_columns;
+ iface->table_column = gda_sqlite_provider_meta_table_column;
+ iface->views_cols = gda_sqlite_provider_meta_views_cols;
+ iface->view_cols = gda_sqlite_provider_meta_view_cols;
+ iface->view_col = gda_sqlite_provider_meta_view_col;
+ iface->constraints_tables = gda_sqlite_provider_meta_constraints_tables;
+ iface->constraints_table = gda_sqlite_provider_meta_constraints_table;
+ iface->constraint_table = gda_sqlite_provider_meta_constraint_table;
+ iface->constraints_ref = gda_sqlite_provider_meta_constraints_ref;
+ iface->constraints_ref_table = gda_sqlite_provider_meta_constraints_ref_table;
+ iface->constraint_ref = gda_sqlite_provider_meta_constraint_ref;
+ iface->key_columns = gda_sqlite_provider_meta_key_columns;
+ iface->key_column = gda_sqlite_provider_meta_key_column;
+ iface->check_columns = gda_sqlite_provider_meta_check_columns;
+ iface->check_column = gda_sqlite_provider_meta_check_column;
+ iface->triggers = gda_sqlite_provider_meta_triggers;
+ iface->trigger = gda_sqlite_provider_meta_trigger;
+ iface->routines = gda_sqlite_provider_meta_routines;
+ iface->routine = gda_sqlite_provider_meta_routine;
+ iface->routines_col = gda_sqlite_provider_meta_routines_col;
+ iface->routine_col = gda_sqlite_provider_meta_routine_col;
+ iface->routines_pars = gda_sqlite_provider_meta_routines_pars;
+ iface->routine_pars = gda_sqlite_provider_meta_routine_pars;
+ iface->indexes_tables = gda_sqlite_provider_meta_indexes_tables;
+ iface->indexes_table = gda_sqlite_provider_meta_indexes_table;
+ iface->index_table = gda_sqlite_provider_meta_index_table;
+ iface->index_cols = gda_sqlite_provider_meta_index_cols;
+ iface->index_col = gda_sqlite_provider_meta_index_col;
+}
+
/*
* Prepared internal statements
*/
@@ -3997,3 +4195,480 @@ gda_sqlite_provider_unescape_string (G_GNUC_UNUSED GdaServerProvider *provider,
return retval;
}
+
+/* GdaProviderMeta implementations */
+
+static GdaDataModel*
+gda_sqlite_provider_meta_btypes (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_udts (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_udt (GdaProviderMeta *prov,
+ const gchar *udt_catalog, const gchar *udt_schema,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_udt_cols (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_udt_col (GdaProviderMeta *prov,
+ const gchar *udt_catalog, const gchar *udt_schema,
+ const gchar *udt_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_enums_type (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_enum_type (GdaProviderMeta *prov,
+ const gchar *udt_catalog,
+ const gchar *udt_schema, const gchar *udt_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_domains (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_domain (GdaProviderMeta *prov,
+ const gchar *domain_catalog, const gchar *domain_schema, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_domains_constraints (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_domain_constraints (GdaProviderMeta *prov,
+ const gchar *domain_catalog, const gchar *domain_schema,
+ const gchar *domain_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_domain_constraint (GdaProviderMeta *prov,
+ const gchar *domain_catalog, const gchar *domain_schema,
+ const gchar *domain_name, const gchar *contraint_name,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_element_types (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_element_type (GdaProviderMeta *prov,
+ const gchar *specific_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_collations (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_collation (GdaProviderMeta *prov,
+ const gchar *collation_catalog, const gchar *collation_schema,
+ const gchar *collation_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_character_sets (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_character_set (GdaProviderMeta *prov,
+ const gchar *chset_catalog, const gchar *chset_schema,
+ const gchar *chset_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_schematas (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_schemata (GdaProviderMeta *prov,
+ const gchar *catalog_name, const gchar *schema_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_tables_views (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+
+ return gda_provider_meta_execute_query (prov,
+ "SELECT name as 'Table', 'system' as 'Owner',"
+ " ' ' as 'Description', sql as 'Definition' "
+ "FROM (SELECT * FROM sqlite_master "
+ "UNION ALL SELECT * FROM sqlite_temp_master) "
+ "WHERE name not like 'sqlite_%%' ORDER BY name",
+ NULL, error);
+}
+static GdaRow*
+gda_sqlite_provider_meta_table_view (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ GdaRow *row;
+ GdaSet *params;
+
+ params = gda_set_new_inline (1, "name", G_TYPE_STRING, NULL);
+ gda_set_set_holder_value (params, error, "name", table_name_n, NULL);
+ if (*error != NULL) {
+ g_object_unref (params);
+ return NULL;
+ }
+
+ row = gda_provider_meta_execute_query_row (prov,
+ "SELECT name as 'Table', 'system' as 'Owner',"
+ " ' ' as 'Description', sql as 'Definition' "
+ "FROM (SELECT * FROM sqlite_master UNION ALL "
+ "SELECT * FROM sqlite_temp_master) "
+ "WHERE name = ##name::string name not like 'sqlite_%%' ORDER BY name",
+ params, error);
+ g_object_unref (params);
+ return row;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_columns (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_table_columns (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_table_column (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *column_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_views_cols (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_view_cols (GdaProviderMeta *prov,
+ const gchar *view_catalog, const gchar *view_schema,
+ const gchar *view_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_view_col (GdaProviderMeta *prov,
+ const gchar *view_catalog, const gchar *view_schema,
+ const gchar *view_name,
+ const gchar *column_name,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_constraints_tables (GdaProviderMeta *prov, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_constraints_table (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_constraint_table (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *constraint_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_constraints_ref (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_constraints_ref_table (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema, const gchar *table_name,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_constraint_ref (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema, const gchar *table_name,
+ const gchar *constraint_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_key_columns (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_key_column (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *constraint_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_check_columns (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_check_column (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *constraint_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_triggers (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_trigger (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_routines (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_routine (GdaProviderMeta *prov,
+ const gchar *routine_catalog, const gchar *routine_schema,
+ const gchar *routine_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_routines_col (GdaProviderMeta *prov, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_routine_col (GdaProviderMeta *prov,
+ const gchar *rout_catalog, const gchar *rout_schema,
+ const gchar *rout_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_routines_pars (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_routine_pars (GdaProviderMeta *prov,
+ const gchar *rout_catalog, const gchar *rout_schema,
+ const gchar *rout_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_indexes_tables (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_indexes_table (GdaProviderMeta *prov,
+ const gchar *table_catalog, const gchar *table_schema,
+ const gchar *table_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_index_table (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *index_name_n, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaDataModel*
+gda_sqlite_provider_meta_index_cols (GdaProviderMeta *prov,
+ GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+static GdaRow*
+gda_sqlite_provider_meta_index_col (GdaProviderMeta *prov,
+ const gchar *table_catalog,
+ const gchar *table_schema,
+ const gchar *table_name,
+ const gchar *index_name, GError **error)
+{
+ g_return_val_if_fail (prov, NULL);
+ g_return_val_if_fail (GDA_IS_PROVIDER_META (prov), NULL);
+ return NULL;
+}
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]