Skip to content

Levure Configuring a Levure application

Trevor DeVore edited this page Aug 1, 2018 · 6 revisions

Adding SQL Yoga to a Levure application

The SQL Yoga repo includes the necessary files to work as a Helper in the Levure framework. Using SQL Yoga with Levure simplifies configuration and development work.

Add as a helper

The simplest way is to download the SQL Yoga repository, rename the folder to "sql yoga" and place it in your applications "helpers" folder. The next time you open your application in the IDE SQL Yoga will be loaded.

Configure app.yml

In the app.yml file you tell SQL Yoga where to find your database configuration files. Add the following to the app.yml file.

app.yml

sql yoga:
  configuration:
    - filename: ./database

Create the database folder

Since you told SQL Yoga that configuration files are stored in a database folder you now need to create the folder. Create the database folder in the app folder (alongside the ui, behaviors, etc. folders).

Configuring SQL Yoga

Create the connections.yml file

In the ./app/database folder create a file named connections.yml. Configure a connection that points to the database file. Here is a SQLite example that points to a .sqlite file in the ./app/database folder:

default connection: local
connections:
  local:
    adaptor: sqlite
    file: ./database/to-do.sqlite

Clone this wiki locally