supabase / postgres-meta

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries
https://supabase.com
Apache License 2.0
854 stars 112 forks source link

Generate types for foreign tables #579

Closed bastiaanv closed 3 months ago

bastiaanv commented 1 year ago

Bug report

Describe the bug

When running Supabase gen typescript --db-url <URL> > database.ts the tables that are connected via FDW to ClickHouse are not generating types

To Reproduce

  1. Setup FDW and create a ClickHouse handler. Then create a foreign table like this:

    create foreign table glucose (
    timestamp timestamp,
    profile_id text,
    sensor_id text,
    glucose_mmol real,
    glucose_mg integer
    )
    server clickhouse_server
    options (
    table 'glucose',
    rowid_column 'timestamp'
    );
  2. First create docker image:

    docker run -e PG_META_DB_URL=<URL> -it supabase/postgres-meta:v0.65.0 bash
  3. Run generate types command:

    node dist/server/app.js gen types typescript --include-schemas public > database.ts
  4. Notice the foreign tables are not listed in the database.ts

Expected behavior

To have all foreign tables to be listed

System information

thisisamir98 commented 8 months ago

@bastiaanv I'm also facing the same issue with my project but with stripe wrapper integration, have you found any workarounds on this?

bastiaanv commented 8 months ago

No I did not. Made the types myself

codingisforlosers commented 8 months ago

Upvoting!

zgiuricich7 commented 7 months ago

Also running into this issue for the stripe wrapper integration.

GportDev commented 5 months ago

Also running into the same issue for stripe wrapper integration