Skip to content

DuckDB repeated ensureSchema recreates canonical relation index #222

Open

Description

@philipgreat

Problem

DuckDB's TeaQL schema adapter does not implement the authoritative TeaQLDatabase.indexExists lookup. A second UserContext.ensureSchema() for a model with a forward relation therefore attempts to create the same canonical relation index again and fails with DuckDB's Catalog Error: Index with name ... already exists.

This was independently reproduced in a one-parent/one-child runtime test on a fresh DuckDB file and in the generated task-graph test tracked by teaql/teaql-code-gen#276. No stale database file is involved.

Acceptance

  • Look up secondary indexes in the active DuckDB database/schema and target table; metadata errors must fail closed.
  • Two ensureSchema() calls leave one canonical relation index and both succeed.
  • Run the DuckDB runtime suite and the generated task-graph test twice from a source-matched, isolated Maven cache.
  • Do not suppress all duplicate-index errors or skip relation-index validation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions