# Development commands for pydantic-query

# Install dependencies
install:
    uv pip install -e .[dev]

# Run tests
# test: typecheck
test:
    uv run pytest -v -m "not docker"

# Run linting
lint:
    ruff check --fix src tests

# Run type checking
typecheck:
    uv run mypy src

# Format code
format:
    black src tests
    ruff check --fix src tests

# Clean up temporary files
clean:
    find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
    find . -type f -name "*.pyc" -delete
    find . -type f -name "*.pyo" -delete
    find . -type f -name ".coverage" -delete
    find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
    find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true

# Start development environment
dev: db-up
    @echo "Development environment ready"
    @echo "PostgreSQL: localhost:5432"
    @echo "Run 'just test' to execute tests"

# Start all docker databases
db-up:
    podman compose up -d postgres mariadb clickhouse

# Stop all docker databases
db-down:
    podman compose down

# Run tests with docker databases (postgres, mysql, etc)
test-docker: db-up
    podman compose run --rm test-runner

test-all: db-up test test-docker

# Show help
default:
    just --list
