Skip to content

lukevanin/swiftql

Repository files navigation

SwiftQL

SwiftQL lets you you write SQL queries using familiar Swift type-safe syntax.

Overview

Using SwiftQL SQL expressions look like Swift code:

let query = sql { schema in
    let person = schema.table(Person.self)
    Select(person)
    From(person)
    Where(person.name == 'Fred')
}

SQL written with SwiftQL is type checked at compile time, highlghting any syntax errors, typos, or missing fields.

SwiftQL lets you use your IDE's code completion and refactoring tools to assist you in writing error free SQL.

SwiftQL uses SQLite's dialect of SQL. If you have written SQL for SQLite you already know SwiftQL.

See the documentation for more.

Installation

Swift Package Manager

Add the following line to the dependencies section in your Package.swift file:

.package(url: "https://github.com/lukevanin/swiftql.git", from: "1.0.0")

Xcode

Refer to Apple's documentation Adding package dependencies to your app, and specify the package URL https://github.com/lukevanin/swiftql.git.

License

MIT license. See the license.

About

A type-safe DSL for writing SQL in Swift.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors