Skip to content

swift-sql

Development Status

Database-agnostic SQL query and statement types for Swift, with connection, row, and value protocols that a driver conforms to.

Installation

Add the package to your Package.swift dependencies:

dependencies: [
    .package(url: "https://github.com/swift-foundations/swift-sql.git", branch: "main")
]

Add the product to a target that needs it:

.target(
    name: "YourTarget",
    dependencies: [
        .product(name: "SQL", package: "swift-sql")
    ]
)

The driver integration and the test doubles are separate products, so neither is linked into a target that does not ask for it:

Product Adds
SQL PostgreSQL Standard Integration PostgreSQL statement execution and row decoding
SQL Test Support in-memory TestDatabase, TestConnection, and TestRow

Error Handling

Query and statement operations throw SQL.Error, declared by this package. Driver-specific failures are mapped into it at the integration boundary, so a caller written against the protocols handles one error type regardless of which database backs it.

License

Apache 2.0. See LICENSE.md.

About

Database-agnostic SQL query and statement types with connection, row, and value protocols for Swift.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages