Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Columns are duplicated when generating types #20

Open
tigitz opened this issue Dec 30, 2023 · 0 comments
Open

Columns are duplicated when generating types #20

tigitz opened this issue Dec 30, 2023 · 0 comments

Comments

@tigitz
Copy link

tigitz commented Dec 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant