| name | railway-database |
| description | Add official Railway database services (Postgres, Redis, MySQL, MongoDB). Use when user wants to add a database, says "add postgres", "add redis", "add database", "connect to database", or "wire up the database". For other templates (Ghost, Strapi, n8n), use the railway-templates skill. |
| version | 1.0.0 |
| author | Railway |
| license | MIT |
| tags | ["Railway","Database","Postgres","Redis","MySQL","MongoDB","Infrastructure","Deployment","Template"] |
| dependencies | ["railway-cli"] |
| allowed-tools | Bash(railway:*) |
Railway Database
Add official Railway database services. These are maintained templates with pre-configured volumes, networking, and connection variables.
For non-database templates, see the railway-templates skill.
When to Use
- User asks to "add a database", "add Postgres", "add Redis", etc.
- User needs a database for their application
- User asks about connecting to a database
- User says "add postgres and connect to my server"
- User says "wire up the database"
Decision Flow
ALWAYS check for existing databases FIRST before creating.
User mentions database
โ
Check existing DBs first
(query env config for source.image)
โ
โโโโโโดโโโโโ
Exists Doesn't exist
โ โ
โ Create database
โ (CLI or API)
โ โ
โ Wait for deployment
โ โ
โโโโโโโฌโโโโโโ
โ
User wants to
connect service?
โ
โโโโโโโดโโโโโโ
Yes No
โ โ
Wire vars Done +
via env suggest wiring
skill
Check for Existing Databases
Before creating a database, check if one already exists.
For full environment config structure, see environment-config.md.
railway status --json
Then query environment config and check source.image for each service:
query environmentConfig($environmentId: String!) {
environment(id: $environmentId) {
config(decryptVariables: false)
}
}
The config.services object contains each service's configuration. Check source.image for:
ghcr.io/railway/postgres* or โ Postgres