Skip to content

SQL 2.1.0

Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 20 Sep 15:17
a35cf1d

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 to SQLSelectBuilder. (#35)

  • order(...) has been added to SQLSelectBuilder. (#35)

  • Several new conveniences like count(...), sum(...), etc have been added to SQLExpression. (#35)

  • New type-safe where(...)overloads have been added to SQLSelectBuilder 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 sub SELECT to the column list. (#35)
conn.select().all()
    .column { select in
        select.column(\Planet.id).from(Planet.self).limit(1)
    }
    .from(Galaxy.self)