Home » U++ Library support » U++ SQL » Updated Sqlite3 plugin
Updated Sqlite3 plugin [message #4140] |
Tue, 25 July 2006 10:07 |
aroman
Messages: 18 Registered: November 2005
|
Promising Member |
|
|
EDIT: PLEASE NOTE THAT DATABASES CREATED WITH THIS VERSION ARE NOT COMPATIBLE WITH THE PREVIOUS VERSION!! See the sqlite homepage for details.
Sorry for the delayed response. Here is the code necessary to update the sqlite3 plugin to the newest version:
- Download the newest version, 3.3.6, from the sqlite homepage. In particular, you want the fully preprocessed source code:
http://www.sqlite.org/sqlite-source-3_3_6.zip
- Delete all files in
uppsrc/plugin/sqlite3/lib/*
Then unzip the new source files into that directory.
- Apply the following patch to
uppsrc/plugin/sqlite3/sqlite3.upp Patch:
Index: C:/Research/upp/uppsrc/plugin/sqlite3/sqlite3.upp
===================================================================
--- C:/Research/upp/uppsrc/plugin/sqlite3/sqlite3.upp (revision 29)
+++ C:/Research/upp/uppsrc/plugin/sqlite3/sqlite3.upp (working copy)
@@ -30,12 +30,12 @@
lib/main.c,
lib/opcodes.c,
lib/opcodes.h,
+ lib/os.c,
lib/os.h,
lib/os_common.h,
+ lib/os_os2.c,
lib/os_unix.c,
- lib/os_unix.h,
lib/os_win.c,
- lib/os_win.h,
lib/pager.c,
lib/pager.h,
lib/parse.c,
That is, add os.c and os_os2.c, remove os_unix.h and os_win.h.
It should compile without errors.
- Augusto
[Updated on: Tue, 25 July 2006 10:31] Report message to a moderator
|
|
|
Re: Updated Sqlite3 plugin [message #4144 is a reply to message #4140] |
Tue, 25 July 2006 10:50 |
|
aroman wrote on Tue, 25 July 2006 04:07 |
EDIT: PLEASE NOTE THAT DATABASES CREATED WITH THIS VERSION ARE NOT COMPATIBLE WITH THE PREVIOUS VERSION!! See the sqlite homepage for details.
|
Thanks for info.
BTW: I think upp sql interface is missing two importnant functions:
int GetInsertedId() - returns last inserted id if column has "auto increment" atrribute
int GetSqlCode() - returns native sql error code as integer value.
for sqllite3:
int GetInsertedId()
{
return sqlite3_last_insert_rowid(db);
}
for ms sql server (and it seems for oledb too):
int GetInsertedId()
{
static Sql sql("select @@identity", db);
sql.ExecuteX();
sql.Fetch();
return (int) sql[0];
}
I don't know how it should looks for oracle.
|
|
|
|
Re: Updated Sqlite3 plugin [message #4152 is a reply to message #4148] |
Tue, 25 July 2006 18:06 |
|
luzr wrote on Tue, 25 July 2006 09:52 |
BTW, what about this syntax:
int q = SQL * Insert(TABLE)(VALUE, xx)
|
Very cool! However I would also keep ability to get id value as separate function.
|
|
|
|
Goto Forum:
Current Time: Mon Apr 29 01:31:56 CEST 2024
Total time taken to generate the page: 0.07100 seconds
|