Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Updated Sqlite3 plugin
Updated Sqlite3 plugin [message #4140] Tue, 25 July 2006 10:07 Go to next message
aroman is currently offline  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:

  1. 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
  2. Delete all files in
    uppsrc/plugin/sqlite3/lib/*
    Then unzip the new source files into that directory.
  3. 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 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

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 #4148 is a reply to message #4144] Tue, 25 July 2006 15:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes. Long term "TODO" entry Wink ..but there is always so much else to do..

Oracle does not have insert autonumbers, that is why it is missing yet.

BTW, what about this syntax:

int q = SQL * Insert(TABLE)(VALUE, xx)

?

Also, SqlArray will need fixing to work both with autonumber inserts AND oracle sequences.

Mirek

[Updated on: Tue, 25 July 2006 15:54]

Report message to a moderator

Re: Updated Sqlite3 plugin [message #4152 is a reply to message #4148] Tue, 25 July 2006 18:06 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

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.
Re: Updated Sqlite3 plugin [message #4154 is a reply to message #4144] Tue, 25 July 2006 18:37 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
BTW, is not it UUID in MS-SQL? I will make it return Value to be sure Wink

Mirek
Previous Topic: sqlite3 plugin documentation
Next Topic: Sqlite3 int64 / wstring support patch
Goto Forum:
  


Current Time: Mon Apr 29 01:31:56 CEST 2024

Total time taken to generate the page: 0.07100 seconds