Swiftpack.co - werner-freytag/SwiftSQLite as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by werner-freytag.
werner-freytag/SwiftSQLite 0.9.4
A lightweight Swift wrapper for SQLite.
⭐ïļ 2
🕓 3 years ago
.package(url: "https://github.com/werner-freytag/SwiftSQLite.git", from: "0.9.4")

SwiftSQLite

A lightweight Swift wrapper for sqlite3

Example

import SwiftSQLite

let sqlite = try! SQLite(path: "test.db")

try! sqlite.query("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, value TEXT)")
try! sqlite.query("INSERT INTO test (value) VALUES (?)", arguments: ["😎"])
try! sqlite.query("INSERT INTO test (value) VALUES (?)", arguments: ["ðŸĪŠ"])

print("Last insert id: \(sqlite.lastInsertRowId)")

// -> Last insert id: 2

let result = try! sqlite.query("SELECT * FROM test")
print(result.fetchAll(column: "value") as [String])

// -> ["😎", "ðŸĪŠ"]

Documentation

See unit tests for usage. Find a reference documentation in the Documentation directory.

GitHub

link
Stars: 2
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

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