Swiftpack.co - keyvariable/kvSqlKit.swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by keyvariable.
keyvariable/kvSqlKit.swift v0.1.2
A lightweight SQL query generator for Swift projects.
⭐️ 0
🕓 1 week ago
iOS
.package(url: "https://github.com/keyvariable/kvSqlKit.swift.git", from: "v0.1.2")

kvSqlKit.swift

Swift 5.2 Linux macOS iOS

A lightweight SQL query generator for Swift projects.

Examples

Hello world:

import kvSqlKit

// SELECT 'Hello world'
let query = KvSQL.select("Hello world").sql

Simple SELECT

import kvSqlKit

struct Items : KvSqlTable {
    static var id = "items"

    let sku = Column("sku", of: .serial, default: .implicit, constraints: [ .notNull, .primaryKey ])
    let count = Column("count", of: .integer, constraints: [ .notNull ])
}

// SELECT "items".* FROM "items" ORDER BY "items"."count" DESC
let query = KvSQL.select(items.*, from: items).orderBy(items.count.desc()).sql

More Examples

See Tests for more examples.

Supported Platforms

This package is crossplatform.

Getting Started

Swift Tools 5.2+

Package Dependencies:

dependencies: [
    .package(url: "https://github.com/keyvariable/kvSqlKit.swift.git", from: "0.2.0"),
]

Target Dependencies:

dependencies: [
    .product(name: "kvSqlKit", package: "kvSqlKit.swift"),
]

Xcode

Documentation: Adding Package Dependencies to Your App.

Authors

GitHub

link
Stars: 0
Last commit: 6 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

0.2.0
6 days ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics