typeorm/typeorm · error · TypeORMError

You cannot initialize a project with docker for Oracle drive

Error message

You cannot initialize a project with docker for Oracle driver yet.

What it means

Thrown by InitCommand's docker-compose template generator for the 'oracle' case. Docker-based Oracle scaffolding has not been implemented (the code carries a TODO), so requesting --docker with the oracle driver is explicitly rejected rather than emitting an incomplete compose file.

Source

Thrown at src/commands/InitCommand.ts:633

      POSTGRES_PASSWORD: "password"
      POSTGRES_DB: "typeorm"

`
            case "cockroachdb":
                return `services:

  cockroachdb:
    image: "cockroachdb/cockroach:v25.1.2"
    command: start --insecure
    ports:
      - "26257:26257"

`
            case "better-sqlite3":
                throw new TypeORMError(`SQLite does not require docker`)

            case "oracle":
                throw new TypeORMError(
                    `You cannot initialize a project with docker for Oracle driver yet.`,
                ) // todo: implement for oracle as well

            case "mssql":
                return `services:

  mssql:
    image: "mcr.microsoft.com/mssql/server:2022-latest"
    ports:
      - "1433:1433"
    environment:
      SA_PASSWORD: "Admin12345"
      ACCEPT_EULA: "Y"
      MSSQL_PID: "Express"

`
            case "mongodb":
                return `services:

View on GitHub (pinned to 04ff4daedc)

Solutions

  1. Drop --docker and provide Oracle connection details manually (host/port/sid) to an existing Oracle instance.
  2. Provide your own docker-compose for Oracle (e.g. gvenzl/oracle-xe image) and skip the built-in docker generation.
  3. Watch for / upgrade to a typeorm version that implements Oracle docker scaffolding.

Example fix

// before
$ typeorm init --db oracle --docker
// You cannot initialize a project with docker for Oracle driver yet.

// after
$ typeorm init --db oracle   # then add Oracle to compose manually
Defensive patterns

Strategy: validation

Validate before calling

const DOCKER_UNSUPPORTED = ['better-sqlite3', 'oracle'] as const
const dockerSupported = (db: string): boolean => !(DOCKER_UNSUPPORTED as readonly string[]).includes(db)

Type guard

const canInitWithDocker = (db: string): boolean => db !== 'better-sqlite3' && db !== 'oracle'

Prevention

When it happens

Trigger: Running `typeorm init --db oracle --docker` which routes the oracle case into the docker-compose template generator.

Common situations: Wanting a local Oracle dev container via the init scaffold; following a uniform --docker workflow across drivers; not realising Oracle docker support is pending in the generator.

Related errors


AI-assisted analysis of typeorm/typeorm@04ff4daedc (2026-08-03). Data as JSON: /data/errors/7d58ad704de38e2c.json. Report an issue: GitHub.