Skip to content

nitric start provisions local PostgreSQL container without sql() resource or preview flag #910

@tom-groves

Description

@tom-groves

Description

When running nitric start, the CLI automatically provisions a PostgreSQL container named nitric-{project-name}-local-sql, even when:

  1. No sql() resource is used anywhere in the codebase
  2. The preview: sql-databases flag is not enabled in nitric.yaml

Environment

  • Nitric CLI version: 1.61.1
  • OS: macOS (Darwin 25.3.0)
  • Node/Bun: Bun 1.x

Steps to Reproduce

  1. Create a project with nitric.yaml containing only basic service configuration:
    name: my-project
    services:
      - match: ./src/apps/*/main.ts
        start: bun run $SERVICE_PATH
        type: default
  2. Ensure no preview: section exists
  3. Ensure no sql() imports from @nitric/sdk in any source files
  4. Run nitric start
  5. Check Docker containers: docker ps | grep sql

Expected Behavior

No PostgreSQL container should be provisioned since:

  • The project doesn't use sql() resources
  • The sql-databases preview feature is not enabled

Actual Behavior

A container is created:

nitric-my-project-local-sql   postgres:17.6

Container details:

  • Image: postgres:17.6
  • Environment: POSTGRES_PASSWORD=localsecret
  • Auto-remove: true

Impact

  • Unnecessary resource consumption (Docker container running)
  • Confusion for users who manage their own PostgreSQL separately

Questions

  1. Is this intentional behavior in recent CLI versions?
  2. Is there a way to disable automatic SQL container provisioning?
  3. Should this require explicit opt-in via preview: sql-databases?

Additional Context

Our project uses a separate PostgreSQL instance via docker-compose with Drizzle ORM. The application connects via DATABASE_URL environment variable, not through Nitric's sql() resource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions