26 lines
872 B
TypeScript
26 lines
872 B
TypeScript
import { DbContextsArray } from "./runQuery";
|
|
import { APIResponseObject, DSQL_TableSchemaType, PostInsertReturn } from "../../../types";
|
|
type Param<T extends {
|
|
[k: string]: any;
|
|
} = any> = {
|
|
dbContext?: (typeof DbContextsArray)[number];
|
|
dbFullName?: string;
|
|
tableName: string;
|
|
encryptionKey?: string;
|
|
encryptionSalt?: string;
|
|
data?: T;
|
|
tableSchema?: DSQL_TableSchemaType;
|
|
identifierColumnName: keyof T;
|
|
identifierValue: string | number;
|
|
forceLocal?: boolean;
|
|
debug?: boolean;
|
|
};
|
|
/**
|
|
* # Update DB Function
|
|
* @description
|
|
*/
|
|
export default function updateDbEntry<T extends {
|
|
[k: string]: any;
|
|
} = any>({ dbContext, dbFullName, tableName, data, tableSchema, identifierColumnName, identifierValue, encryptionKey, encryptionSalt, forceLocal, debug, }: Param<T>): Promise<APIResponseObject<PostInsertReturn>>;
|
|
export {};
|