Skip to content

Commit

Permalink
adding comments
Browse files Browse the repository at this point in the history
Signed-off-by: Diogenes Fernandes <[email protected]>
  • Loading branch information
diofeher committed Feb 19, 2025
1 parent ed7583b commit 18b46bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions search/worker/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Client } from '@neondatabase/serverless';
import { DBClient } from "./types";
import postgres from "postgres";

// PGClient is used to connect to the local postgres instance. In production, we use a neon serverless database.
// This adapter is created in order to interact and maintain the same API neon serverless uses.
export class PGClient {
db: postgres.Sql
constructor(connection: string) {
Expand All @@ -15,6 +17,7 @@ export class PGClient {

query(query: string, queryParams: string[]): any {
// Adapting to neonserverless/db return of rows
// unsafe usage should be good since we are using this adapter only locally
return { rows: this.db.unsafe(query, queryParams)}
}
}
Expand Down

0 comments on commit 18b46bf

Please sign in to comment.