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

Type mismatch for LIMIT #139

Closed
meoyawn opened this issue Jul 23, 2020 · 3 comments
Closed

Type mismatch for LIMIT #139

meoyawn opened this issue Jul 23, 2020 · 3 comments

Comments

@meoyawn
Copy link

meoyawn commented Jul 23, 2020

/* @name testing */
SELECT *
FROM expenses
LIMIT :limit;

generates

/** 'Testing' parameters type */
export interface ITestingParams {
  limit: string | null | void;
}

I'm not too sure, but it should probably be limit: number

@silasdavis
Copy link
Contributor

silasdavis commented Jul 23, 2020

This will be the same underlying issue as: #117 limit is a postgres bigint and may not fit in a Javascript number.

For modern JS the nice thing to do would be to support BigInt by default probably.

@meoyawn
Copy link
Author

meoyawn commented Jul 24, 2020

@silasdavis thanks! I guess this could be solved with combination of #60 and https://github.com/brianc/node-pg-types

@adelsz
Copy link
Owner

adelsz commented Jul 25, 2020

Thanks @meoyawn @silasdavis!
Tracking this here #145

@adelsz adelsz closed this as completed Jul 25, 2020
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

3 participants