SQL 2.1.0
New:
- New
SQLConnectable
protocol. All SQL builder shortcuts will now correctly appear on both database connections and pools. (#35)
pool.select().all().from(Planet.self).run()
-
SQLError
protocol. SQL implementations can now conform their errors to this protocol to provide developers with a general purpose way for detecting common SQL errors, like constraint errors. (#35). -
limit(...)
has been added toSQLSelectBuilder
. (#35) -
order(...)
has been added toSQLSelectBuilder
. (#35) -
Several new conveniences like
count(...)
,sum(...)
, etc have been added toSQLExpression
. (#35) -
New type-safe
where(...)
overloads have been added toSQLSelectBuilder
that support both arrays and single values. (#35, #33)
builder.where(\Planet.type, .in, [.smallRocky, .gasGiant])
builder.where(\Planet.type, .notEqual, .gasGiant)
SQLSelectBuilder
now supports adding a subSELECT
to the column list. (#35)
conn.select().all()
.column { select in
select.column(\Planet.id).from(Planet.self).limit(1)
}
.from(Galaxy.self)