summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontactaccessbackend_sql.cpp
Unidiff
Diffstat (limited to 'libopie/pim/ocontactaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_sql.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie/pim/ocontactaccessbackend_sql.cpp b/libopie/pim/ocontactaccessbackend_sql.cpp
index a5be4c8..d20df56 100644
--- a/libopie/pim/ocontactaccessbackend_sql.cpp
+++ b/libopie/pim/ocontactaccessbackend_sql.cpp
@@ -1,84 +1,87 @@
1/* 1/*
2 * SQL Backend for the OPIE-Contact Database. 2 * SQL Backend for the OPIE-Contact Database.
3 * 3 *
4 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) 4 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
5 * 5 *
6 * ===================================================================== 6 * =====================================================================
7 *This program is free software; you can redistribute it and/or 7 *This program is free software; you can redistribute it and/or
8 *modify it under the terms of the GNU Library General Public 8 *modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
11 * ===================================================================== 11 * =====================================================================
12 * ===================================================================== 12 * =====================================================================
13 * Version: $Id$ 13 * Version: $Id$
14 * ===================================================================== 14 * =====================================================================
15 * History: 15 * History:
16 * $Log$ 16 * $Log$
17 * Revision 1.5 2004/03/14 13:50:35 alwin
18 * namespace correction
19 *
17 * Revision 1.4 2003/12/22 10:19:26 eilers 20 * Revision 1.4 2003/12/22 10:19:26 eilers
18 * Finishing implementation of sql-backend for datebook. But I have to 21 * Finishing implementation of sql-backend for datebook. But I have to
19 * port the PIM datebook application to use it, before I could debug the 22 * port the PIM datebook application to use it, before I could debug the
20 * whole stuff. 23 * whole stuff.
21 * Thus, PIM-Database backend is finished, but highly experimental. And some 24 * Thus, PIM-Database backend is finished, but highly experimental. And some
22 * parts are still generic. For instance, the "queryByExample()" methods are 25 * parts are still generic. For instance, the "queryByExample()" methods are
23 * not (or not fully) implemented. Todo: custom-entries not stored. 26 * not (or not fully) implemented. Todo: custom-entries not stored.
24 * The big show stopper: matchRegExp() (needed by OpieSearch) needs regular 27 * The big show stopper: matchRegExp() (needed by OpieSearch) needs regular
25 * expression search in the database, which is not supported by sqlite ! 28 * expression search in the database, which is not supported by sqlite !
26 * Therefore we need either an extended sqlite or a workaround which would 29 * Therefore we need either an extended sqlite or a workaround which would
27 * be very slow and memory consuming.. 30 * be very slow and memory consuming..
28 * 31 *
29 * Revision 1.3 2003/12/08 15:18:10 eilers 32 * Revision 1.3 2003/12/08 15:18:10 eilers
30 * Committing unfinished sql implementation before merging to libopie2 starts.. 33 * Committing unfinished sql implementation before merging to libopie2 starts..
31 * 34 *
32 * Revision 1.2 2003/09/29 07:44:26 eilers 35 * Revision 1.2 2003/09/29 07:44:26 eilers
33 * Improvement of PIM-SQL Databases, but search queries are still limited. 36 * Improvement of PIM-SQL Databases, but search queries are still limited.
34 * Addressbook: Changed table layout. Now, we just need 1/3 of disk-space. 37 * Addressbook: Changed table layout. Now, we just need 1/3 of disk-space.
35 * Todo: Started to add new attributes. Some type conversions missing. 38 * Todo: Started to add new attributes. Some type conversions missing.
36 * 39 *
37 * Revision 1.1 2003/09/22 14:31:16 eilers 40 * Revision 1.1 2003/09/22 14:31:16 eilers
38 * Added first experimental incarnation of sql-backend for addressbook. 41 * Added first experimental incarnation of sql-backend for addressbook.
39 * Some modifications to be able to compile the todo sql-backend. 42 * Some modifications to be able to compile the todo sql-backend.
40 * A lot of changes fill follow... 43 * A lot of changes fill follow...
41 * 44 *
42 */ 45 */
43 46
44#include "ocontactaccessbackend_sql.h" 47#include "ocontactaccessbackend_sql.h"
45 48
46#include <qarray.h> 49#include <qarray.h>
47#include <qdatetime.h> 50#include <qdatetime.h>
48#include <qstringlist.h> 51#include <qstringlist.h>
49 52
50#include <qpe/global.h> 53#include <qpe/global.h>
51#include <qpe/recordfields.h> 54#include <qpe/recordfields.h>
52 55
53#include <opie/ocontactfields.h> 56#include <opie/ocontactfields.h>
54#include <opie/oconversion.h> 57#include <opie/oconversion.h>
55#include <opie2/osqldriver.h> 58#include <opie2/osqldriver.h>
56#include <opie2/osqlresult.h> 59#include <opie2/osqlresult.h>
57#include <opie2/osqlmanager.h> 60#include <opie2/osqlmanager.h>
58#include <opie2/osqlquery.h> 61#include <opie2/osqlquery.h>
59 62
60 63using namespace Opie::DB;
61 64
62 65
63// If defined, we use a horizontal table ( uid, attr1, attr2, attr3, ..., attrn ) instead 66// If defined, we use a horizontal table ( uid, attr1, attr2, attr3, ..., attrn ) instead
64// vertical like "uid, type, value". 67// vertical like "uid, type, value".
65// DON'T DEACTIVATE THIS DEFINE IN PRODUCTIVE ENVIRONMENTS !! 68// DON'T DEACTIVATE THIS DEFINE IN PRODUCTIVE ENVIRONMENTS !!
66#define __STORE_HORIZONTAL_ 69#define __STORE_HORIZONTAL_
67 70
68// Distinct loading is not very fast. If I expect that every person has just 71// Distinct loading is not very fast. If I expect that every person has just
69// one (and always one) 'Last Name', I can request all uid's for existing lastnames, 72// one (and always one) 'Last Name', I can request all uid's for existing lastnames,
70// which is faster.. 73// which is faster..
71// But this may not be true for all entries, like company contacts.. 74// But this may not be true for all entries, like company contacts..
72// The current AddressBook application handles this problem, but other may not.. (eilers) 75// The current AddressBook application handles this problem, but other may not.. (eilers)
73#define __USE_SUPERFAST_LOADQUERY 76#define __USE_SUPERFAST_LOADQUERY
74 77
75 78
76/* 79/*
77 * Implementation of used query types 80 * Implementation of used query types
78 * CREATE query 81 * CREATE query
79 * LOAD query 82 * LOAD query
80 * INSERT 83 * INSERT
81 * REMOVE 84 * REMOVE
82 * CLEAR 85 * CLEAR
83 */ 86 */
84namespace { 87namespace {