Swiftpack.co - Package - vapor/sql

Github

link
Stars: 73
Help us keep the lights on

Dependencies

Used By

Total:

Releases

2.3.2 - Mar 26, 2019

Fixed:

  • SQLInsertBuilder now sorts rows to ensure correct order.

2.3.1 - Mar 26, 2019

Fixed:

  • Silenced a Swift 5 warning. (#55)

2.3.0 - Jan 11, 2019

New:

  • Adds SQLDirection.null and SQLDirection.notNull for ordering by null values. (#49).

2.2.0 - Oct 31, 2018

New:

  • Adds a convenience method for using COALESCE. (#42, #43)
conn.select().column(.coalesce(.sum(\Planet.id), 0), as: "id_sum")...
SELECT COALESCE(SUM(`id`), 0) as `id_sum` ...

2.1.0 - Sep 20, 2018

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)