26 lines
863 B
TypeScript
26 lines
863 B
TypeScript
import type { ServerQueryEqualities, ServerQueryObject, SQLInsertGenValueType } from "../types";
|
|
type Params = {
|
|
fieldName: string;
|
|
value?: SQLInsertGenValueType;
|
|
equality?: (typeof ServerQueryEqualities)[number];
|
|
queryObj: ServerQueryObject<{
|
|
[key: string]: any;
|
|
}, string>;
|
|
/**
|
|
* `value` is an already-validated `table.field` reference rather than a
|
|
* literal, so it is inlined instead of bound
|
|
*/
|
|
isValueFieldValue?: boolean;
|
|
};
|
|
type Return = {
|
|
str: string;
|
|
params: SQLInsertGenValueType[];
|
|
};
|
|
/**
|
|
* # SQL Gen Operator Gen
|
|
* @description Generates an SQL condition for a single field. Literal values
|
|
* are always returned in `params` to be bound, never inlined.
|
|
*/
|
|
export default function sqlGenOperatorGen({ fieldName, value, equality, queryObj, isValueFieldValue, }: Params): Return;
|
|
export {};
|