19 #ifndef JULEA_DB_UTIL_SQL_GENERIC_INTERNAL_H
20 #define JULEA_DB_UTIL_SQL_GENERIC_INTERNAL_H
45 #define BACKEND_ID_TYPE J_DB_TYPE_UINT64
86 const gchar*
namespace;
206 gboolean
_backend_schema_get(gpointer backend_data, gchar
const*
namespace, gchar
const* name, bson_t* schema, GError** error);
222 GHashTable*
get_schema(gpointer backend_data, gchar
const*
namespace, gchar
const* name, GError** error);
249 gboolean
bind_selector_query(gpointer backend_data,
const gchar*
namespace, bson_iter_t* iter,
JSqlStatement* statement, GHashTable* schema, GError** error);
266 gboolean
_backend_query_ids(gpointer backend_data, gpointer _batch, gchar
const* name, bson_t
const* selector, GArray** matches, GError** error);
JDBSelectorMode
Definition: jdb-selector.h:35
GPrivate thread_variables_global
Holds a thread-private pointer to JThreadVariables.
Definition: sql-generic-common.c:24
gboolean _backend_batch_abort(gpointer backend_data, JSqlBatch *batch, GError **error)
Abort a batch. Triggers a rollback in the DB backend.
Definition: sql-generic-tcl.c:80
gboolean _backend_batch_start(gpointer backend_data, JSqlBatch *batch, GError **error)
Start a batch. Starts a transaction in the DB backend.
Definition: sql-generic-tcl.c:25
JSqlStatement * j_sql_statement_new(gchar const *query, GArray *types_in, GArray *types_out, GHashTable *out_variables_index, GHashTable *variable_types, GError **error)
Construct a JSqlStatement struct from the necessary information.
Definition: sql-generic-common.c:139
GHashTable * get_schema(gpointer backend_data, gchar const *namespace, gchar const *name, GError **error)
Get the schema as a HashTable for internal usage.
Definition: sql-generic-dql.c:176
gboolean build_query_condition_part(gpointer backend_data, JSqlBatch *batch, bson_iter_t *iter, GString *sql, JDBSelectorMode mode, GArray *arr_types_in, GHashTable *schema, GError **error)
Build the WHERE part of a SELECT statement from a selector.
Definition: sql-generic-dql.c:306
JThreadVariables * thread_variables_get(gpointer backend_data, GError **error)
Retrieve the thread-private JThreadVariables.
Definition: sql-generic-common.c:103
gboolean bind_selector_query(gpointer backend_data, const gchar *namespace, bson_iter_t *iter, JSqlStatement *statement, GHashTable *schema, GError **error)
Bind the variables in the WHERE part of a SELECT statement.
Definition: sql-generic-dql.c:597
JSQLSpecifics * specs
Contains the specific string constants and functions for a DB backend.
Definition: sql-generic-common.c:25
void thread_variables_fini(void *ptr)
Free function for JThreadVariables.
Definition: sql-generic-common.c:73
GString * j_sql_get_full_field_name(const gchar *namespace, const gchar *table, const gchar *field)
Get the full field name from the different parts.
Definition: sql-generic-common.c:215
void j_sql_statement_free(JSqlStatement *ptr)
Destructor for a JSqlStatement.
Definition: sql-generic-common.c:175
gboolean _backend_schema_get(gpointer backend_data, gchar const *namespace, gchar const *name, bson_t *schema, GError **error)
Retrieve the schema as bson document.
Definition: sql-generic-dql.c:26
G_LOCK_EXTERN(sql_backend_lock)
Starting a batch requires locking if the DB backend does not support concurrent accesses.
gboolean _backend_batch_execute(gpointer backend_data, JSqlBatch *batch, GError **error)
Execute a batch. Commits a transaction in the DB backend.
Definition: sql-generic-tcl.c:53
gboolean _backend_query_ids(gpointer backend_data, gpointer _batch, gchar const *name, bson_t const *selector, GArray **matches, GError **error)
Query the IDs of rows that match a selector.
Definition: sql-generic-dql.c:826
Definition: sql-generic.h:31
Definition: jsemantics.c:42
Manages the status of a batch.
Definition: sql-generic-internal.h:84
gboolean open
TRUE if the batch is open.
Definition: sql-generic-internal.h:92
JSemantics * semantics
The namespace of the operations inside the batch.
Definition: sql-generic-internal.h:86
gboolean aborted
TRUE if there was an error and the batch was aborted.
Definition: sql-generic-internal.h:95
The JSqlStatement wraps a DB backend-specific prepared statement.
Definition: sql-generic-internal.h:106
GHashTable * out_variables_index
Indices of the output variables (i.e., columns).
Definition: sql-generic-internal.h:116
gpointer stmt
The prepared statement of a DB backend.
Definition: sql-generic-internal.h:108
GHashTable * variable_types
Types of the variables contained in the query.
Definition: sql-generic-internal.h:124
The JThreadVariables struct bundles the thread-local DB connection, the query cache and the schema ca...
Definition: sql-generic-internal.h:51
GHashTable * schema_cache
Cache for schemas.
Definition: sql-generic-internal.h:72
GHashTable * query_cache
Cache for prepared statements.
Definition: sql-generic-internal.h:62
gpointer db_connection
The backend-specific database connection handle.
Definition: sql-generic-internal.h:53