On Fri, 29 Jun 2018, David Burgess wrote:

"This flexible type-name arrangement works because SQLite is very
forgiving about you putting non-proscribed values into columns - it
tries to convert if it can do so without loss of information but if it
cannot do a reversible type conversion it simply stores whatever you
give it.  Hence if you store a string '3456' into an INT column, it
converts the string into an integer, but if you store a string 'xyzzy'
in an INT column it will actually store the string value."

This is an important feature of SQLite.  In hindsight, an excellent decision.

It is sloppy and absent additional constraints and checks added to the schema, it puts a burden on the consumer of the data to assure that it is the correct type.

It is not so clear that it was an excellent decision.

If the application requires an integer value, why do you think that it is appropriate to pass it the string 'xyzzy'?

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to