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

Add support for DATE type (values with a date part but no time part) #1966

Closed
bajtos opened this issue Nov 2, 2018 · 3 comments
Closed

Add support for DATE type (values with a date part but no time part) #1966

bajtos opened this issue Nov 2, 2018 · 3 comments

Comments

@bajtos
Copy link
Member

bajtos commented Nov 2, 2018

Based on the discussion in #1948, I am proposing to introduce a new type to represent SQL DATE values (a value with a date part but no time part).

  • We should probably introduce a new interface or class to represent these values.
  • Internally, dates should be stored as strings to avoid a whole set of timezone-related problems.
  • JSON Schema/OpenAPI schema should use {type: 'string', format: 'date'}
  • Connectors should recognize this new type at runtime, during discovery and autoupdate too.
  • We may need to configure the connectors to return DATE values as strings (not JavaScript Date instances). See MySQL connector's option dateStrings for an example.

Related work: DateString type provided by juggler. See loopbackio/loopback-datasource-juggler#1356, loopbackio/loopback-datasource-juggler#1365, the api docs and a possible bug loopbackio/loopback-datasource-juggler#1636. Please note that DateString is not the solution we are looking for, at least not in the current form! (See the discussion in #1948 for explanation.)

@bajtos
Copy link
Member Author

bajtos commented Jun 14, 2019

Heads up: it may be difficult to support DATE in PostgreSQL, it seems like DATE values are always converted to JavaScript's Date. See brianc/node-postgres#1844, brianc/node-postgres#783, brianc/node-postgres#510 and linked issues/pull-requests.

@stale
Copy link

stale bot commented Jun 9, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Jun 9, 2020
@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants