summaryrefslogtreecommitdiffstats
path: root/database/sqlite/fieldmapping.h
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-12-08 02:54:07 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-12-08 03:24:08 +0100
commit882ac228dc561c2eac588e424c7449176021b392 (patch)
tree4042c6297e0b93126f732f5f34d47e6189f113b2 /database/sqlite/fieldmapping.h
parent728053f727acc080a01c8b34ddb21ca740e926e7 (diff)
downloadeurephia-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/fieldmapping.h')
-rw-r--r--database/sqlite/fieldmapping.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/database/sqlite/fieldmapping.h b/database/sqlite/fieldmapping.h
index 3037f3d..7f06318 100644
--- a/database/sqlite/fieldmapping.h
+++ b/database/sqlite/fieldmapping.h
@@ -23,13 +23,13 @@
# define FIELDMAPPING_H_
static eDBfieldMap tbl_sqlite_users[] = {
- {TABLE_USERS, FIELD_RECID, "uid", NULL, NULL},
- {TABLE_USERS, FIELD_UNAME, "username", NULL, NULL},
- {TABLE_USERS, FIELD_PASSWD, "password", NULL, NULL},
- {TABLE_USERS, FIELD_ACTIVATED, "activated", NULL, NULL},
- {TABLE_USERS, FIELD_DEACTIVATED, "deactivated", NULL, NULL},
- {TABLE_USERS, FIELD_LASTACCESS, "last_accessed", NULL, NULL},
- {TABLE_USERS, FIELD_NONE, NULL, NULL, NULL}
+ {TABLE_USERS, FIELD_RECID, ft_INT, "uid", NULL, NULL},
+ {TABLE_USERS, FIELD_UNAME, ft_STRING, "username", NULL, NULL},
+ {TABLE_USERS, FIELD_PASSWD, ft_PASSWD, "password", NULL, NULL},
+ {TABLE_USERS, FIELD_ACTIVATED, ft_DATETIME, "activated", NULL, NULL},
+ {TABLE_USERS, FIELD_DEACTIVATED, ft_DATETIME, "deactivated", NULL, NULL},
+ {TABLE_USERS, FIELD_LASTACCESS, ft_DATETIME, "last_accessed", NULL, NULL},
+ {TABLE_USERS, FIELD_NONE, ft_UNDEF, NULL, NULL, NULL}
};
#endif /* !FIELDMAPPING_H_ */