2.0.0
- Add case protection for PostgreSQL #130 (Breaking Change)
- Improve Foreign Key Support #133
- Add AUTO INCREMENT support for SQLite #136
- Handle failure of ConnectionPool connection generator #137
Notes
Add case protection for PostgreSQL #130 is a breaking change. Prior to this change all values for table and column names passed into the underlying database were converted to lower case by the PostgreSQL database. With the change the values are now wrapped to ensure the case is respected by the PostgreSQL database.
If you have previously created a database that specifies mixed case table or column names you will encounter issues that may include:
- Table does not exist.
- Column does not exist.
- Queries returning no data.
To continue using your existing database you can align the table and column names in your application with the actual values in the database.
Any raw queries you use may also require updating to ensure your table and column names are wrapped appropriately.
Consider a simple example:
For the table defined as myTable
class MyTable : Table {
let aColumn = Column("a")
let tableName = "myTable"
}
Your previous raw select statement
SELECT aColumn FROM myTable
should be updated to
SELECT "aColumn" FROM "myTable"
if you wish to use the mixed case column names, or
SELECT acolumn FROM mytable
to continue using a previously created instance of myTable.
If you build your select statement through the SwiftKuery API the table and column names will automatically be wrapped. In this case should you wish to use a previously created database you would need to change the table definition as follows
class MyTable : Table {
let acolumn = Column("a")
let tableName = "mytable"
}