|
| 1 | +# Database Handler CLI - Environment Configuration |
| 2 | +# |
| 3 | +# This file shows how to configure database connections for the CLI. |
| 4 | +# Copy this file to `.env` and fill in your actual database credentials. |
| 5 | +# |
| 6 | +# IMPORTANT: Never commit the `.env` file to version control! |
| 7 | + |
| 8 | +# ============================================================================ |
| 9 | +# Database Connections |
| 10 | +# ============================================================================ |
| 11 | +# |
| 12 | +# Format: DATABASE_URL=postgresql://user:password@host:port/database |
| 13 | +# |
| 14 | +# Add a comment above each DATABASE_URL to give it a friendly name. |
| 15 | +# This name will appear in the interactive database selection menu. |
| 16 | +# |
| 17 | +# You can define multiple database connections below. |
| 18 | + |
| 19 | +# Production Database |
| 20 | +DATABASE_URL=postgresql://user:password@localhost:5432/prod_db |
| 21 | + |
| 22 | +# Staging Database |
| 23 | +DATABASE_URL=postgresql://user:password@localhost:5432/staging_db |
| 24 | + |
| 25 | +# Development Database |
| 26 | +DATABASE_URL=postgresql://user:password@localhost:5432/dev_db |
| 27 | + |
| 28 | +# Local Test Database |
| 29 | +DATABASE_URL=postgresql://postgres:postgres@localhost:5432/test_db |
| 30 | + |
| 31 | + |
| 32 | +# If you don't want to add comments in your `.env` file, |
| 33 | +# you can simply give a much more explicit name to your DATABASE_URL like : |
| 34 | + |
| 35 | +DATABASE_URL_DEV=postgresql://user:password@localhost:5432/dev_db |
| 36 | + |
| 37 | +DATABASE_URL_PROD=postgresql://user:password@localhost:5432/prod_db |
| 38 | + |
| 39 | +DATABASE_URL_DEMO=postgresql://user:password@localhost:5432/demo_db |
| 40 | + |
| 41 | +# ============================================================================ |
| 42 | +# SSL Configuration (Optional) |
| 43 | +# ============================================================================ |
| 44 | +# |
| 45 | +# For databases requiring SSL, add one of the following to your connection string: |
| 46 | +# - ?sslmode=require |
| 47 | +# - ?ssl=true |
| 48 | +# |
| 49 | +# Example: |
| 50 | +# DATABASE_URL=postgresql://user:password@host:5432/db?sslmode=require |
| 51 | + |
| 52 | +# ============================================================================ |
| 53 | +# Cloud Provider Examples |
| 54 | +# ============================================================================ |
| 55 | + |
| 56 | +# AWS RDS |
| 57 | +# DATABASE_URL=postgresql://user:password@mydb.abc123.us-east-1.rds.amazonaws.com:5432/mydb |
| 58 | + |
| 59 | +# Heroku Postgres |
| 60 | +# DATABASE_URL=postgres://user:password@ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com:5432/dbname |
| 61 | + |
| 62 | +# Supabase |
| 63 | +# DATABASE_URL=postgresql://postgres:password@db.xxxxx.supabase.co:5432/postgres |
| 64 | + |
| 65 | +# Railway |
| 66 | +# DATABASE_URL=postgresql://postgres:password@containers-us-west-xx.railway.app:5432/railway |
| 67 | + |
| 68 | +# Render |
| 69 | +# DATABASE_URL=postgresql://user:password@xxx-postgres.render.com/dbname |
| 70 | + |
| 71 | +# ============================================================================ |
| 72 | +# Notes |
| 73 | +# ============================================================================ |
| 74 | +# |
| 75 | +# - Make sure your database user has appropriate permissions: |
| 76 | +# - SELECT (for dumps and listing) |
| 77 | +# - INSERT (for imports) |
| 78 | +# - DELETE (for truncate) |
| 79 | +# - DROP (for drop operations) |
| 80 | +# |
| 81 | +# - For production databases, consider using read-only credentials |
| 82 | +# for dump operations to prevent accidental data modification. |
| 83 | +# |
| 84 | +# - Always test with a non-production database first! |
0 commit comments