Swiftpack.co - Package - SwifQL/PostgresBridge

MIT License Swift 5.2 Github Actions Swift.Stream

Bridge to PostgreSQL

Work with Postgres with SwifQL through its pure NIO driver.

Installation

.package(url: "https://github.com/SwifQL/PostgresBridge.git", from:"1.0.0-rc"),
.package(url: "https://github.com/SwifQL/VaporBridges.git", from:"1.0.0-rc"),
.target(name: "App", dependencies: [
    .product(name: "Vapor", package: "vapor"),
    .product(name: "PostgresBridge", package: "PostgresBridge"),
    .product(name: "VaporBridges", package: "VaporBridges")
]),

For more info please take a look at the Bridges repo.

Github

link
Stars: 2

Used By

Total: 0

Releases

🏀 Implement `requestConnection` method - 2020-06-06 13:27:34

Thanks to @YorkFieldX now we can use PostgresConnection in tests simply this way

// retrieve a connection
let connection = try application.postgres.requestConnection(to: .my_awesome_database).wait()

// execute any queries
let users = try SwifQL.select(User.table.*)
                      .from(User.table)
                      .execute(on: connection)
                      .all(decoding: User.self)
                      .wait()

// don't forget to close a connection
try connection.close().wait()

⚠️Use this way only in tests cause you can only close a connection but not return it back to a pool, so it may affect app performance.

Implement PG_SSL environment key - 2020-05-29 16:09:24

Set PG_SSL=1 or PG_SSL=true or PG_SSL=require environment variable to enable SSL for .psqlEnvironment database identifier.