3 ms·
I have a lot of Excel-like use cases for which SQLite would be a great fit if only it had a decimal type.
by fauigerzigerk 6y ago
I have a lot of Excel-like use cases for which SQLite would be a great fit if only it had a decimal type.
- cordite 6y agoAs in like Java Bigdecimal, with a BigInteger on the left side, and a fixed precision on the right?
- fauigerzigerk 6y agoAs in other database systems such as Postgres. Even a C# style decimal floating point type would be sufficient.
- kyllo 6y agoBasically--it's a struct containing a byte array, weight, scale, and sign, and all the arithmetic operations are implemented in software. So it's really slow, and each RDBMS has to implement this type from scratch, or find a vendor lib that provides a suitable one, because C/C++ standard libraries don't provide one.
- darksaints 6y agoIt does have a decimal type.
- fauigerzigerk 6y agoNo, that's just an alias for numeric type affinity which results in a binary floating point type if there's a decimal point. There's also a long tradition of "faking" decimals with integers. I have always found that to be extremely tedious and error prone.
- lifepillar 6y agoI have developed SQLiteDecimal: http://chiselapp.com/user/lifepillar/repository/sqlite3decimal/index http://chiselapp.com/user/lifepillar/repository/sqlite3decim... Still very rough, but usable.
- justinclift 6y ago> WARNING: this library is NOT ready for production. Use at your own risk! How far off do you reckon it is from being "production" ready? Asking because we've been adding useful SQLite extensions as optional extras in our (sqlitebrowser.org) installer. Can add yours too, if you reckon the code is reasonably cross platform and shouldn't cause (many) weird issues. :)