QOF
0.8.6
|
QOF client-side SQL parser - interfaces with libgda. More...
#include "config.h"
#include <stdlib.h>
#include <errno.h>
#include <glib.h>
#include <libintl.h>
#include "sql_parser.h"
#include <time.h>
#include "qof.h"
#include "qofsql-p.h"
#include "qofquery-p.h"
Go to the source code of this file.
Macros | |
#define | _(String) dgettext (GETTEXT_PACKAGE, String) |
#define | QSQL_KVP_TABLE "sql_kvp" |
#define | END_DB_VERSION " dbversion int );" |
Typedefs | |
typedef struct ent_and_string | eas |
Functions | |
QofSqlQuery * | qof_sql_query_new (void) |
void | qof_sql_query_destroy (QofSqlQuery *q) |
QofQuery * | qof_sql_query_get_query (QofSqlQuery *q) |
void | qof_sql_query_set_book (QofSqlQuery *q, QofBook *book) |
void | qof_sql_query_set_kvp (QofSqlQuery *q, KvpFrame *kvp) |
static void | get_table_and_param (char *str, char **tab, char **param) |
static char * | dequote_string (char *str) |
static QofQuery * | handle_single_condition (QofSqlQuery *query, sql_condition *cond) |
static QofQuery * | handle_where (QofSqlQuery *query, sql_where *swear) |
static void | handle_sort_order (QofSqlQuery *query, GList *sorder_list) |
static void | qof_sql_insertCB (const QofParam *param, const gchar *insert_string, QofSqlQuery *query) |
static void | qof_query_set_insert_table (QofSqlQuery *query) |
static QofEntity * | qof_query_insert (QofSqlQuery *query) |
static const char * | sql_type_as_string (sql_statement_type type) |
void | qof_sql_query_parse (QofSqlQuery *query, const char *str) |
GList * | qof_sql_query_run (QofSqlQuery *query, const char *str) |
GList * | qof_sql_query_rerun (QofSqlQuery *query) |
static void | create_sql_from_param_cb (QofParam *param, gpointer user_data) |
static gchar * | string_param_to_sql (QofParam *param) |
static void | string_param_foreach (QofParam *param, gpointer user_data) |
static void | create_param_list (QofParam *param, gpointer user_data) |
list just the parameter names | |
static void | kvpvalue_to_sql_insert (const gchar *key, KvpValue *val, gpointer user_data) |
static void | kvpvalue_to_sql_update (const gchar *key, KvpValue *val, gpointer user_data) |
gchar * | qof_sql_object_create_table (QofObject *obj) |
Build a SQL 'CREATE' statement for this object. | |
gchar * | qof_sql_entity_create_table (QofEntity *ent) |
Build a SQL 'CREATE' statement for this entity. | |
gchar * | qof_sql_entity_insert (QofEntity *ent) |
Build a SQL 'INSERT' statement for this entity. | |
static void | collect_kvp (QofEntity *ent, gpointer user_data) |
gchar * | qof_sql_entity_update (QofEntity *ent) |
Build a SQL 'UPDATE' statement for the current entity parameter. | |
gchar * | qof_sql_entity_update_kvp (QofEntity *ent) |
Build a SQL 'UPDATE' statement for the KVP data in this entity. | |
gchar * | qof_sql_entity_update_list (QofEntity *ent, GList **params) |
Build a SQL 'UPDATE' statement for a list of parameters. | |
gchar * | qof_sql_entity_delete (QofEntity *ent) |
Build a SQL 'DELETE' statement for this entity. | |
gchar * | qof_sql_entity_drop_table (QofEntity *ent) |
Build a SQL 'DROP' statement for this entity type. | |
void | qof_sql_entity_set_kvp_tablename (const gchar *name) |
Set a default KVP table name for each backend. | |
void | qof_sql_entity_set_kvp_id (gulong id) |
Set the initial index value of the KVP table. | |
gulong | qof_sql_entity_get_kvp_id (void) |
Get the index value of the KVP table after the operation(s). | |
void | qof_sql_entity_set_kvp_exists (gboolean exist) |
Set or clear a flag that the KVP table exists or not. |
Variables | |
static gchar * | kvp_table_name = NULL |
static QofLogModule | log_module = "qof-query" |
static gulong | kvp_id = 0 |
static gboolean | kvp_table_exists = FALSE |
QOF client-side SQL parser - interfaces with libgda.
Intended to parse incoming SQL into QOF queries (SELECT or INSERT) and prepare SQL commands from QOF entities (CREATE, UPDATE, INSERT, DELETE and DROP) for use in SQL-based backends.
Definition in file qofsql.c.
typedef struct ent_and_string eas |
simple helper struct for passing between SQL-generating functions
|
static |
list just the parameter names
Definition at line 1220 of file qofsql.c.
|
static |
returns the VALUES for INSERT in pre-defined order
Definition at line 1252 of file qofsql.c.
|
static |
returns the VALUES for UPDATE in pre-defined order
Definition at line 1300 of file qofsql.c.
|
static |
Definition at line 1134 of file qofsql.c.