# Template: Extract from Database
# Copy to your pipeline directory as extract.yaml
#
# Supported databases: PostgreSQL, MySQL, SQLite, MSSQL, Oracle

title: database_extraction
description: Extract data from SQL database
version: "1.0.0"

# Source type (required)
type: database

# SQL query to execute
query: |
  SELECT id, name, email, created_at
  FROM users
  WHERE status = :status
  ORDER BY created_at DESC
  LIMIT :limit

# Query parameters (substituted into :param placeholders)
params:
  status: active
  limit: 10000

# Database connection
connection_string: ${DATABASE_URL:?DATABASE_URL is required}
# Formats:
#   PostgreSQL: postgresql://user:pass@host:5432/db
#   MySQL:      mysql://user:pass@host:3306/db
#   SQLite:     sqlite:///./data/local.db
#   MSSQL:      mssql+pyodbc://user:pass@host/db?driver=ODBC+Driver+17+for+SQL+Server

batch_size: 1000
