Loading README.md +3 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ Changelog To be released. - Use the explicitly typed binding instead of an implicit one to work around the stringification issue. ### Version 0.2.1 Released on November 3, 2024. Loading src/kv.ts +2 −2 Original line number Diff line number Diff line import type { KvKey, KvStore, KvStoreSetOptions } from "@fedify/fedify"; import type { Sql } from "postgres"; import type { JSONValue, Sql } from "postgres"; /** * Options for the PostgreSQL key-value store. Loading Loading @@ -84,7 +84,7 @@ export class PostgresKvStore implements KvStore { INSERT INTO ${this.#sql(this.#tableName)} (key, value, ttl) VALUES ( ${key}, (${{ value } as unknown as string}::jsonb) -> 'value', ${this.#sql.json(value as JSONValue)}, ${ttl} ) ON CONFLICT (key) Loading src/mq.ts +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ export class PostgresMessageQueue implements MessageQueue { await this.#sql` INSERT INTO ${this.#sql(this.#tableName)} (message, delay) VALUES ( (${{ message } as unknown as string}::jsonb) -> 'message', ${this.#sql.json(message)}, ${delay.toString()} ); `; Loading Loading
README.md +3 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ Changelog To be released. - Use the explicitly typed binding instead of an implicit one to work around the stringification issue. ### Version 0.2.1 Released on November 3, 2024. Loading
src/kv.ts +2 −2 Original line number Diff line number Diff line import type { KvKey, KvStore, KvStoreSetOptions } from "@fedify/fedify"; import type { Sql } from "postgres"; import type { JSONValue, Sql } from "postgres"; /** * Options for the PostgreSQL key-value store. Loading Loading @@ -84,7 +84,7 @@ export class PostgresKvStore implements KvStore { INSERT INTO ${this.#sql(this.#tableName)} (key, value, ttl) VALUES ( ${key}, (${{ value } as unknown as string}::jsonb) -> 'value', ${this.#sql.json(value as JSONValue)}, ${ttl} ) ON CONFLICT (key) Loading
src/mq.ts +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ export class PostgresMessageQueue implements MessageQueue { await this.#sql` INSERT INTO ${this.#sql(this.#tableName)} (message, delay) VALUES ( (${{ message } as unknown as string}::jsonb) -> 'message', ${this.#sql.json(message)}, ${delay.toString()} ); `; Loading