-
Notifications
You must be signed in to change notification settings - Fork 103
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
Postgres infinity timestamps #91
Conversation
Perhaps I miss something obvious here, but is there really a If I use Infinity in VS Code, I get error 'Name not found' |
Please add/modify integration test. During this part, it may be revealed that the generated ts file with |
@abenhamdine The Infinity name refers to the value Infinity which has type Number. In NodeJS this value is immediately interpretable, @xiamx I updated the expected values in osm.ts and osm-camelcase.ts to expect the correct type (tests compiled and passed locally). Is there another file I should be changing? Thank you both! |
@abenhamdine You're right, I get this error when trying to build a typescript file outside of the project, but interestingly it compiled and passed just fine within the schemats project. I will continue looking into this so we can figure out the best way to cover this case :) |
This is a guess: It's possible that certain installed type definitions, for example |
Something like that yeah, I'm still surprised that Infinity is disallowed as a literal type (for |
Indeed, actually, you cannot use better typing than Otherwise, I don't think mapping sql timestamp to |
PostgreSQL supports the value of 'infinity' for the data types timestamp and timestamptz. The Postgres driver for NodeJS reads this value as Infinity of type Number. This change allows schemats to interpret this value by expanding the type mapping for timestamps to include the value Infinity.