Skip to content

Commit

Permalink
fix: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Nov 23, 2024
1 parent b905ca1 commit 05072bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/adapter-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ export class PostgresDatabaseAdapter
.map((_, i) => `$${i + 3}`)
.join(", ");

let query = `SELECT * FROM memories WHERE type = $1 AND "agentId" = $2 AND "roomId" IN (${placeholders})`;
let queryParams = [params.tableName, params.agentId, ...params.roomIds];
const query = `SELECT * FROM memories WHERE type = $1 AND "agentId" = $2 AND "roomId" IN (${placeholders})`;
const queryParams = [
params.tableName,
params.agentId,
...params.roomIds,
];

const { rows } = await this.query(query, queryParams);
return rows.map((row) => ({
Expand Down
8 changes: 6 additions & 2 deletions packages/adapter-sqlite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ export class SqliteDatabaseAdapter
params.tableName = "messages";
}
const placeholders = params.roomIds.map(() => "?").join(", ");
let sql = `SELECT * FROM memories WHERE type = ? AND agentId = ? AND roomId IN (${placeholders})`;
let queryParams = [params.tableName, params.agentId, ...params.roomIds];
const sql = `SELECT * FROM memories WHERE type = ? AND agentId = ? AND roomId IN (${placeholders})`;
const queryParams = [
params.tableName,
params.agentId,
...params.roomIds,
];

const stmt = this.db.prepare(sql);
const rows = stmt.all(...queryParams) as (Memory & {
Expand Down

0 comments on commit 05072bd

Please sign in to comment.