Adding CQL to Existing Project
What You'll Learn
Prerequisites
Step 1: Add Dependencies
dependencies:
cql:
github: azutoolkit/cql
version: ~> 0.0.435
# Keep your existing database driver or add one
pg:
github: will/crystal-pg
version: "~> 0.26.0"Step 2: Create Database Configuration
Step 3: Define Existing Tables in Schema
Step 4: Create Models for Existing Tables
Step 5: Initialize CQL
Step 6: Create New Migrations
Step 7: Run New Migrations
Step 8: Gradual Migration Strategy
Phase 1: Read Operations
Phase 2: Simple Writes
Phase 3: Complex Queries
Phase 4: Relationships
Handling Existing Migrations
Option A: Start Fresh
Option B: Import Existing Schema
Best Practices
Common Issues
Column Name Mismatches
Different Timestamp Format
Summary
Next Steps
Last updated
Was this helpful?