-
Notifications
You must be signed in to change notification settings - Fork 25
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
Bigint issue with tedious #24
Comments
Hello, thanks for a detailed question. Please try using the TypeORM transformer property according to the Entities documentation: @Index()
@Column("bigint", {
transformer: {
from: (db: string) => Number(db),
to: (js: number) => String(js)
}
})
public expiredAt: number; I don't currently have an SQL Server instance to test this, so if you find you need to make any edit for it to work, please share your changes. |
Thank you for the prompt response. The transformer property allowed for the session to be inserted to the database successfully; however, when reading the session on a second call the error is still thrown. I will continue to work with it to see if there is something obvious that I am missing. If I don't find success I will create a minimum repo that reproduces the error and post it here. |
I created a repo to demonstrate the issue. Let me know if there are any issues. |
I'm pretty new with node so forgive me if I'm asking in the wrong place.
After following the readme, I'm running into this error: RequestError: Validation failed for parameter '0'. Value must be between -2147483648 and 2147483647
The query it is trying to run:
query failed: SELECT "session"."id" AS "session_id", "session"."expiredAt" AS "session_expiredAt", "session"."json" AS "session_json" FROM "session" "session" WHERE "session"."expiredAt" > @0 AND "session"."id" = @1 -- PARAMETERS: [1614629900663,"2XztQAQI5icnM_us9nQvu-VramBgMxQ_"]
After debuging some I found that issue seems to be at the Request.validateParameters method for the tedious library is getting a type INT8 instead of a type BigInt.
This is trying to process it as an int instead of the string that tedious needs as described here:
http://tediousjs.github.io/tedious/api-datatypes.html
Any idea on how to pass the ExpiresAt property as a string to tedious?
Code:
Use
Thanks
The text was updated successfully, but these errors were encountered: