/Swift-Kuery-SQLite

An SQLite plugin for the Swift-Kuery framework

Primary LanguageSwiftApache License 2.0Apache-2.0

Swift-Kuery-SQLite

SQLite plugin for the Swift-Kuery framework.

Build Status - Master macOS Linux Apache 2

Summary

SQLite plugin for the Swift-Kuery framework. It enables you to use Swift-Kuery to manipulate data in an SQLite database.

SQLite installation

To use Swift-Kuery-SQLite you must install SQLite.

macOS

You can install SQLite with Homebrew:

$ brew install sqlite

Or, if you prefer MacPorts, you can use that too, though note that you need to symlink a file into the place that Homebrew installs it:

$ port install sqlite3
$ mkdir -p /usr/local/opt/sqlite/include
$ ln -s /opt/local/include/sqlite3.h /usr/local/opt/sqlite/include/

Linux

$ sudo apt-get install sqlite3 libsqlite3-dev

Using Swift-Kuery-SQLite

First create an instance of Swift-Kuery-SQLite by calling:

let db = SQLiteConnection(filename: "myDB.db")

To establish a connection call:

db.connect(onCompletion: (QueryError?) -> ())

You now have a connection that can be used to execute SQL queries created using Swift-Kuery. View the Kuery documentation for more information, or see the Database Connectivity with Kuery chapter of the Kitura Until Dawn guidebook/tutorial.

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.