@fedify/postgres 2.3.0 → 2.3.2-dev.1556

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/dist/kv.cjs CHANGED
@@ -56,7 +56,7 @@ var PostgresKvStore = class {
56
56
  }
57
57
  async set(key, value, options) {
58
58
  await this.initialize();
59
- const ttl = options?.ttl == null ? null : options.ttl.toString();
59
+ const ttl = options?.ttl == null ? null : Temporal.Duration.from(options.ttl).toString();
60
60
  await this.#sql`
61
61
  INSERT INTO ${this.#sql(this.#tableName)} (key, value, ttl)
62
62
  VALUES (
@@ -65,7 +65,10 @@ var PostgresKvStore = class {
65
65
  ${ttl}
66
66
  )
67
67
  ON CONFLICT (key)
68
- DO UPDATE SET value = EXCLUDED.value, ttl = EXCLUDED.ttl;
68
+ DO UPDATE SET
69
+ value = EXCLUDED.value,
70
+ created = CURRENT_TIMESTAMP,
71
+ ttl = EXCLUDED.ttl;
69
72
  `;
70
73
  await this.#expire();
71
74
  }
package/dist/kv.js CHANGED
@@ -55,7 +55,7 @@ var PostgresKvStore = class {
55
55
  }
56
56
  async set(key, value, options) {
57
57
  await this.initialize();
58
- const ttl = options?.ttl == null ? null : options.ttl.toString();
58
+ const ttl = options?.ttl == null ? null : Temporal.Duration.from(options.ttl).toString();
59
59
  await this.#sql`
60
60
  INSERT INTO ${this.#sql(this.#tableName)} (key, value, ttl)
61
61
  VALUES (
@@ -64,7 +64,10 @@ var PostgresKvStore = class {
64
64
  ${ttl}
65
65
  )
66
66
  ON CONFLICT (key)
67
- DO UPDATE SET value = EXCLUDED.value, ttl = EXCLUDED.ttl;
67
+ DO UPDATE SET
68
+ value = EXCLUDED.value,
69
+ created = CURRENT_TIMESTAMP,
70
+ ttl = EXCLUDED.ttl;
68
71
  `;
69
72
  await this.#expire();
70
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/postgres",
3
- "version": "2.3.0",
3
+ "version": "2.3.2-dev.1556+3e14f2d7",
4
4
  "description": "PostgreSQL drivers for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -74,14 +74,14 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "postgres": "^3.4.7",
77
- "@fedify/fedify": "^2.3.0"
77
+ "@fedify/fedify": "^2.3.2-dev.1556+3e14f2d7"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@std/async": "npm:@jsr/std__async@^1.0.13",
81
81
  "tsdown": "^0.22.0",
82
82
  "typescript": "^6.0.0",
83
83
  "@fedify/fixture": "^2.0.0",
84
- "@fedify/testing": "^2.3.0"
84
+ "@fedify/testing": "^2.3.2-dev.1556+3e14f2d7"
85
85
  },
86
86
  "scripts": {
87
87
  "build:self": "tsdown",