@lambdaorm/lib 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e378532: PostgreSQL: the date functions (`year`, `month`, `day`, `weekday`, `hour`, `minute`, `second`, `millisecond`, `addYear` … `addMillisecond`, `addTime`, `subtractTime`, `dayDiff`, `hourDiff`, `secondDiff`, `millisecondDiff`) work on a column: they generated `timestamp c.createdAt`, a syntax error (that form only takes a string literal); now `(c.createdAt)::timestamp`.
8
+
3
9
  ## 3.5.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdaorm/lib",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "LambdaORM core library",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -1734,27 +1734,27 @@
1734
1734
  "dateTime": "to_char({0}::timestamp at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\".\"MS\"Z\"')",
1735
1735
  "date": "to_char({0}::timestamp at time zone 'UTC', 'YYYY-MM-DD')",
1736
1736
  "time": "to_char({0}::timestamp at time zone 'UTC', 'HH24:MI:SS')",
1737
- "year": "date_part('year', timestamp {0})",
1738
- "month": "date_part('month', timestamp {0})",
1739
- "day": "date_part('day', timestamp {0})",
1740
- "weekday": "extract(dow from timestamp {0})",
1741
- "hour": "date_part('hour', timestamp {0})",
1742
- "minute": "date_part('minute', timestamp {0})",
1743
- "second": "date_part('second', timestamp {0})",
1744
- "millisecond": "mod(extract('millisecond' from timestamp {0})::decimal/1000,1)*1000",
1745
- "addYear": "(timestamp {0} + ({1} * INTERVAL '1 year'))",
1746
- "addMonth": "(timestamp {0} + ({1} * INTERVAL '1 month'))",
1747
- "addDay": "(timestamp {0} + ({1} * INTERVAL '1 day'))",
1748
- "addHour": "(timestamp {0} + ({1} * INTERVAL '1 hour'))",
1749
- "addMinute": "(timestamp {0} + ({1} * INTERVAL '1 minute'))",
1750
- "addSecond": "(timestamp {0} + ({1} * INTERVAL '1 second'))",
1751
- "addMillisecond": "(timestamp {0} + ({1} * INTERVAL '1 millisecond'))",
1752
- "addTime": "(timestamp {0} + time {1})",
1753
- "subtractTime": "(timestamp {0} - time {1})",
1754
- "dayDiff": "(extract('epoch' from (timestamp {0} - timestamp {1} ))/ (24 * 3600))",
1755
- "hourDiff": "(extract('epoch' from (timestamp {0} - timestamp {1} ))/3600)",
1756
- "secondDiff": "extract('epoch' from (timestamp {0} - timestamp {1} ))",
1757
- "millisecondDiff": "(extract('epoch' from (timestamp {0} - timestamp {1} ))*1000)",
1737
+ "year": "date_part('year', ({0})::timestamp)",
1738
+ "month": "date_part('month', ({0})::timestamp)",
1739
+ "day": "date_part('day', ({0})::timestamp)",
1740
+ "weekday": "extract(dow from ({0})::timestamp)",
1741
+ "hour": "date_part('hour', ({0})::timestamp)",
1742
+ "minute": "date_part('minute', ({0})::timestamp)",
1743
+ "second": "date_part('second', ({0})::timestamp)",
1744
+ "millisecond": "mod(extract('millisecond' from ({0})::timestamp)::decimal/1000,1)*1000",
1745
+ "addYear": "(({0})::timestamp + ({1} * INTERVAL '1 year'))",
1746
+ "addMonth": "(({0})::timestamp + ({1} * INTERVAL '1 month'))",
1747
+ "addDay": "(({0})::timestamp + ({1} * INTERVAL '1 day'))",
1748
+ "addHour": "(({0})::timestamp + ({1} * INTERVAL '1 hour'))",
1749
+ "addMinute": "(({0})::timestamp + ({1} * INTERVAL '1 minute'))",
1750
+ "addSecond": "(({0})::timestamp + ({1} * INTERVAL '1 second'))",
1751
+ "addMillisecond": "(({0})::timestamp + ({1} * INTERVAL '1 millisecond'))",
1752
+ "addTime": "(({0})::timestamp + ({1})::time)",
1753
+ "subtractTime": "(({0})::timestamp - ({1})::time)",
1754
+ "dayDiff": "(extract('epoch' from (({0})::timestamp - ({1})::timestamp ))/ (24 * 3600))",
1755
+ "hourDiff": "(extract('epoch' from (({0})::timestamp - ({1})::timestamp ))/3600)",
1756
+ "secondDiff": "extract('epoch' from (({0})::timestamp - ({1})::timestamp ))",
1757
+ "millisecondDiff": "(extract('epoch' from (({0})::timestamp - ({1})::timestamp ))*1000)",
1758
1758
  "dayToDate": "to_char(TO_TIMESTAMP({0}*24*3600*1000)::timestamp, 'YYYY-MM-DD\"T\"HH24:MI:SS\".\"MS\"Z\"')",
1759
1759
  "hourToDate": "to_char(TO_TIMESTAMP({0}*3600*1000)::timestamp, 'YYYY-MM-DD\"T\"HH24:MI:SS\".\"MS\"Z\"')",
1760
1760
  "secondToDate": "to_char(TO_TIMESTAMP({0}*1000)::timestamp, 'YYYY-MM-DD\"T\"HH24:MI:SS\".\"MS\"Z\"')",