tekumara / fakesnow

Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
Apache License 2.0
83 stars 7 forks source link

feat: add timeadd as an alias for dateadd #73

Closed seruman closed 3 months ago

seruman commented 3 months ago

sqlglot~=21.2.0 does not support timeadd for Snowflake, this transform simply tries to convert it to DateAdd.

sqlglot v23.1.0 adds timeadd/addtime with https://github.com/tobymao/sqlglot/pull/3180/files but upgrade would require changes on other transforms like to_timestamp and ones with json extraction.

tekumara commented 3 months ago

Ah it's probably best to do the upgrade of sqlglot. I try to keep it on the latest but have fallen behind.

seruman commented 3 months ago

Ah it's probably best to do the upgrade of sqlglot. I try to keep it on the latest but have fallen behind.

Might be better, on my fork I've bumped it to v22.4.0 for following changes; https://github.com/tobymao/sqlglot/commit/c51b64fa6a437698fd8b347d98ffaf9fb543d2d5 https://github.com/tobymao/sqlglot/commit/ddab9dff663985d9473ce4b2dbe4fe266ae1bdf7 https://github.com/tobymao/sqlglot/commit/c333017fe49c0645cdaa3a75d0a7cc6a5b46dddc

I can close this PR and work on the upgrade. sqlglot is evolving in a fast pace, do you have a preferred version or the latest is ok?

tekumara commented 3 months ago

That would be great, thankyou! The latest and greatest version 🙂