SQLite interface from newLISP

Started by HPW, January 11, 2004, 10:56:07 AM

Previous topic - Next topic

HPW

Repostet from thread newlisp.dll:


Quote
Uploaded 'sqlite.lsp' bindings for the SQLite database. Works on Friday's upload of newLISP version 7.4.7, which can import libraries compiled for 'cdecl' calling conventions. Also tested on LINUX and FreeBSD. With this file and the new 'cdecl' parameter in newLISP 'import' you don't need a separate wrapper DLL on Win32.



This library import is also a good demo what to do with things like 'char *** pazValue' or 'char **pzErrmsg'. Nested multiple pointers can all be handled with the right mixture of 'get-integer' and 'get-string'.



SQLite fits very good to newLISP, because it is small and 'in process' so it doesn't need a separate database server running. The generated databases are binary compatible on all platforms. Seems to be the ideal database if MySQL still seems to be too much for the task.



http://newlisp.org/download/development/">http://newlisp.org/download/development/

and

http://www.sqlite.org">http://www.sqlite.org



Lutz


I aggree with all points. Good example of the new import-feature.



I will delete my wrapper-dll from my newLISP extension site.
Hans-Peter

Lutz

#1
Thanks for reposting, perhaps some of you have any previous experience with SQLite and could tell us about it. I want to move a project to it.



Lutz

HPW

#2
I myself did not much until now.



I have asked the most experienced user on the neobook forum for a more advanced example, but he has not released something yet.
Hans-Peter

HPW

#3
By the way I have monitored the SQLite mailing list some time, and I think a lot of people use it on a lot of platforms for heavy database jobs with a lot more record than 20000. It is not a full-fledge oracle, but for SQL92 it is very fast and  small.
Hans-Peter

HPW

#4
With sqlite 3.03 beta sqlite goes into the next major version.
Quote
The next 3.0 release will probably be called a final or stable release.


Since the API changed slightly (sqlite_compile is now sqlite3_prepare etc.) we need a new sqlite3.lsp.



I have tried with simple replacing, but had no success so far. (Crashing)



Features:
Quote
A more compact format for database files.

Manifest typing and BLOB support.

Support for both UTF-8 and UTF-16 text.

User-defined text collating sequences.

64-bit ROWIDs.

Improved Concurrency.


More:

http://www.sqlite.org/version3.html">http://www.sqlite.org/version3.html
Hans-Peter

Lutz

#5
I looked into this some time ago and it is definetely more than a name change. The old interface already had to deal with 'C' pointers to pointers and data structures. A slight change in this means to look into it again more carefully. It all can be done, but one has to read the docs for the 'C' interface again. If you want to go at it, I suggest you first study the old docs and 'C' interface to understand the pointer stuff how its done in newLISP and then approach the new stuff.



There are two modes to interact with SQLite one with call back, the other one without, using sqlite_compile(), sqlite_step() and sqlite_finalize(). Of course we want the method without callbacks.



Lutz