Question about Using SqlLite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Using SqlLite

Mark Pirogovsky-3
Hello All,
I have a Database application which can talk to different database Back
ends ( Oracle , PostgreSQL for example).  I was looking to make it use
the SQLite.  However I came to realize that SqlLite does not support few
very common database functions and data types.

I think I have a good handle on How I can make my application store and
retrieve data type like Time stamps( Dates)  and Boolean.

What kind of puzzles me how I can deal with the luck of Sequences.
specifically not being able to call the Sequence nextVal, or currVal as  
can in other databases.  I am not sure that I want to create the special
case for the SQLite in my application.
I know that I can have serialized values in the SqlLite with the DDL
using "autoincrement" feature and I can even retrieve the last generated
value after the insert( select last_insert_rowid() ),
but I'd be much happier if I could ask for the value ahead of the insert.


I remember some discussion a while ago  on the subject, but I can not
find it.

Does anybody have any pointers ?

Many thanks,

Mark

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Using SqlLite ( Date , Timestamps, Boolean)

Mark Pirogovsky-3
Hello All,

I made an attempt  to transparently map some commonly used smalltalk
classes like Boolean, Timestamp and Date with the SqLite database.

to use:
use AdHocQueryTool2 and perform:

  "Create table type_test(my_time timestamp  , my_date date  , my_bool  
boolean );"
  " insert into type_test values(datetime(), date(), 'true' )"
  "select * from type_test"
YOU should get Smalltalk Timestamp and Boolean.

I published my small changes in the Public repository  SQLite3EXDI (7.9
-  mp 1,markpi)

It is not very elegant or all encompassing change, but it did allow me
to use all of the same code that uses Oracle and / or Postgres for my
business application with very little modification to domain objects
The next thing I need to resolve -- compatibility with  nextVal() and
currVal().

Regards,
--Mark
P.S. that is from thir wesite:

http://sqlite.org/datatype3.html.
Each value stored in an SQLite database (or manipulated by the database
engine) has one of the following storage classes:
NULL. The value is a NULL value.
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8
bytes depending on the magnitude of the value.
REAL. The value is a floating point value, stored as an 8-byte IEEE
floating point number.
TEXT. The value is a text string, stored using the database encoding
(UTF-8, UTF-16BE or UTF-16LE).
BLOB. The value is a blob of data, stored exactly as it was input.


Mark Pirogovsky wrote:
> Hello All,
> I have a Database application which can talk to different database Back
> ends ( Oracle , PostgreSQL for example).  I was looking to make it use
> the SQLite.  However I came to realize that SqlLite does not support few
> very common database functions and data types.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc