Skip to content

Columns are duplicated when generating types #20

Open
@tigitz

Description

Expected Behavior

import { z } from 'zod';

export const Table = z.object({
  column: z.number().int().nullable().optional(),
});

export type TableT = z.infer<typeof Table>;

Actual Behavior

import { z } from 'zod';

export const Table = z.object({
  column: z.number().int().nullable().optional(),
  column: z.number().int().nullable().optional(),
});

export type TableT = z.infer<typeof Table>;

Steps to Reproduce the Problem

Have a table in schema1

create table schema1."table"
(
    "column" integer
);

Create a view from this table in an other schema2

CREATE VIEW schema2.table as (
SELECT * FROM schema1.table
)

Generate types from schema2

Specifications

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