Deactivation of Manifest Typing

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Deactivation of Manifest Typing

Simon de Hartog
Dear all,

SQLite has a feature called Manifest typing. As with many features of
software I run, I wonder whether this feature can be disabled. I prefer
to use static typing in my databases to prevent stored values not being
what my code (C++) expects them to be. So in short: is it possible to
use static typing instead of manifest typing in SQLite?

Kind regards,

Simon de Hartog
--
"One meets his destiny often on the road he takes to avoid it."

E: simon <at-sign> dehartog <point> nl
W: http://simon.dehartog.nl/
P: +31-6-15094709
M: simon_net <at-sign> rootsr <point> com
I: 8714776
K: http://www.rootsr.com/simon.crt
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Deactivation of Manifest Typing

Clay Dowling
Simon de Hartog wrote:
> SQLite has a feature called Manifest typing. As with many features of
> software I run, I wonder whether this feature can be disabled. I prefer
> to use static typing in my databases to prevent stored values not being
> what my code (C++) expects them to be. So in short: is it possible to
> use static typing instead of manifest typing in SQLite?
If you access the database strictly through your software, this is
trivially easy if you are using a strongly typed language like Pascal or
C.  Simply force the data to be of the appropriate type in your program
and it will be stored as the appropriate type in your database.

If you are allowing direct access to the database via SQL, you can
probably assume that any user smart enough to write their own
insert/update queries can probably also work out the correct data
types.  If not, you may wish to reconsider allowing direct SQL access.

Clay
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Deactivation of Manifest Typing

Igor Tandetnik
In reply to this post by Simon de Hartog
"Simon de Hartog" <[hidden email]> wrote
in message news:[hidden email]
> SQLite has a feature called Manifest typing. As with many features of
> software I run, I wonder whether this feature can be disabled.

No. It's a fundamental part of the architecture.

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Deactivation of Manifest Typing

Roger Binns
In reply to this post by Simon de Hartog
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Simon de Hartog wrote:
> to prevent stored values not being
> what my code (C++) expects them to be.

Note that the APIs will convert the values for you.  For example if you
call sqlite3_column_text then the value will be converted to text for
you no matter what type it actually is.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkk8nDcACgkQmOOfHg372QSwsACffOTb3F+Gvm8/Kf3rmUZXSjZ2
DOoAoL46OCmUcaVJyObZRw5QlHzhljac
=E3yp
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Deactivation of Manifest Typing

John Stanton-3
In reply to this post by Clay Dowling
In one of our Sqlite applications the gratuitous type changes of Sqlite
were incompatible and it took only a very few patches to the Sqlite
source to disable the detection and change code.

Clay Dowling wrote:

> Simon de Hartog wrote:
>
>>SQLite has a feature called Manifest typing. As with many features of
>>software I run, I wonder whether this feature can be disabled. I prefer
>>to use static typing in my databases to prevent stored values not being
>>what my code (C++) expects them to be. So in short: is it possible to
>>use static typing instead of manifest typing in SQLite?
>
> If you access the database strictly through your software, this is
> trivially easy if you are using a strongly typed language like Pascal or
> C.  Simply force the data to be of the appropriate type in your program
> and it will be stored as the appropriate type in your database.
>
> If you are allowing direct access to the database via SQL, you can
> probably assume that any user smart enough to write their own
> insert/update queries can probably also work out the correct data
> types.  If not, you may wish to reconsider allowing direct SQL access.
>
> Clay
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users