elliotchance / vsql

✌️ Single-file or PostgreSQL-server compatible transactional SQL database written in pure V.
https://vsql.readthedocs.io
MIT License
299 stars 20 forks source link

Improvements for integers #120

Closed elliotchance closed 2 years ago

elliotchance commented 2 years ago

Integer constants are now always parsed as BIGINT and integer types (SMALLINT, INTEGER and BIGINT) are stored as an i64 in the Value rather than storing them in the existing f64 which will lose precision of the integer.

This allows use to raise a new SQLSTATE 22003 "numeric value out of range" in most cases. However, this is not entirely complete as the minimum value for BIGINT cannot be encoded corrected. See #116.