This repository was archived by the owner on Jul 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ Changelog
6868
6969To be released.
7070
71+ - Use the explicitly typed binding instead of an implicit one to work
72+ around the stringification issue.
73+
7174### Version 0.2.1
7275
7376Released on November 3, 2024.
Original file line number Diff line number Diff line change 11import type { KvKey , KvStore , KvStoreSetOptions } from "@fedify/fedify" ;
2- import type { Sql } from "postgres" ;
2+ import type { JSONValue , Sql } from "postgres" ;
33
44/**
55 * Options for the PostgreSQL key-value store.
@@ -84,7 +84,7 @@ export class PostgresKvStore implements KvStore {
8484 INSERT INTO ${ this . #sql( this . #tableName) } (key, value, ttl)
8585 VALUES (
8686 ${ key } ,
87- ( ${ { value } as unknown as string } ::jsonb) -> 'value' ,
87+ ${ this . #sql . json ( value as JSONValue ) } ,
8888 ${ ttl }
8989 )
9090 ON CONFLICT (key)
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export class PostgresMessageQueue implements MessageQueue {
8686 await this . #sql`
8787 INSERT INTO ${ this . #sql( this . #tableName) } (message, delay)
8888 VALUES (
89- ( ${ { message } as unknown as string } ::jsonb) -> 'message' ,
89+ ${ this . #sql . json ( message ) } ,
9090 ${ delay . toString ( ) }
9191 );
9292 ` ;
You can’t perform that action at this time.
0 commit comments