GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
gnc-backend-sql.c File Reference

load and save data to SQL More...

#include <stdlib.h>
#include "config.h"
#include <errno.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include "qof.h"
#include "qofquery-p.h"
#include "qofquerycore-p.h"
#include "Account.h"
#include "TransLog.h"
#include "gnc-engine.h"
#include "SX-book.h"
#include "Recurrence.h"
#include "gncBillTerm.h"
#include "gncTaxTable.h"
#include "gncInvoice.h"
#include "gnc-backend-sql.h"
#include "gnc-account-sql.h"
#include "gnc-book-sql.h"
#include "gnc-budget-sql.h"
#include "gnc-commodity-sql.h"
#include "gnc-lots-sql.h"
#include "gnc-price-sql.h"
#include "gnc-pricedb.h"
#include "gnc-recurrence-sql.h"
#include "gnc-schedxaction-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-transaction-sql.h"
#include "gnc-address-sql.h"
#include "gnc-bill-term-sql.h"
#include "gnc-customer-sql.h"
#include "gnc-employee-sql.h"
#include "gnc-entry-sql.h"
#include "gnc-invoice-sql.h"
#include "gnc-job-sql.h"
#include "gnc-order-sql.h"
#include "gnc-owner-sql.h"
#include "gnc-tax-table-sql.h"
#include "gnc-vendor-sql.h"
#include "gnc-prefs.h"

Go to the source code of this file.

Data Structures

struct  gnc_sql_query_info
 
struct  sql_backend
 

Macros

#define TRANSACTION_NAME   "trans"
 
#define SQLITE_PROVIDER_NAME   "SQLite"
 
#define TIMESPEC_STR_FORMAT   "%04d%02d%02d%02d%02d%02d"
 
#define TIMESPEC_COL_SIZE   (4+2+2+2+2+2)
 
#define DATE_COL_SIZE   8
 
#define VERSION_TABLE_NAME   "versions"
 
#define MAX_TABLE_NAME_LEN   50
 
#define TABLE_COL_NAME   "table_name"
 
#define VERSION_COL_NAME   "table_version"
 

Typedefs

typedef gint(* IntAccessFunc )(const gpointer)
 
typedef void(* IntSetterFunc )(const gpointer, gint)
 
typedef gboolean(* BooleanAccessFunc )(const gpointer)
 
typedef void(* BooleanSetterFunc )(const gpointer, gboolean)
 
typedef gint64(* Int64AccessFunc )(const gpointer)
 
typedef void(* Int64SetterFunc )(const gpointer, gint64)
 
typedef Timespec(* TimespecAccessFunc )(const gpointer)
 
typedef void(* TimespecSetterFunc )(const gpointer, Timespec)
 
typedef gnc_numeric(* NumericGetterFunc )(const gpointer)
 
typedef void(* NumericSetterFunc )(gpointer, gnc_numeric)
 

Functions

void gnc_sql_init (GncSqlBackend *be)
 
void gnc_sql_set_load_order (const gchar **load_order)
 
void gnc_sql_push_commodity_for_postload_processing (GncSqlBackend *be, gpointer *comm)
 
void gnc_sql_load (GncSqlBackend *be, QofBook *book, QofBackendLoadType loadType)
 
void gnc_sql_sync_all (GncSqlBackend *be, QofBook *book)
 
void gnc_sql_begin_edit (GncSqlBackend *be, QofInstance *inst)
 
void gnc_sql_rollback_edit (GncSqlBackend *be, QofInstance *inst)
 
void gnc_sql_commit_edit (GncSqlBackend *be, QofInstance *inst)
 
gchar * gnc_sql_compile_query_to_sql (GncSqlBackend *be, QofQuery *query)
 
gpointer gnc_sql_compile_query (QofBackend *pBEnd, QofQuery *pQuery)
 
void gnc_sql_free_query (QofBackend *pBEnd, gpointer pQuery)
 
void gnc_sql_run_query (QofBackend *pBEnd, gpointer pQuery)
 
gint64 gnc_sql_get_integer_value (const GValue *value)
 
QofAccessFunc gnc_sql_get_getter (QofIdTypeConst obj_name, const GncSqlColumnTableEntry *table_row)
 
void gnc_sql_add_colname_to_list (const GncSqlColumnTableEntry *table_row, GList **pList)
 
void gnc_sql_add_subtable_colnames_to_list (const GncSqlColumnTableEntry *table_row, const GncSqlColumnTableEntry *subtable, GList **pList)
 
void gnc_sql_add_gvalue_objectref_guid_to_slist (const GncSqlBackend *be, QofIdTypeConst obj_name, const gpointer pObject, const GncSqlColumnTableEntry *table_row, GSList **pList)
 
void gnc_sql_add_objectref_guid_col_info_to_list (const GncSqlBackend *be, const GncSqlColumnTableEntry *table_row, GList **pList)
 
gchar * gnc_sql_convert_timespec_to_string (const GncSqlBackend *be, Timespec ts)
 
void gnc_sql_register_col_type_handler (const gchar *colType, const GncSqlColumnTypeHandler *handler)
 
void _retrieve_guid_ (gpointer pObject, gpointer pValue)
 
const GncGUIDgnc_sql_load_guid (const GncSqlBackend *be, GncSqlRow *row)
 
const GncGUIDgnc_sql_load_tx_guid (const GncSqlBackend *be, GncSqlRow *row)
 
void gnc_sql_load_object (const GncSqlBackend *be, GncSqlRow *row, QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry *table)
 
GncSqlStatementgnc_sql_create_select_statement (GncSqlBackend *be, const gchar *table_name)
 
GncSqlResultgnc_sql_execute_select_statement (GncSqlBackend *be, GncSqlStatement *stmt)
 
GncSqlStatementgnc_sql_create_statement_from_sql (GncSqlBackend *be, const gchar *sql)
 
GncSqlResultgnc_sql_execute_select_sql (GncSqlBackend *be, const gchar *sql)
 
gint gnc_sql_execute_nonselect_sql (GncSqlBackend *be, const gchar *sql)
 
guint gnc_sql_append_guid_list_to_sql (GString *sql, GList *list, guint maxCount)
 
gboolean gnc_sql_object_is_it_in_db (GncSqlBackend *be, const gchar *table_name, QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry *table)
 
gboolean gnc_sql_do_db_operation (GncSqlBackend *be, E_DB_OPERATION op, const gchar *table_name, QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry *table)
 
gchar * gnc_sql_get_sql_value (const GncSqlConnection *conn, const GValue *value)
 
gboolean gnc_sql_commit_standard_item (GncSqlBackend *be, QofInstance *inst, const gchar *tableName, QofIdTypeConst obj_name, const GncSqlColumnTableEntry *col_table)
 
gboolean gnc_sql_create_table (GncSqlBackend *be, const gchar *table_name, gint table_version, const GncSqlColumnTableEntry *col_table)
 
gboolean gnc_sql_create_temp_table (const GncSqlBackend *be, const gchar *table_name, const GncSqlColumnTableEntry *col_table)
 
gboolean gnc_sql_create_index (const GncSqlBackend *be, const gchar *index_name, const gchar *table_name, const GncSqlColumnTableEntry *col_table)
 
gint gnc_sql_get_table_version (const GncSqlBackend *be, const gchar *table_name)
 
void gnc_sql_upgrade_table (GncSqlBackend *be, const gchar *table_name, const GncSqlColumnTableEntry *col_table)
 
gboolean gnc_sql_add_columns_to_table (GncSqlBackend *be, const gchar *table_name, const GncSqlColumnTableEntry *new_col_table)
 
void gnc_sql_init_version_info (GncSqlBackend *be)
 
void gnc_sql_finalize_version_info (GncSqlBackend *be)
 
gboolean gnc_sql_set_table_version (GncSqlBackend *be, const gchar *table_name, gint version)
 

Detailed Description

load and save data to SQL

Author
Copyright (c) 2006-2008 Phil Longstaff plong.nosp@m.staf.nosp@m.f@rog.nosp@m.ers..nosp@m.com

This file implements the top-level QofBackend API for saving/ restoring data to/from an SQL db

Definition in file gnc-backend-sql.c.