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 0.3.1
A lightweight SQL query generator for Swift projects.
⭐️ 0
🕓 24 weeks ago
iOS
.package(url: "https://github.com/keyvariable/kvSqlKit.swift.git", from: "0.3.1")

kvSqlKit.swift

A lightweight cross-platform SQL query framework on Swift.

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 cross-platform. Package is built and the unit-tests are passed on macOS, Linux (Ubuntu 22.04) and Windows (10 x64).

Getting Started

Package Dependencies:

.package(url: "https://github.com/keyvariable/kvSqlKit.swift.git", from: "0.3.1")

Target Dependencies:

.product(name: "kvSqlKit", package: "kvSqlKit.swift")

Import:

import kvSqlKit

Authors

GitHub

link
Stars: 0
Last commit: 24 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.3.1
24 weeks ago

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