Add default returning record on db insert and update

This commit is contained in:
2026-10-17 18:44:26 +01:00
parent 695347944d
commit 07807cb19d
5 changed files with 73 additions and 9 deletions
+7 -1
View File
@@ -8,11 +8,17 @@ type Params<Schema extends {
data: Schema;
query?: ServerQueryParam<Schema>;
targetId?: number | string;
/**
* Append `RETURNING *` so the updated record(s) come back in
* `payload`/`singleRes`. Defaults to `true`. Ignored for vector tables,
* where SQLite does not support `UPDATE ... RETURNING`.
*/
returning?: boolean;
config?: BunSQLiteConfig;
};
export default function DbUpdate<Schema extends {
[k: string]: any;
} = {
[k: string]: any;
}, Table extends string = string>({ table, data, query, targetId, config, }: Params<Schema, Table>): Promise<APIResponseObject>;
}, Table extends string = string>({ table, data, query, targetId, returning, config, }: Params<Schema, Table>): Promise<APIResponseObject<Schema>>;
export {};