-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacob Lister wrote:
> What provision is there for the inclusion of new data types in SQLite 
> and is such an inclusion possible or likely in future?

Updating or adding a data type would affect the file format and many of the
API families (eg sqlite3_bind_*, sqlite3_column_*).  The chance of such a
change going into the SQLite core is practically zero since it would break
compatibility at the file format and API level.

If you are ok with your files and API usage being incompatible with
"standard" SQLite ones then I'd recommend contracting the SQLite "company"
to do the work.  (They'd make it fit in best, include tests, maintain it for
future SQLite versions and deal with niggly issues such as query optimisers.)

   http://www.hwaci.com/sw/sqlite/prosupport.html

> My current
> thinking is to store decimal32/64 bit values as 64 bit integers in an 
> SQLite database and use custom functions to convert these to/from
> integers/strings/doubles etc and perform arithmetic,

The problem with repurposing integers is that they can easily be
accidentally used as integers without signalling an error.  You would be
better off using blobs.  (Sadly they don't give errors but do give zero so
you'd at least be able to detect wrong numbers coming back.)

sqlite> select x'aa'+x'bb';
0
sqlite> select x'aa'/x'bb';

sqlite> select x'aa'-x'bb';
0
sqlite> select x'aa'*x'bb';
0

> but obviously a native integrated type would be more convenient

Not only do you need the type but every arithmetic operation would also need
to be updated.  It will be even more fun if you also want to support the
- -1985 representations (eg normal SQLite database format) since you'll have
both semantics in the same program at the same time.  Are you going to be
using a CPU that has native -2008 instructions?

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksuytMACgkQmOOfHg372QTQDACfTPmixLnSRXUzps85Z0daDG3y
k5MAn1i8J8FwWwzXx4D1MLVlc0PoBXP3
=gBmz
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to