@saltcorn/db-common
Advanced tools
Comparing version 0.6.3 to 0.6.4-beta.1
@@ -61,8 +61,8 @@ /** | ||
*/ | ||
export declare const mkWhere: (whereObj: Where, is_sqlite: boolean, initCount?: number) => WhereAndVals; | ||
export declare const mkWhere: (whereObj: Where, is_sqlite?: boolean, initCount?: number) => WhereAndVals; | ||
export declare type CoordOpts = { | ||
latField: string; | ||
longField: string; | ||
lat: string; | ||
long: string; | ||
latField: number | string; | ||
longField: number | string; | ||
lat: number | string; | ||
long: number | string; | ||
}; | ||
@@ -103,3 +103,3 @@ export declare type SelectOptions = { | ||
field: string; | ||
where?: string; | ||
where?: Where; | ||
aggregate: string; | ||
@@ -106,0 +106,0 @@ subselect?: SubselectOptions; |
@@ -200,3 +200,3 @@ "use strict"; | ||
*/ | ||
const mkWhere = (whereObj, is_sqlite, initCount = 0) => { | ||
const mkWhere = (whereObj, is_sqlite = false, initCount = 0) => { | ||
const wheres = whereObj ? Object.entries(whereObj) : []; | ||
@@ -233,3 +233,3 @@ //console.log({ wheres }); | ||
const cos_lat_2 = Math.pow(Math.cos((+lat * Math.PI) / 180), 2); | ||
return `((${(0, exports.sqlsanitizeAllowDots)(latField)} - ${+lat})*(${(0, exports.sqlsanitizeAllowDots)(latField)} - ${+lat})) + ((${(0, exports.sqlsanitizeAllowDots)(longField)} - ${+long})*(${(0, exports.sqlsanitizeAllowDots)(longField)} - ${+long})*${cos_lat_2})`; | ||
return `((${(0, exports.sqlsanitizeAllowDots)(`${latField}`)} - ${+lat})*(${(0, exports.sqlsanitizeAllowDots)(`${latField}`)} - ${+lat})) + ((${(0, exports.sqlsanitizeAllowDots)(`${longField}`)} - ${+long})*(${(0, exports.sqlsanitizeAllowDots)(`${longField}`)} - ${+long})*${cos_lat_2})`; | ||
}; | ||
@@ -236,0 +236,0 @@ const orderByIsObject = (object) => { |
@@ -26,4 +26,4 @@ /** | ||
*/ | ||
export declare const runWithTenant: (tenant: string, f: () => any) => any; | ||
export declare const runWithTenant: <Type>(tenant: string, f: () => Promise<Type>) => Promise<Type>; | ||
export declare const getTenantSchema: () => string; | ||
//# sourceMappingURL=multi-tenant.d.ts.map |
@@ -27,3 +27,3 @@ /** | ||
*/ | ||
export declare const runWithTenant: (t: string, f: () => any) => any; | ||
export declare const runWithTenant: <Type>(t: string, f: () => Promise<Type>) => Promise<Type>; | ||
//# sourceMappingURL=single-tenant.d.ts.map |
{ | ||
"name": "@saltcorn/db-common", | ||
"version": "0.6.3", | ||
"version": "0.6.4-beta.1", | ||
"description": "Db common structures for Saltcorn, open-source no-code platform", | ||
@@ -5,0 +5,0 @@ "homepage": "https://saltcorn.com", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73882
814