Database: Getting Started

Introduction

Almost every modern web application interacts with a database.

Kiaan makes interacting with databases extremely simple across a variety of supported databases using raw SQL, a fluent query builder, and the Eloquent ORM. Currently, Kiaan provides first-party support for four databases:

  • MySQL

  • PostgreSQL

  • SQLite

  • SQL Server

Configuration

The configuration for Kiaan's database services is located in your application's resources\settings.env configuration file.

In this file, you may define all of your database connections, as well as specify which connection should be used by default.

Most of the configuration options within this file are driven by the values of your application's environment variables.

Examples for most of Kiaan's supported database systems are provided in this file.

# Database
Database_driver=mysql
Database_host=localhost
Database_db=Kiaan
Database_user=root
Database_pass=
Database_port=
Database_error=false

SQLite Configuration

SQLite databases are contained within a single file on your filesystem.

You can create a new SQLite database in directory databases\database.

After the database has been created, you may easily configure your environment variables to point to this database by placing the absolute path to the database in the Database_db environment variable:

Database_driver=sqlite
Database_db=Kiaan.db

Last updated