Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vapor-community/sqlite-provider

SQLite3 provider for Vapor
https://github.com/vapor-community/sqlite-provider

deprecated

Last synced: 3 months ago
JSON representation

SQLite3 provider for Vapor

Awesome Lists containing this project

README

        

# Vapor SQLite

Adds SQLite support to the Vapor web framework.

## Install

```swift
import Vapor
import VaporSQLite

let drop = Droplet()
try drop.addProvider(VaporSQLite.Provider.self)
```

## Config
Be sure to have a `sqlite.json` config file in your Config directory, the path is set relatively from the Droplet's working directory
```json
{
"path": "/path/to/database.sqlite"
}
```

## Raw Queries

```swift
let result = try drop.database?.driver.raw("SELECT sqlite_version()")
print(result)
```

## Dependencies

### OS X

```shell
brew install sqlite3
```

### Linux

```shell
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
```