Add default returning record on db insert and update
This commit is contained in:
Vendored
+7
-1
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user