3 ms·
>> It was designed to be a DB for Tcl at a time when that language didn't have typed objects. Its SQL implementation reflects that. > It actually does have typ
by degamad 1y ago
>> It was designed to be a DB for Tcl at a time when that language didn't have typed objects. Its SQL implementation reflects that.
> It actually does have typed values
Now. As the article points out, they were not part of the initial design, because of the Tcl heritage.
- skissane 1y agoAFAIK it has always had typed values. Don’t confuse column types (which constrain a column to containing only values of a specified type) with value types (which enable it to treat the string “12” and the integer 12 and the floating point 12.0 as three distinct values) Tcl has value types. Tcl 7.x and earlier only had one data type, the string-so adding two integers required two string-to-int conversions followed by an int-to-string conversion. In 1997, Tcl 8.x was released, which internally has distinct values types (int, string, etc), although it retains the outward appearance of “everything-is-a-string” for backward compatibility. So SQLite’s Tcl heritage included distinguishing different types of values, as is done in post-1997 Tcl.
- int_19h 1y agoTcl still only has one data type, which is the string. It has different internal representations to allow representing integers etc more efficiently, but since that is not part of the formal semantics of the language, those representations are not data types.
- skissane 1y agoAt the level of its C API-which is the level at which it integrates with sqlite-it indeed has multiple data types, it even has a structure to represent them, Tcl_ObjType: https://www.tcl-lang.org/man/tcl8.4/TclLib/ObjectType.htm https://www.tcl-lang.org/man/tcl8.4/TclLib/ObjectType.htm