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

Support for domains #16

Open
NBprojekt opened this issue Mar 9, 2022 · 0 comments
Open

Support for domains #16

NBprojekt opened this issue Mar 9, 2022 · 0 comments

Comments

@NBprojekt
Copy link

NBprojekt commented Mar 9, 2022

In my database I use custom domain like:

Create Domain email As text;
Create Domain phone_number As varChar(16);

Currently when I generate the types, it seams to work in general but fails for arrays.

In this example all columns are from type email or email[]

SQL
Create Table private.email (
  email_from                    email           not null,
  email_reply_to               email               null,
  email_to                      email[]         not null,
  email_cc                      email[]             null,
  email_bcc                     email[]             null,

TS
export type PrivateEmail = {
  from: string; 
  reply_to: string | null;
  to: unknown[];
  cc: unknown[] | null;

In my opinion, it would be a nice addition if the domain got its own type.
e.g.

SQL
Create Domain email As text;

TS
export type email = string;
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