27 lines
911 B
TypeScript
27 lines
911 B
TypeScript
import { DbContextsArray } from "./runQuery";
|
|
import { PostInsertReturn } from "../../../types";
|
|
type Param<T extends {
|
|
[k: string]: any;
|
|
} = any> = {
|
|
dbContext?: (typeof DbContextsArray)[number];
|
|
paradigm?: "Read Only" | "Full Access";
|
|
dbFullName?: string;
|
|
tableName: string;
|
|
data: T;
|
|
tableSchema?: import("../../../types").DSQL_TableSchemaType;
|
|
duplicateColumnName?: string;
|
|
duplicateColumnValue?: string;
|
|
update?: boolean;
|
|
encryptionKey?: string;
|
|
encryptionSalt?: string;
|
|
forceLocal?: boolean;
|
|
debug?: boolean;
|
|
};
|
|
/**
|
|
* Add a db Entry Function
|
|
*/
|
|
export default function addDbEntry<T extends {
|
|
[k: string]: any;
|
|
} = any>({ dbContext, paradigm, dbFullName, tableName, data, tableSchema, duplicateColumnName, duplicateColumnValue, update, encryptionKey, encryptionSalt, forceLocal, debug, }: Param<T>): Promise<PostInsertReturn | null>;
|
|
export {};
|