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
🕓 3 weeks 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.1.2"),
]

Target Dependencies:

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

Xcode

Documentation: Adding Package Dependencies to Your App.

Authors

GitHub

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

Release Notes

0.1.2
3 weeks ago

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