Migrate sqleton app config from legacy top-level repositories to app.repositories.
This tutorial shows how to migrate sqleton repository discovery config from the old top-level repositories: key to the current app.repositories block.
Use this guide if sqleton fails with an error like:
legacy top-level repositories is no longer supported in /path/to/config.yaml; move entries to app.repositories
Sqleton now treats repository discovery as app-owned config.
The supported shape is:
app:
repositories:
- /path/to/repo-a
- /path/to/repo-b
The old shape is no longer accepted:
repositories:
- /path/to/repo-a
- /path/to/repo-b
This makes sqleton's config model clearer:
app.repositories is for repository discovery--config-file is for explicit command config such as sql-connection or dbtThat separation matters because repository discovery is layered automatically, while database settings remain explicit.
Sqleton discovers repository config from these locations, in layer order:
/etc/sqleton/config.yaml~/.sqleton/config.yaml$XDG_CONFIG_HOME/sqleton/config.yaml.sqleton.yml at the git repository root.sqleton.override.yml at the git repository root.sqleton.yml in the current working directory.sqleton.override.yml in the current working directoryThen sqleton appends:
SQLETON_REPOSITORIES$HOME/.sqleton/queries directory when it existsBefore:
repositories:
- ~/code/sql/shared
- ~/.sqleton/queries-extra
After:
app:
repositories:
- ~/code/sql/shared
- ~/.sqleton/queries-extra
Before .sqleton.yml:
repositories:
- ./queries
- ../team-queries
After .sqleton.yml:
app:
repositories:
- ./queries
- ../team-queries
Project-local .sqleton.yml:
app:
repositories:
- ./queries
- ../team-queries
Explicit DB config file:
sql-connection:
db-type: postgresql
host: 127.0.0.1
port: 5432
database: app
user: app
Run with:
sqleton run-command ./queries/list-users.sql -- --config-file ./db-config.yaml
Yes.
A .sqleton.yml file can contain both:
app.repositoriessql-connectionExample:
app:
repositories:
- ./queries
sql-connection:
db-type: sqlite
database: ./local.db
Sqleton will:
app.repositories automatically for repository discoverysql-connection when you explicitly point --config-file at that fileFor example:
sqleton query --config-file ./.sqleton.yml "SELECT COUNT(*) FROM users"
Check:
app.repositories, not repositoriesUse:
.sqleton.yml for app.repositoriessql-connection--config-file when you want sqleton to read the command settingsThe migration rule is simple:
repositories: to app.repositories