Updates
This commit is contained in:
@@ -208,10 +208,25 @@ export default function sqlGenerator<
|
||||
} else if (genObject?.selectFields?.[0]) {
|
||||
if (genObject.join) {
|
||||
str += ` ${genObject.selectFields
|
||||
?.map((fld) => `${finalDbName}${tableName}.${String(fld)}`)
|
||||
?.map((fld) =>
|
||||
typeof fld == "object"
|
||||
? `${finalDbName}${tableName}.${fld.fieldName}` +
|
||||
fld.alias
|
||||
? ` as ${fld.alias}`
|
||||
: ``
|
||||
: `${finalDbName}${tableName}.${String(fld)}`
|
||||
)
|
||||
.join(",")}`;
|
||||
} else {
|
||||
str += ` ${genObject.selectFields?.join(",")}`;
|
||||
str += ` ${genObject.selectFields
|
||||
?.map((fld) =>
|
||||
typeof fld == "object"
|
||||
? `${fld.fieldName}` + fld.alias
|
||||
? ` as ${fld.alias}`
|
||||
: ``
|
||||
: fld
|
||||
)
|
||||
.join(",")}`;
|
||||
}
|
||||
} else {
|
||||
if (genObject?.join) {
|
||||
|
||||
@@ -995,7 +995,7 @@ export type ServerQueryParam<
|
||||
T extends { [k: string]: any } = { [k: string]: any },
|
||||
K extends string = string
|
||||
> = {
|
||||
selectFields?: (keyof T)[];
|
||||
selectFields?: (keyof T | TableSelectFieldsObject)[];
|
||||
omitFields?: (keyof T)[];
|
||||
query?: ServerQueryQueryObject<T>;
|
||||
limit?: number;
|
||||
@@ -1015,6 +1015,13 @@ export type ServerQueryParam<
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
export type TableSelectFieldsObject<
|
||||
T extends { [k: string]: any } = { [k: string]: any }
|
||||
> = {
|
||||
fieldName: keyof T;
|
||||
alias?: string;
|
||||
};
|
||||
|
||||
export type ServerQueryValuesObject = {
|
||||
value?: string | number;
|
||||
equality?: (typeof ServerQueryEqualities)[number];
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import _ from "lodash";
|
||||
import grabIPAddresses from "./backend/names/grab-ip-addresses";
|
||||
|
||||
export default function grabInstanceGlobalNetWorkName() {
|
||||
const deploymentName = process.env.DSQL_DEPLOYMENT_NAME || "dsql";
|
||||
|
||||
Reference in New Issue
Block a user