MCPcopy
hub / github.com/spaceandtimefdn/SxT-NodeJS-SDK / SQLCore

Class SQLCore

src/sqlcore/sqlcore.ts:5–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import { QueryHelper } from "../helpers/queryhelper.js";
4
5export default class SQLCore {
6 // DDL Queries
7 DDL = async (
8 sqlText: string,
9 biscuits?: string[],
10 originApp?: string
11 ): Promise<Types.APIResponse> => {
12 let endpoint: string = "/v1/sql/ddl";
13
14 const options = {
15 method: "POST",
16 url: `${process.env.BASEURL_GENERAL}${endpoint}`,
17 headers: {
18 accept: "application/json",
19 "content-type": "application/json",
20 authorization: `Bearer ${GetAccessToken().accessToken}`,
21 originApp: originApp,
22 },
23 data: {
24 sqlText: sqlText,
25 biscuits: biscuits,
26 },
27 };
28
29 return QueryHelper(options, 200);
30 };
31
32 // DML Queries
33 DML = async (
34 sqlText: string,
35 biscuits?: string[],
36 resources?: string[],
37 originApp?: string
38 ): Promise<Types.APIResponse> => {
39 let endpoint: string = "/v1/sql/dml";
40
41 const options = {
42 method: "POST",
43 url: `${process.env.BASEURL_GENERAL}${endpoint}`,
44 headers: {
45 accept: "application/json",
46 "content-type": "application/json",
47 authorization: `Bearer ${GetAccessToken().accessToken}`,
48 originApp: originApp,
49 },
50 data: {
51 sqlText: sqlText,
52 biscuits: biscuits,
53 resources: resources,
54 },
55 };
56
57 return QueryHelper(options, 200);
58 };
59
60 // DQL Queries
61 DQL = async (
62 sqlText: string,

Callers

nothing calls this directly

Calls 2

GetAccessTokenFunction · 0.85
QueryHelperFunction · 0.85

Tested by

no test coverage detected