Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Postgres DB schema introspection incomplete/empty (PK/FK missing in playground/db-schema, information_schema query returns no rows) — blocks programmatic Data Model generation #10228

Open
@CamiloAguilarL

Description

@CamiloAguilarL

Description

I’m trying to extract the database schema from a Postgres instance connected to Cube (CubeJS), but none of the approaches I tried work correctly.

My goal is to reliably retrieve tables/columns plusprimary keys and foreign keys, so I can generateData Models programmatically (or at least validate/derive relationships). However:

1)playground/db-schema endpoint

I tried the Playground endpointplayground/db-schema (I understand this might not be intended for production use), but the output doesnot correctly include primary keys or foreign keys. Relationships appear incomplete/incorrect.

2) Queryinginformation_schema via CubeSQL API

I tried using the CubeSQL API endpoint:

POST /cubejs-api/v1/cubesql{"query":"SELECT * FROM information_schema.constraint_column_usage"}

But it returnsno rows at all (empty result), even though the underlying Postgres database definitely has constraints.

3) Importing/using the server library (introspection during cube build)

I also tried importing the server library and noticed the failure seems related toaccessing certain system tables/views (like the example above). When those queries fail or return empty, cubes cannot be built correctly / the introspection-based parts break.

Environment

  • Database:PostgreSQL
  • Deployment: Docker / Node
  • Works the samewith existing Data Models andwithout any Data Models (problem persists either way)

Expected behavior

  • A supported/reliable way to fetch DB schema metadata from Cube for Postgres, including:

    • tables and columns
    • primary keys
    • foreign keys / relationships
  • information_schema queries should return expected rows when executed via CubeSQL (or clear documentation if they are intentionally blocked).

  • Ifplayground/db-schema is not intended to be used, guidance on the correct endpoint / recommended approach.

Actual behavior

  • playground/db-schema returns incomplete schema data (PK/FK missing or incorrect).
  • SELECT * FROM information_schema.constraint_column_usage via/cubejs-api/v1/cubesql returns no rows.
  • Introspection seems to fail on certain metadata tables/views, preventing correct cube/data model generation.

Questions

  1. Is this a known limitation/bug for Postgres schema introspection in Cube?
  2. Areinformation_schema /pg_catalog queries restricted/filtered when running through CubeSQL? If so, is there a way to allow them?
  3. What is the recommended/supported way to query a database schema through Cube?
  4. Is there an official way tocreate Data Models programmatically (or generate them from schema metadata) that Cube supports?

Reproduction steps (high level)

  1. Connect Cube to a Postgres DB with PK/FK constraints.

  2. Callplayground/db-schema and check whether PK/FK are present/correct.

  3. Call/cubejs-api/v1/cubesql with:

    SELECT*FROMinformation_schema.constraint_column_usage;
  4. Observe empty results and incomplete/failed introspection.

Additional info / logs

If needed, I can provide:

  • Cube logs around schema introspection / cube build
  • Postgres version and sample schema (sanitized)
  • The exact Cube config and connection settings

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp