So far, I've used a type parser (pg.types.setTypeParser(pg.types.builtins.DATE, (val) => val.toString())) to get the selected value as a string by default, otherwise it returns JS Date object, and I need to explicitly select it using sql<string>${ref('date')}::text``.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The
Date
type in Postgres (haven't checked other dialects) is used for date-only data, like'YYYY-MM-DD'
, etc (see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-INPUT-DATES). In the generator here, it's using aTimestamp
definition. IMO, astring
would be more correct. What do you think?So far, I've used a type parser (
pg.types.setTypeParser(pg.types.builtins.DATE, (val) => val.toString())
) to get the selected value as a string by default, otherwise it returns JS Date object, and I need to explicitly select it usingsql<string>
${ref('date')}::text``.Upvote & Fund