sebadob / hiqlite

Hiqlite - highly-available, embeddable, raft-based SQLite + cache
Apache License 2.0
24 stars 1 forks source link

column type `INT` is not recognized properly in some situations #13

Closed sebadob closed 2 weeks ago

sebadob commented 2 weeks ago

Like mentioned in this comment, INT column types are not recognized properly in some situations.

If you use INTEGER, everything will be fine. Additional type checks need to be implemented, since SQLite does not seem to normalize everything to INTEGER obivously.

At the same time, it makes sense to check for things like VARCHAR instead of TEXT, and so on as well.

sebadob commented 2 weeks ago

The type matching now works in the following way:

  1. Check if a proper, correct type for SQLite has been used. The only "correct" types that exist in SQLite are:
  2. If no "correct" type has been used, apply SQLite type-affinity rules to check for other matches. These checks have a lot more overhead and you should always use proper SQLite types for best performance. The rules from 3.1. Determination Of Column Affinity have been applied. Not 100% exactly though because of the other checks I am doing beforehand already and I don't need to check some things twice.