Skip to content

Commit

Permalink
fix: always add { success: true } to select results (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
amandesai01 authored Jan 24, 2025
1 parent 54e81ed commit 9057f08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function createDatabase<TConnector extends Connector = Connector>(
const rows = await connector.prepare(sql).all(...params);
return {
rows,
success: true,
};
} else {
const res = await connector.prepare(sql).run(...params);
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type DefaultSQLResult = {
changes?: number;
error?: string;
rows?: { id?: string | number; [key: string]: unknown }[];
success?: boolean;
};

export interface Database<TConnector extends Connector = Connector> {
Expand Down

0 comments on commit 9057f08

Please sign in to comment.