Skip to content

Not generating types for a Materialized View #72

@dargue3

Description

@dargue3

Hey! Thanks for the repo it's been saving me so much time!

I've got a table and a corresponding materialized view that I've spun off of it to add further indices. It seems like the codegen is not picking up on this new view and I was wondering if that's a limitation or just something I'm missing in the options? Similar to the following:

CREATE TABLE users
(
    id   INT  NOT NULL,
    name TEXT NOT NULL
);

CREATE MATERIALIZED VIEW users_mv AS
SELECT id,
       name
FROM users;

My kysely-codegen command is like this:

./node_modules/.bin/kysely-codegen \
  --camel-case \
  --dialect postgres \
  --url $DATABASE_URL \
  --out-file $SCHEMA_PATH

Once I've done this, I correctly see the types for Users however there are no types for the materialize view, and thus, when I do something like db.selectFrom('users_mv') it's giving me a TypeError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions