diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-08 02:54:07 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-08 03:24:08 +0100 |
| commit | 882ac228dc561c2eac588e424c7449176021b392 (patch) | |
| tree | 4042c6297e0b93126f732f5f34d47e6189f113b2 /database/sqlite/sqlite.h | |
| parent | 728053f727acc080a01c8b34ddb21ca740e926e7 (diff) | |
| download | eurephia-882ac228dc561c2eac588e424c7449176021b392.tar.gz eurephia-882ac228dc561c2eac588e424c7449176021b392.tar.xz eurephia-882ac228dc561c2eac588e424c7449176021b392.zip | |
Update field mapping to include data type. Improved sqlite_query_mapped(...) function
The new sqlite_query_mapped(...) function will now consider the field
type when formatting the data values for SQLite. In addition reserved
words on the DATETIME data type will be preserved without quote
encapsulation.
Improved the sqlite_query_mapped(...) to also handle UPDATE, INSERT and
DELETE in addition to SELECT. The function now needs two eDBfieldMap
mappings. The first one will contain update/insert values, while the
last one defines search criteria.
Diffstat (limited to 'database/sqlite/sqlite.h')
| -rw-r--r-- | database/sqlite/sqlite.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/database/sqlite/sqlite.h b/database/sqlite/sqlite.h index 2898c53..3dfe058 100644 --- a/database/sqlite/sqlite.h +++ b/database/sqlite/sqlite.h @@ -60,11 +60,14 @@ typedef struct __sqlite_dbresult { _sqlite_header *srch_headerrec; } dbresult; +typedef enum _SQLqueryType { SQL_SELECT, SQL_INSERT, SQL_UPDATE, SQL_DELETE } SQLqueryType; + #ifndef SQLITE_C #define sqlite_free_results(r) { _sqlite_free_results(r); r = NULL; } void _sqlite_free_results(dbresult *); dbresult *sqlite_query(eurephiaCTX *ctx, const char *, ...); -dbresult *sqlite_query_mapped(eurephiaCTX *, char *, eDBfieldMap *); +dbresult *sqlite_query_mapped(eurephiaCTX *ctx, SQLqueryType type, const char *sqlstub, + eDBfieldMap *valMap, eDBfieldMap *whereMap); char *sqlite_get_value(dbresult *res, int, int); void sqlite_dump_result(FILE *, dbresult *); int sqlite_get_numtuples(dbresult *); |
