]> err.no Git - sope/blob - sope-gdl1/SQLite3/README
fixed gcc 4.0 warnings
[sope] / sope-gdl1 / SQLite3 / README
1 # SQLite3 Adaptor
2
3 Note: this is far from being complete! The adaptor is currently a fork of
4       the PostgreSQL adaptor.
5
6 TODO
7 ====
8 - check EOAttribute+SQLite:
9   -loadValueClassAndTypeUsingSQLiteType:...
10 - SQLiteChannel.m:
11   -primaryFetchAttributes => check field name processing
12 - rewrite for exception less operation
13 - implement more methods in SQLiteChannel+Model (hard with SQLite though)
14
15 Basics
16 ======
17
18 Open a Shell:
19
20   sqlite3 OGo
21   > insert schema
22   > select * from date_x;
23
24 Configure the Adaptor (below does not work yet for SQLite3!)
25
26   Defaults write ogo-webui-1.0a LSAdaptor SQLite3
27
28   Defaults write ogo-webui-1.0a LSConnectionDictionary \
29         '{ databaseName = OGo; }'
30
31   Defaults write ogo-webui-1.0a PKeyGeneratorDictionary \
32         "{ newKeyExpression=\"select nextval(\\'key_generator\\');\" }"
33
34   SQLiteDebugEnabled
35
36
37 Setup gdltest Database
38 ======================
39 sqlite3 Test.sqldb 
40 sqlite> CREATE TABLE my_table ( pkey INT PRIMARY KEY );
41
42
43
44 Sequential execution
45 ====================
46 http://www.hwaci.com/sw/sqlite/c_interface.html
47
48 ---snip---
49 typedef struct sqlite_vm sqlite_vm;
50
51 int sqlite_compile(
52   sqlite *db,              /* The open database */
53   const char *zSql,        /* SQL statement to be compiled */
54   const char **pzTail,     /* OUT: uncompiled tail of zSql */
55   sqlite_vm **ppVm,        /* OUT: the virtual machine to execute zSql */
56   char **pzErrmsg          /* OUT: Error message. */
57 );
58
59 int sqlite_step(
60   sqlite_vm *pVm,          /* The virtual machine to execute */
61   int *pN,                 /* OUT: Number of columns in result */
62   const char ***pazValue,  /* OUT: Column data */
63   const char ***pazColName /* OUT: Column names and datatypes */
64 );
65
66 int sqlite_finalize(
67   sqlite_vm *pVm,          /* The virtual machine to be finalized */
68   char **pzErrMsg          /* OUT: Error message */
69 );
70 ---snap---
71
72
73 Error-Codes
74 ===========
75
76 ---snip---
77 #define SQLITE_OK           0   /* Successful result */
78 #define SQLITE_ERROR        1   /* SQL error or missing database */
79 #define SQLITE_INTERNAL     2   /* An internal logic error in SQLite */
80 #define SQLITE_PERM         3   /* Access permission denied */
81 #define SQLITE_ABORT        4   /* Callback routine requested an abort */
82 #define SQLITE_BUSY         5   /* The database file is locked */
83 #define SQLITE_LOCKED       6   /* A table in the database is locked */
84 #define SQLITE_NOMEM        7   /* A malloc() failed */
85 #define SQLITE_READONLY     8   /* Attempt to write a readonly database */
86 #define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite_interrupt() */
87 #define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
88 #define SQLITE_CORRUPT     11   /* The database disk image is malformed */
89 #define SQLITE_NOTFOUND    12   /* (Internal Only) Table or record not found */
90 #define SQLITE_FULL        13   /* Insertion failed because database is full */
91 #define SQLITE_CANTOPEN    14   /* Unable to open the database file */
92 #define SQLITE_PROTOCOL    15   /* Database lock protocol error */
93 #define SQLITE_EMPTY       16   /* (Internal Only) Database table is empty */
94 #define SQLITE_SCHEMA      17   /* The database schema changed */
95 #define SQLITE_TOOBIG      18   /* Too much data for one row of a table */
96 #define SQLITE_CONSTRAINT  19   /* Abort due to contraint violation */
97 #define SQLITE_MISMATCH    20   /* Data type mismatch */
98 #define SQLITE_MISUSE      21   /* Library used incorrectly */
99 #define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
100 #define SQLITE_AUTH        23   /* Authorization denied */
101 #define SQLITE_ROW         100  /* sqlite_step() has another row ready */
102 #define SQLITE_DONE        101  /* sqlite_step() has finished executing */
103 ---snap---