UNPKG

dynamicsmobile

Version:

Allows development of off-line mobile and web business apps over the Dynamics Mobile platform. More info on https://www.dynamicsmobile.com

30 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SqlQueryService = void 0; const tslib_1 = require("tslib"); const dms_platform_bridge_factory_1 = require("../platform/dms-platform-bridge-factory"); const app_service_app_1 = require("./app-service-app"); /** * @Service * SqlQuery class provides sql access to the on-device local relational database * It alows the developer to execute sql queries against the mobile database by providing ANSI 92 Sql statements */ class SqlQueryService extends app_service_app_1.CoreAppService { constructor(dms) { super(dms, null); } /** * executes the sql statements provided in the constructor and returns the result from * the operation if the underlying database operation actually return result */ execute(sql) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (!sql) throw "SqlQuery.execute requires argument 'sql'!"; const r = yield (0, dms_platform_bridge_factory_1.PlatformBridgeFactory)(this.dms).execute("fetchsql", { query: sql }); return r; }); } } exports.SqlQueryService = SqlQueryService; //# sourceMappingURL=sql-query-service.js.map