Repos
Crecto::Repo
maps the database to the database adapter, and is used to run queries on models. If connections to multiple databases is required, just create a separate Repo for each. The config
block defines how the repo connects to the database.
config
options, all of the options from crystal-db database are implemented:
adapter
- Specify the Crecto adapter to use:Crecto::Adapters::Postgres
,Crecto::Adapters::Mysql
,Crecto::Adapters::SQLite3
checkout_timeout
database
- database namepassword
- database passwordusername
- database usernameuri
- full uri to database, can include all config options (i.e.postgres://username:password@localhost:5432/my_db?initial_pool_size=10&retry_attemps=5
)hostname
- database host nameinitial_pool_size
max_pool_size
retry_attempts
retry_delay