- Read through the Example Table section below to setup the sample database
- Run
swift package update
to download dependencies - Run
swift build
to build the example application - Execute the program
.build/debug/FluentApp
View Fluent for documentation.
Swift 3.0 or later is required.
- Install the
sqlite3
package. It's recommended to use a package manager:
On macOS use brew:
brew install sqlite3
On Ubuntu use apt-get
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
Using the sqlite3
command, create a database in the location the example
app will look for:
sqlite3 Database/main.sqlite
That will put you in a sql prompt. Copy and paste the following SQL query to set up the example table.
CREATE TABLE users(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INT NOT NULL);
Then type exit;
and you can open up the application with the steps at the top of this README.
Works on macOS and Ubuntu.