Skip to content

Add Oracle dialect plugin #11

Description

@KKranthi6881

Problem

Oracle is currently handled via the legacy generators.py path only. Every other dialect (postgres, snowflake) has moved to the plugin registry under packages/core_engine/src/datalex_core/dialects/, which is the supported extension point going forward.

Goal

Ship a first-class Oracle dialect plugin at datalex_core/dialects/oracle.py that:

  • Implements the DialectPlugin protocol in dialects/base.py.
  • Maps DataLex logical types to Oracle physical types (stringVARCHAR2, timestampTIMESTAMP WITH TIME ZONE, etc.).
  • Emits CREATE TABLE, ALTER TABLE ADD CONSTRAINT, CREATE INDEX matching Oracle's quoting and identifier-length rules (note: default 30-char identifier limit before 12.2).
  • Registers itself via registry.register("oracle", OracleDialect()).

Suggested approach

  1. Read dialects/postgres.py as a working template.
  2. Stub out oracle.py with the type map + render_type.
  3. Add a golden-file test under tests/round_trip/test_oracle.py modelled on the Postgres tests.
  4. Remove Oracle branches from the legacy generators.py once parity is verified.

Acceptance criteria

  • datalex emit ddl --dialect oracle <project> produces valid Oracle DDL.
  • Round-trip test: DDL → connector-import → DDL emits byte-identical.
  • Identifier-length policy enforced (truncation with warning, not silent corruption).

Why this is a good first issue

Mechanical, pattern-matched work against existing plugins. No async, no schema changes. You'll touch one new file plus tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions