cloudflare-next-intl 0.8.14 → 0.8.15

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.
@@ -37,8 +37,12 @@ export declare function excluded<T extends Table>(table: T): {
37
37
  */
38
38
  export declare function onConflictSet<T extends Table, K extends keyof T["_"]["columns"]>(table: T, fields: K[]): Record<string, SQL>;
39
39
  export type TimeUnit = "days" | "hours" | "minutes" | "months" | "years" | "weeks";
40
+ /** General SQL helper returning `now()`. */
41
+ export declare function now(): SQL;
40
42
  /** General SQL helper generating a timestamp expression relative to now (`now() - (N unit)::interval`). */
41
43
  export declare function ago(amount: number, unit: TimeUnit): SQL;
44
+ /** General SQL helper generating a timestamp expression ahead of now (`now() + (N unit)::interval`). */
45
+ export declare function fromNow(amount: number, unit: TimeUnit): SQL;
42
46
  /** General SQL helper returning `current_date`. */
43
47
  export declare function currentDate(): SQL;
44
48
  /** General SQL helper for window function `count(*) over ()`. */
@@ -66,10 +66,18 @@ export function onConflictSet(table, fields) {
66
66
  }
67
67
  return setObj;
68
68
  }
69
+ /** General SQL helper returning `now()`. */
70
+ export function now() {
71
+ return sql `now()`;
72
+ }
69
73
  /** General SQL helper generating a timestamp expression relative to now (`now() - (N unit)::interval`). */
70
74
  export function ago(amount, unit) {
71
75
  return sql `now() - (${amount} || ' ' || ${unit})::interval`;
72
76
  }
77
+ /** General SQL helper generating a timestamp expression ahead of now (`now() + (N unit)::interval`). */
78
+ export function fromNow(amount, unit) {
79
+ return sql `now() + (${amount} || ' ' || ${unit})::interval`;
80
+ }
73
81
  /** General SQL helper returning `current_date`. */
74
82
  export function currentDate() {
75
83
  return sql `current_date`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-next-intl",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
4
4
  "description": "Optimized Next Intl Package Special for App Router and Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",