Installation
To get started with CQL in your Crystal project, follow these steps:
Step 1: Add Dependency
First, add CQL to your project by including it in the shard.yml
file:
Step 2: Install Shards
Run the following command to install the dependencies:
Step 3: Configure Database
Set up your database connection by specifying the adapter and connection URL. This is done by configuring the database in your code, as follows:
In this example, we’re using PostgreSQL. You can change the URL according to your database (MySQL, SQLite, etc.).
Step 4: Create the Schema
Now you can define your schema and run migrations (explained in later sections).
Last updated