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

The type passed into the generic shouldn't have to be specified as an array #647

Open
bryiac opened this issue Jul 20, 2023 · 1 comment
Labels
help wanted Extra attention is needed Typescript

Comments

@bryiac
Copy link

bryiac commented Jul 20, 2023

Currently using the library you would pass your type as such

type User = {
  email: string
  password: string
}

const [user] = await sql<U͟s͟e͟r[]>`
  SELECT * FROM example;
`;

console.log(user.email);

Though its not a huge deal I feel as code quality would be better with simply omitting it

type User = {
  email: string
  password: string
}

const [user] = await sql<U͟s͟e͟r>`
  SELECT * FROM example;
`;

console.log(user.email);

You can even see an example of this on the typescript documentation

@GuilhermeAmado
Copy link

Any updates on this?

@porsager porsager added help wanted Extra attention is needed Typescript labels Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Typescript
Projects
None yet
Development

No branches or pull requests

3 participants