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

Allow using Date as a value #26

Merged
merged 2 commits into from
Jan 31, 2022
Merged

Allow using Date as a value #26

merged 2 commits into from
Jan 31, 2022

Conversation

Rauttis
Copy link
Contributor

@Rauttis Rauttis commented Jan 31, 2022

Both pg and mysql allow you to pass Date instances as values and do the correct transformation for you.

This was allowed in sql-template-tag as well until the Value type was made more strict in d1fb92e.

@blakeembrey
Copy link
Owner

Ah, thank you! This was my mistake, tried to make it stricter to avoid user error. Do you have any opinion on expanding types vs just making it unknown? I wasn't sure about the better approach here since technically anything could work but some things like a random class could be user error.

@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #26 (4d5a183) into main (a1715b2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #26   +/-   ##
=======================================
  Coverage   95.55%   95.55%           
=======================================
  Files           1        1           
  Lines          45       45           
  Branches        6        6           
=======================================
  Hits           43       43           
  Misses          2        2           
Impacted Files Coverage Δ
src/index.ts 95.55% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1715b2...4d5a183. Read the comment docs.

@blakeembrey blakeembrey merged commit 91dff99 into blakeembrey:main Jan 31, 2022
@Rauttis
Copy link
Contributor Author

Rauttis commented Feb 3, 2022

Ah, thank you! This was my mistake, tried to make it stricter to avoid user error. Do you have any opinion on expanding types vs just making it unknown? I wasn't sure about the better approach here since technically anything could work but some things like a random class could be user error.

I like that there's some type safety there, but trying to support every use case people will have without just making it any/unknown is probably futile, since anything that can be stringified should be fair game.

Also thanks for the quick merge & release!

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

Successfully merging this pull request may close these issues.

2 participants