Add DEFAULT support for CURRENT_DATE, CURRENT_TIME, LOCALTIME, LOCALTIMESTAMP#963
Add DEFAULT support for CURRENT_DATE, CURRENT_TIME, LOCALTIME, LOCALTIMESTAMP#963
Conversation
…IMESTAMP Expand automatic SQL function handling in getDefaultValueDefinition() to support more standard SQL datetime functions without requiring Literal::from(): - CURRENT_DATE for date columns - CURRENT_TIME for time columns - LOCALTIME for time columns - LOCALTIMESTAMP for datetime/timestamp columns Each function is only unquoted when used with appropriate column types. Using them with incompatible types (e.g., CURRENT_DATE on a string column) will quote the value as a literal string. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
I am also fine not supporting LOCALTIMESTAMP/LOCALTIME in favor of the other 3, if we want to keep it simpler. |
I don't think we have support for LOCALTIME/LOCALTIMESTAMP in the reflection APIs. That will make snapshots lossy. |
|
I guess you are also not interested in supporting them correct? Otherwise we could fix up core support first here. |
We've never had anyone ask for support for them. We can always add support in the future when folks need it. |
|
if no one asked for it yet, maybe we dont need to widen the scope now. |
Summary
Literal::from()CURRENT_DATEsupport fordatecolumnsCURRENT_TIMEandLOCALTIMEsupport fortimecolumnsAddLOCALTIMESTAMPsupport fordatetime/timestampcolumnsDetails
CURRENT_TIMESTAMPCURRENT_DATECURRENT_TIMEDropped (not supported yet also in ORM):
LOCALTIMESTAMPLOCALTIMEEach function is only left unquoted when used with appropriate column types. Using them with incompatible types (e.g.,
CURRENT_DATEon a string column) will quote the value as a literal string.Usage