To get started with CQL in your Crystal project, follow these steps:
First, add CQL to your project by including it in the shard.yml
file:
Run the following command to install the dependencies:
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.).
Now you can define your schema and run migrations (explained in later sections).