Notes/BareSQL

BareSQL Portable Flags Schema Changes and Reserved Words

BareSQL 0.2.0 adds eleven rules to BareSQL Portable, one for each difference the first release listed without one. That makes 69. Migrations get the most: changing a column takes ALTER COLUMN ... TYPE on PostgreSQL and MODIFY on MySQL, SQLite can do neither, and the rule knows 21 forms like these. Column names such as rank, key and user are reserved words on some engines, and lint now says which.

The other new rules cover FILTER on aggregates, FROM DUAL, TRIM and SUBSTRING with keywords, DROP TABLE ... CASCADE, and casts to floats. Three more catch queries that give different answers without an error: the digits of AVG, ROUND of halves, and GROUP BY on text that differs only in case. Every rule was run on SQLite, PostgreSQL, MySQL and MariaDB, and an independent review went through them twice before the release. The release post has the details.