supabase/postgres-meta

Generate types for foreign tables

bastiaanv opened this issue · 5 comments

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'
  );
  1. First create docker image:
docker run -e PG_META_DB_URL=<URL> -it supabase/postgres-meta:v0.65.0 bash
  1. Run generate types command:
node dist/server/app.js gen types typescript --include-schemas public > database.ts
  1. Notice the foreign tables are not listed in the database.ts

Expected behavior

To have all foreign tables to be listed

System information

  • OS: MacOS
  • Version of Supabase-cli: 1.38.7
  • Version of pgmeta: v0.65.0
  • Version of Node.js: v19.6.1

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

No I did not. Made the types myself

Upvoting!

Also running into this issue for the stripe wrapper integration.