FAQ
Frequently Asked Questions
General Questions
Technical Questions
require "cql"
require "azu"
# Define schema
AppDB = CQL::Schema.define(:app, adapter: CQL::Adapter::Postgres, uri: ENV["DATABASE_URL"]) do
table :users do
primary :id, Int64
text :name
text :email
timestamps
end
end
# Define model
struct User
include CQL::ActiveRecord::Model(Int64)
db_context AppDB, :users
getter id : Int64?
getter name : String
getter email : String
end
# Use in endpoint
struct UserEndpoint
include Azu::Endpoint(EmptyRequest, UserResponse)
get "/users/:id"
def call : UserResponse
user = User.find(params["id"].to_i64)
UserResponse.new(user)
end
endCommon Issues
Compilation Issues
Runtime Issues
Performance Issues
Development Issues
Debugging Tips
Enable Debug Logging
Inspect Request Data
Use Crystal's Built-in Debugging
Test Individual Components
Performance Troubleshooting
Profile Your Application
Monitor Memory Usage
Database Query Optimization
Getting Help
Community Resources
Reporting Issues
Example Issue Report
Last updated
Was this helpful?
