@databricks/sql 0.1.8-beta.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +1 -3
  3. package/dist/DBSQLClient.d.ts +18 -7
  4. package/dist/DBSQLClient.js +57 -16
  5. package/dist/DBSQLClient.js.map +1 -1
  6. package/dist/DBSQLLogger.d.ts +12 -0
  7. package/dist/DBSQLLogger.js +43 -0
  8. package/dist/DBSQLLogger.js.map +1 -0
  9. package/dist/DBSQLOperation/FetchResultsHelper.d.ts +1 -1
  10. package/dist/DBSQLOperation/FetchResultsHelper.js +1 -1
  11. package/dist/DBSQLOperation/FetchResultsHelper.js.map +1 -1
  12. package/dist/DBSQLOperation/OperationStatusHelper.d.ts +3 -3
  13. package/dist/DBSQLOperation/OperationStatusHelper.js +8 -8
  14. package/dist/DBSQLOperation/OperationStatusHelper.js.map +1 -1
  15. package/dist/DBSQLOperation/SchemaHelper.d.ts +4 -1
  16. package/dist/DBSQLOperation/SchemaHelper.js +25 -4
  17. package/dist/DBSQLOperation/SchemaHelper.js.map +1 -1
  18. package/dist/DBSQLOperation/index.d.ts +27 -6
  19. package/dist/DBSQLOperation/index.js +54 -16
  20. package/dist/DBSQLOperation/index.js.map +1 -1
  21. package/dist/DBSQLSession.d.ts +82 -12
  22. package/dist/DBSQLSession.js +114 -112
  23. package/dist/DBSQLSession.js.map +1 -1
  24. package/dist/connection/connections/HttpConnection.js +11 -8
  25. package/dist/connection/connections/HttpConnection.js.map +1 -1
  26. package/dist/contracts/IDBSQLClient.d.ts +11 -4
  27. package/dist/contracts/IDBSQLLogger.d.ts +13 -0
  28. package/dist/contracts/IDBSQLLogger.js +11 -0
  29. package/dist/contracts/IDBSQLLogger.js.map +1 -0
  30. package/dist/contracts/IDBSQLSession.d.ts +53 -41
  31. package/dist/contracts/IOperation.d.ts +15 -12
  32. package/dist/contracts/IOperation.js +0 -4
  33. package/dist/contracts/IOperation.js.map +1 -1
  34. package/dist/index.d.ts +6 -1
  35. package/dist/index.js +12 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/result/IOperationResult.d.ts +2 -1
  38. package/dist/result/JsonResult.d.ts +3 -5
  39. package/dist/result/JsonResult.js +6 -11
  40. package/dist/result/JsonResult.js.map +1 -1
  41. package/dist/utils/buildUserAgentString.js +2 -7
  42. package/dist/utils/buildUserAgentString.js.map +1 -1
  43. package/dist/version.d.ts +2 -0
  44. package/dist/version.js +4 -0
  45. package/dist/version.js.map +1 -0
  46. package/package.json +9 -3
  47. package/dist/DBSQLOperation/getResult.d.ts +0 -2
  48. package/dist/DBSQLOperation/getResult.js +0 -19
  49. package/dist/DBSQLOperation/getResult.js.map +0 -1
  50. package/dist/result/NullResult.d.ts +0 -4
  51. package/dist/result/NullResult.js +0 -9
  52. package/dist/result/NullResult.js.map +0 -1
@@ -1,14 +1,21 @@
1
- import { TOpenSessionReq } from '../../thrift/TCLIService_types';
1
+ import IDBSQLLogger from './IDBSQLLogger';
2
2
  import IDBSQLSession from './IDBSQLSession';
3
- export interface IDBSQLConnectionOptions {
3
+ export interface ClientOptions {
4
+ logger?: IDBSQLLogger;
5
+ }
6
+ export interface ConnectionOptions {
4
7
  host: string;
5
8
  port?: number;
6
9
  path: string;
7
10
  token: string;
8
11
  clientId?: string;
9
12
  }
13
+ export interface OpenSessionRequest {
14
+ initialCatalog?: string;
15
+ initialSchema?: string;
16
+ }
10
17
  export default interface IDBSQLClient {
11
- connect(options: IDBSQLConnectionOptions): Promise<IDBSQLClient>;
12
- openSession(request?: TOpenSessionReq): Promise<IDBSQLSession>;
18
+ connect(options: ConnectionOptions): Promise<IDBSQLClient>;
19
+ openSession(request?: OpenSessionRequest): Promise<IDBSQLSession>;
13
20
  close(): Promise<void>;
14
21
  }
@@ -0,0 +1,13 @@
1
+ export interface LoggerOptions {
2
+ filepath?: string;
3
+ level?: LogLevel;
4
+ }
5
+ export default interface IDBSQLLogger {
6
+ log(level: LogLevel, message: string): void;
7
+ }
8
+ export declare enum LogLevel {
9
+ error = "error",
10
+ warn = "warn",
11
+ info = "info",
12
+ debug = "debug"
13
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogLevel = void 0;
4
+ var LogLevel;
5
+ (function (LogLevel) {
6
+ LogLevel["error"] = "error";
7
+ LogLevel["warn"] = "warn";
8
+ LogLevel["info"] = "info";
9
+ LogLevel["debug"] = "debug";
10
+ })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
11
+ //# sourceMappingURL=IDBSQLLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDBSQLLogger.js","sourceRoot":"","sources":["../../lib/contracts/IDBSQLLogger.ts"],"names":[],"mappings":";;;AASA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB"}
@@ -3,45 +3,68 @@ import IOperation from './IOperation';
3
3
  import Status from '../dto/Status';
4
4
  import InfoValue from '../dto/InfoValue';
5
5
  import { Int64 } from '../hive/Types';
6
- export declare type CrossReferenceRequest = {
7
- parentCatalogName: string;
8
- parentSchemaName: string;
9
- parentTableName: string;
10
- foreignCatalogName: string;
11
- foreignSchemaName: string;
12
- foreignTableName: string;
13
- };
14
6
  export declare type ExecuteStatementOptions = {
15
- runAsync?: boolean;
16
- confOverlay?: Record<string, string>;
17
7
  queryTimeout?: Int64;
18
- maxRows?: number;
8
+ runAsync?: boolean;
9
+ maxRows?: number | null;
10
+ };
11
+ export declare type TypeInfoRequest = {
12
+ runAsync?: boolean;
13
+ maxRows?: number | null;
14
+ };
15
+ export declare type CatalogsRequest = {
16
+ runAsync?: boolean;
17
+ maxRows?: number | null;
19
18
  };
20
19
  export declare type SchemasRequest = {
21
- schemaName?: string;
22
20
  catalogName?: string;
21
+ schemaName?: string;
22
+ runAsync?: boolean;
23
+ maxRows?: number | null;
23
24
  };
24
25
  export declare type TablesRequest = {
25
26
  catalogName?: string;
26
27
  schemaName?: string;
27
28
  tableName?: string;
28
29
  tableTypes?: Array<string>;
30
+ runAsync?: boolean;
31
+ maxRows?: number | null;
32
+ };
33
+ export declare type TableTypesRequest = {
34
+ runAsync?: boolean;
35
+ maxRows?: number | null;
29
36
  };
30
- export declare type ColumnRequest = {
37
+ export declare type ColumnsRequest = {
31
38
  catalogName?: string;
32
39
  schemaName?: string;
33
40
  tableName?: string;
34
41
  columnName?: string;
42
+ runAsync?: boolean;
43
+ maxRows?: number | null;
35
44
  };
36
- export declare type FunctionNameRequest = {
37
- functionName: string;
45
+ export declare type FunctionsRequest = {
38
46
  catalogName?: string;
39
47
  schemaName?: string;
48
+ functionName: string;
49
+ runAsync?: boolean;
50
+ maxRows?: number | null;
40
51
  };
41
52
  export declare type PrimaryKeysRequest = {
53
+ catalogName?: string;
42
54
  schemaName: string;
43
55
  tableName: string;
44
- catalogName?: string;
56
+ runAsync?: boolean;
57
+ maxRows?: number | null;
58
+ };
59
+ export declare type CrossReferenceRequest = {
60
+ parentCatalogName: string;
61
+ parentSchemaName: string;
62
+ parentTableName: string;
63
+ foreignCatalogName: string;
64
+ foreignSchemaName: string;
65
+ foreignTableName: string;
66
+ runAsync?: boolean;
67
+ maxRows?: number | null;
45
68
  };
46
69
  export default interface IDBSQLSession {
47
70
  /**
@@ -58,41 +81,47 @@ export default interface IDBSQLSession {
58
81
  */
59
82
  executeStatement(statement: string, options?: ExecuteStatementOptions): Promise<IOperation>;
60
83
  /**
61
- * Informataion about supported data types
84
+ * Information about supported data types
85
+ *
86
+ * @param request
62
87
  */
63
- getTypeInfo(): Promise<IOperation>;
88
+ getTypeInfo(request?: TypeInfoRequest): Promise<IOperation>;
64
89
  /**
65
90
  * Get list of catalogs
91
+ *
92
+ * @param request
66
93
  */
67
- getCatalogs(): Promise<IOperation>;
94
+ getCatalogs(request?: CatalogsRequest): Promise<IOperation>;
68
95
  /**
69
96
  * Get list of databases
70
97
  *
71
98
  * @param request
72
99
  */
73
- getSchemas(request: SchemasRequest): Promise<IOperation>;
100
+ getSchemas(request?: SchemasRequest): Promise<IOperation>;
74
101
  /**
75
102
  * Get list of tables
76
103
  *
77
104
  * @param request
78
105
  */
79
- getTables(request: TablesRequest): Promise<IOperation>;
106
+ getTables(request?: TablesRequest): Promise<IOperation>;
80
107
  /**
81
108
  * Get list of supported table types
109
+ *
110
+ * @param request
82
111
  */
83
- getTableTypes(): Promise<IOperation>;
112
+ getTableTypes(request?: TableTypesRequest): Promise<IOperation>;
84
113
  /**
85
114
  * Get full information about columns of the table
86
115
  *
87
116
  * @param request
88
117
  */
89
- getColumns(request: ColumnRequest): Promise<IOperation>;
118
+ getColumns(request?: ColumnsRequest): Promise<IOperation>;
90
119
  /**
91
120
  * Get information about function
92
121
  *
93
122
  * @param request
94
123
  */
95
- getFunctions(request: FunctionNameRequest): Promise<IOperation>;
124
+ getFunctions(request: FunctionsRequest): Promise<IOperation>;
96
125
  /**
97
126
  * Get primary keys of table
98
127
  *
@@ -104,23 +133,6 @@ export default interface IDBSQLSession {
104
133
  * @param request
105
134
  */
106
135
  getCrossReference(request: CrossReferenceRequest): Promise<IOperation>;
107
- /**
108
- * Get delegation token. For kerberos auth only
109
- *
110
- * @param owner
111
- * @param renewer
112
- */
113
- getDelegationToken(owner: string, renewer: string): Promise<string>;
114
- /**
115
- * Renew delegation token/ For kerberos auth only
116
- * @param token
117
- */
118
- renewDelegationToken(token: string): Promise<Status>;
119
- /**
120
- * Cancel delegation token. For kerberos auth only
121
- * @param token
122
- */
123
- cancelDelegationToken(token: string): Promise<Status>;
124
136
  /**
125
137
  * closes the session
126
138
  */
@@ -1,23 +1,26 @@
1
1
  import { TGetOperationStatusResp, TTableSchema } from '../../thrift/TCLIService_types';
2
2
  import Status from '../dto/Status';
3
3
  export declare type OperationStatusCallback = (progress: TGetOperationStatusResp) => unknown;
4
- export interface IFetchOptions {
5
- maxRows?: number;
4
+ export interface WaitUntilReadyOptions {
6
5
  progress?: boolean;
7
6
  callback?: OperationStatusCallback;
8
7
  }
9
- export declare const defaultFetchOptions: {
10
- maxRows: number;
11
- };
8
+ export interface FinishedOptions extends WaitUntilReadyOptions {
9
+ }
10
+ export interface FetchOptions extends WaitUntilReadyOptions {
11
+ maxRows?: number;
12
+ }
13
+ export interface GetSchemaOptions extends WaitUntilReadyOptions {
14
+ }
12
15
  export default interface IOperation {
13
16
  /**
14
- * Fetch schema and a portion of data
17
+ * Fetch a portion of data
15
18
  */
16
- fetchChunk(options?: IFetchOptions): Promise<Array<object>>;
19
+ fetchChunk(options?: FetchOptions): Promise<Array<object>>;
17
20
  /**
18
- * Fetch schema and all the data
21
+ * Fetch all the data
19
22
  */
20
- fetchAll(options?: IFetchOptions): Promise<Array<object>>;
23
+ fetchAll(options?: FetchOptions): Promise<Array<object>>;
21
24
  /**
22
25
  * Request status of operation
23
26
  *
@@ -35,13 +38,13 @@ export default interface IOperation {
35
38
  /**
36
39
  * Waits until operation is finished
37
40
  */
38
- finished(): Promise<void>;
41
+ finished(options?: FinishedOptions): Promise<void>;
39
42
  /**
40
43
  * Check if operation hasMoreRows
41
44
  */
42
45
  hasMoreRows(): Promise<boolean>;
43
46
  /**
44
- * Return retrieved schema
47
+ * Fetch schema
45
48
  */
46
- getSchema(): Promise<TTableSchema | null>;
49
+ getSchema(options?: GetSchemaOptions): Promise<TTableSchema | null>;
47
50
  }
@@ -1,7 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultFetchOptions = void 0;
4
- exports.defaultFetchOptions = {
5
- maxRows: 100000,
6
- };
7
3
  //# sourceMappingURL=IOperation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IOperation.js","sourceRoot":"","sources":["../../lib/contracts/IOperation.ts"],"names":[],"mappings":";;;AAWa,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,MAAM;CAChB,CAAC"}
1
+ {"version":3,"file":"IOperation.js","sourceRoot":"","sources":["../../lib/contracts/IOperation.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,20 @@
1
+ import { Thrift } from 'thrift';
1
2
  import TCLIService from '../thrift/TCLIService';
2
3
  import TCLIService_types from '../thrift/TCLIService_types';
3
4
  import DBSQLClient from './DBSQLClient';
4
5
  import DBSQLSession from './DBSQLSession';
6
+ import DBSQLLogger from './DBSQLLogger';
5
7
  import NoSaslAuthentication from './connection/auth/NoSaslAuthentication';
6
8
  import PlainHttpAuthentication from './connection/auth/PlainHttpAuthentication';
7
9
  import HttpConnection from './connection/connections/HttpConnection';
8
10
  import { formatProgress } from './utils';
11
+ import { LogLevel } from './contracts/IDBSQLLogger';
9
12
  export declare const auth: {
10
13
  NoSaslAuthentication: typeof NoSaslAuthentication;
11
14
  PlainHttpAuthentication: typeof PlainHttpAuthentication;
12
15
  };
16
+ declare const TException: typeof Thrift.TException, TApplicationException: typeof Thrift.TApplicationException, TApplicationExceptionType: typeof Thrift.TApplicationExceptionType, TProtocolException: typeof Thrift.TProtocolException, TProtocolExceptionType: typeof Thrift.TProtocolExceptionType;
17
+ export { TException, TApplicationException, TApplicationExceptionType, TProtocolException, TProtocolExceptionType };
13
18
  export declare const connections: {
14
19
  HttpConnection: typeof HttpConnection;
15
20
  };
@@ -20,4 +25,4 @@ export declare const thrift: {
20
25
  export declare const utils: {
21
26
  formatProgress: typeof formatProgress;
22
27
  };
23
- export { DBSQLClient, DBSQLSession };
28
+ export { DBSQLClient, DBSQLSession, DBSQLLogger, LogLevel };
package/dist/index.js CHANGED
@@ -3,21 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DBSQLSession = exports.DBSQLClient = exports.utils = exports.thrift = exports.connections = exports.auth = void 0;
6
+ exports.LogLevel = exports.DBSQLLogger = exports.DBSQLSession = exports.DBSQLClient = exports.utils = exports.thrift = exports.connections = exports.TProtocolExceptionType = exports.TProtocolException = exports.TApplicationExceptionType = exports.TApplicationException = exports.TException = exports.auth = void 0;
7
+ const thrift_1 = require("thrift");
7
8
  const TCLIService_1 = __importDefault(require("../thrift/TCLIService"));
8
9
  const TCLIService_types_1 = __importDefault(require("../thrift/TCLIService_types"));
9
10
  const DBSQLClient_1 = __importDefault(require("./DBSQLClient"));
10
11
  exports.DBSQLClient = DBSQLClient_1.default;
11
12
  const DBSQLSession_1 = __importDefault(require("./DBSQLSession"));
12
13
  exports.DBSQLSession = DBSQLSession_1.default;
14
+ const DBSQLLogger_1 = __importDefault(require("./DBSQLLogger"));
15
+ exports.DBSQLLogger = DBSQLLogger_1.default;
13
16
  const NoSaslAuthentication_1 = __importDefault(require("./connection/auth/NoSaslAuthentication"));
14
17
  const PlainHttpAuthentication_1 = __importDefault(require("./connection/auth/PlainHttpAuthentication"));
15
18
  const HttpConnection_1 = __importDefault(require("./connection/connections/HttpConnection"));
16
19
  const utils_1 = require("./utils");
20
+ const IDBSQLLogger_1 = require("./contracts/IDBSQLLogger");
21
+ Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return IDBSQLLogger_1.LogLevel; } });
17
22
  exports.auth = {
18
23
  NoSaslAuthentication: NoSaslAuthentication_1.default,
19
24
  PlainHttpAuthentication: PlainHttpAuthentication_1.default,
20
25
  };
26
+ const { TException, TApplicationException, TApplicationExceptionType, TProtocolException, TProtocolExceptionType } = thrift_1.Thrift;
27
+ exports.TException = TException;
28
+ exports.TApplicationException = TApplicationException;
29
+ exports.TApplicationExceptionType = TApplicationExceptionType;
30
+ exports.TProtocolException = TProtocolException;
31
+ exports.TProtocolExceptionType = TProtocolExceptionType;
21
32
  exports.connections = {
22
33
  HttpConnection: HttpConnection_1.default,
23
34
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;AAAA,wEAAgD;AAChD,oFAA4D;AAC5D,gEAAwC;AAyB/B,sBAzBF,qBAAW,CAyBE;AAxBpB,kEAA0C;AAwBpB,uBAxBf,sBAAY,CAwBe;AAvBlC,kGAA0E;AAC1E,wGAAgF;AAChF,6FAAqE;AACrE,mCAAyC;AAE5B,QAAA,IAAI,GAAG;IAClB,oBAAoB,EAApB,8BAAoB;IACpB,uBAAuB,EAAvB,iCAAuB;CACxB,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,cAAc,EAAd,wBAAc;CACf,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,WAAW,EAAX,qBAAW;IACX,iBAAiB,EAAjB,2BAAiB;CAClB,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,cAAc,EAAd,sBAAc;CACf,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAgC;AAChC,wEAAgD;AAChD,oFAA4D;AAC5D,gEAAwC;AAgC/B,sBAhCF,qBAAW,CAgCE;AA/BpB,kEAA0C;AA+BpB,uBA/Bf,sBAAY,CA+Be;AA9BlC,gEAAwC;AA8BJ,sBA9B7B,qBAAW,CA8B6B;AA7B/C,kGAA0E;AAC1E,wGAAgF;AAChF,6FAAqE;AACrE,mCAAyC;AACzC,2DAAoD;AAyBH,yFAzBxC,uBAAQ,OAyBwC;AAvB5C,QAAA,IAAI,GAAG;IAClB,oBAAoB,EAApB,8BAAoB;IACpB,uBAAuB,EAAvB,iCAAuB;CACxB,CAAC;AAEF,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,GAChH,eAAM,CAAC;AAEA,gCAAU;AAAE,sDAAqB;AAAE,8DAAyB;AAAE,gDAAkB;AAAE,wDAAsB;AAEpG,QAAA,WAAW,GAAG;IACzB,cAAc,EAAd,wBAAc;CACf,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,WAAW,EAAX,qBAAW;IACX,iBAAiB,EAAjB,2BAAiB;CAClB,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,cAAc,EAAd,sBAAc;CACf,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { TRowSet } from '../../thrift/TCLIService_types';
1
2
  export default interface IOperationResult {
2
- getValue(): any;
3
+ getValue(data?: Array<TRowSet>): any;
3
4
  }
@@ -1,14 +1,12 @@
1
1
  import { TRowSet, TTableSchema } from '../../thrift/TCLIService_types';
2
2
  import IOperationResult from './IOperationResult';
3
3
  export default class JsonResult implements IOperationResult {
4
- private readonly schema;
5
- private readonly data;
6
- constructor(schema: TTableSchema | null, data: Array<TRowSet>);
7
- getValue(): Array<object>;
4
+ private readonly schema?;
5
+ constructor(schema?: TTableSchema);
6
+ getValue(data?: Array<TRowSet>): Array<object>;
8
7
  private getSchemaColumns;
9
8
  private getRows;
10
9
  private getSchemaValues;
11
- private getColumnName;
12
10
  private convertData;
13
11
  private isNull;
14
12
  private toJSON;
@@ -3,16 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Types_1 = require("../hive/Types");
4
4
  const TCLIService_types_1 = require("../../thrift/TCLIService_types");
5
5
  class JsonResult {
6
- constructor(schema, data) {
6
+ constructor(schema) {
7
7
  this.schema = schema;
8
- this.data = data;
9
8
  }
10
- getValue() {
11
- if (!this.data) {
9
+ getValue(data) {
10
+ if (!data) {
12
11
  return [];
13
12
  }
14
13
  const descriptors = this.getSchemaColumns();
15
- return this.data.reduce((result, rowSet) => {
14
+ return data.reduce((result, rowSet) => {
16
15
  const columns = rowSet.columns || [];
17
16
  const rows = this.getRows(columns, descriptors);
18
17
  return result.concat(rows);
@@ -29,8 +28,8 @@ class JsonResult {
29
28
  if (!result[i]) {
30
29
  result[i] = {};
31
30
  }
32
- const name = this.getColumnName(descriptor);
33
- result[i][name] = value;
31
+ const { columnName } = descriptor;
32
+ result[i][columnName] = value;
34
33
  return result;
35
34
  }, rows), []);
36
35
  }
@@ -48,10 +47,6 @@ class JsonResult {
48
47
  return this.convertData(typeDescriptor, value);
49
48
  });
50
49
  }
51
- getColumnName(column) {
52
- const name = column.columnName || '';
53
- return name.split('.').pop() || '';
54
- }
55
50
  convertData(typeDescriptor, value) {
56
51
  if (!typeDescriptor) {
57
52
  return value;
@@ -1 +1 @@
1
- {"version":3,"file":"JsonResult.js","sourceRoot":"","sources":["../../lib/result/JsonResult.ts"],"names":[],"mappings":";;AAAA,yCAAuD;AACvD,sEAOwC;AAGxC,MAAqB,UAAU;IAK7B,YAAY,MAA2B,EAAE,IAAoB;QAC3D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,OAAO,EAAE,CAAC;SACX;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAE5C,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAkB,EAAE,MAAe,EAAE,EAAE;YAC9D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAEhD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,GAAG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AK,CAAC,CAAC;SAC1B;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,YAAY,CAAC;SACrB;IACH,CAAC;IAEO,aAAa,CAAC,KAAU;QAC9B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAEO,cAAc,CAAC,MAAe;QACpC,OAAO,CACL,MAAM,CAAC,kBAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,CAAC,kBAAU,CAAC,OAAO,CAAC;YAC1B,MAAM,CAAC,kBAAU,CAAC,OAAO,CAAC;YAC1B,MAAM,CAAC,kBAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,CAAC,kBAAU,CAAC,MAAM,CAAC;YACzB,MAAM,CAAC,kBAAU,CAAC,MAAM,CAAC;YACzB,MAAM,CAAC,kBAAU,CAAC,MAAM,CAAC;YACzB,MAAM,CAAC,kBAAU,CAAC,SAAS,CAAC,CAC7B,CAAC;IACJ,CAAC;CACF;AArID,6BAqIC"}
@@ -3,14 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const fs_1 = __importDefault(require("fs"));
7
- const path_1 = __importDefault(require("path"));
8
6
  const os_1 = __importDefault(require("os"));
7
+ const version_1 = __importDefault(require("../version"));
9
8
  const productName = 'NodejsDatabricksSqlConnector';
10
- function getPackageVersion() {
11
- const json = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, '../../package.json')).toString());
12
- return json.version;
13
- }
14
9
  function getNodeVersion() {
15
10
  return `Node.js ${process.versions.node}`;
16
11
  }
@@ -19,7 +14,7 @@ function getOperatingSystemVersion() {
19
14
  }
20
15
  function buildUserAgentString(clientId) {
21
16
  const extra = [clientId, getNodeVersion(), getOperatingSystemVersion()].filter(Boolean);
22
- return `${productName}/${getPackageVersion()} (${extra.join('; ')})`;
17
+ return `${productName}/${version_1.default} (${extra.join('; ')})`;
23
18
  }
24
19
  exports.default = buildUserAgentString;
25
20
  //# sourceMappingURL=buildUserAgentString.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildUserAgentString.js","sourceRoot":"","sources":["../../lib/utils/buildUserAgentString.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,4CAAoB;AAEpB,MAAM,WAAW,GAAG,8BAA8B,CAAC;AAEnD,SAAS,iBAAiB;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChG,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,WAAW,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,yBAAyB;IAChC,OAAO,GAAG,YAAE,CAAC,IAAI,EAAE,IAAI,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC;AACxC,CAAC;AAED,SAAwB,oBAAoB,CAAC,QAAiB;IAC5D,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,yBAAyB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxF,OAAO,GAAG,WAAW,IAAI,iBAAiB,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACvE,CAAC;AAHD,uCAGC"}
1
+ {"version":3,"file":"buildUserAgentString.js","sourceRoot":"","sources":["../../lib/utils/buildUserAgentString.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,yDAAwC;AAExC,MAAM,WAAW,GAAG,8BAA8B,CAAC;AAEnD,SAAS,cAAc;IACrB,OAAO,WAAW,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,yBAAyB;IAChC,OAAO,GAAG,YAAE,CAAC,IAAI,EAAE,IAAI,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC;AACxC,CAAC;AAED,SAAwB,oBAAoB,CAAC,QAAiB;IAC5D,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,yBAAyB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxF,OAAO,GAAG,WAAW,IAAI,iBAAc,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAClE,CAAC;AAHD,uCAGC"}
@@ -0,0 +1,2 @@
1
+ declare const _default: "1.1.0";
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = '1.1.0';
4
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../lib/version.ts"],"names":[],"mappings":";;AAAA,kBAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databricks/sql",
3
- "version": "0.1.8-beta.2",
3
+ "version": "1.1.0",
4
4
  "description": "Driver for connection to Databricks SQL via Thrift API.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,10 +12,12 @@
12
12
  "node": ">=14.0.0"
13
13
  },
14
14
  "scripts": {
15
+ "postinstall": "patch-package",
15
16
  "prepare": "npm run build",
16
17
  "e2e": "nyc --reporter=lcov --report-dir=coverage_e2e mocha --config tests/e2e/.mocharc.js",
17
18
  "test": "nyc --reporter=lcov --report-dir=coverage_unit mocha --config tests/unit/.mocharc.js",
18
- "build": "tsc",
19
+ "update-version": "node bin/update-version.js && prettier --write ./lib/version.ts",
20
+ "build": "npm run update-version && tsc",
19
21
  "watch": "tsc -w",
20
22
  "type-check": "tsc --noEmit",
21
23
  "prettier": "prettier . --check",
@@ -49,6 +51,7 @@
49
51
  "@types/node": "^18.0.0",
50
52
  "@types/node-int64": "^0.4.29",
51
53
  "@types/thrift": "^0.10.11",
54
+ "@types/uuid": "^8.3.4",
52
55
  "@typescript-eslint/eslint-plugin": "^5.33.1",
53
56
  "@typescript-eslint/parser": "^5.33.1",
54
57
  "chai": "^4.3.6",
@@ -69,6 +72,9 @@
69
72
  "dependencies": {
70
73
  "commander": "^9.3.0",
71
74
  "node-int64": "^0.4.0",
72
- "thrift": "^0.16.0"
75
+ "patch-package": "^6.5.0",
76
+ "thrift": "^0.16.0",
77
+ "uuid": "^9.0.0",
78
+ "winston": "^3.8.2"
73
79
  }
74
80
  }
@@ -1,2 +0,0 @@
1
- import { TRowSet, TTableSchema } from '../../thrift/TCLIService_types';
2
- export default function getResult(schema: TTableSchema | null, data: Array<TRowSet>): any;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const NullResult_1 = __importDefault(require("../result/NullResult"));
7
- const JsonResult_1 = __importDefault(require("../result/JsonResult"));
8
- function getHandler(schema, data) {
9
- if (schema === null) {
10
- return new NullResult_1.default();
11
- }
12
- return new JsonResult_1.default(schema, data);
13
- }
14
- function getResult(schema, data) {
15
- const handler = getHandler(schema, data);
16
- return handler.getValue();
17
- }
18
- exports.default = getResult;
19
- //# sourceMappingURL=getResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getResult.js","sourceRoot":"","sources":["../../lib/DBSQLOperation/getResult.ts"],"names":[],"mappings":";;;;;AAEA,sEAA8C;AAC9C,sEAA8C;AAE9C,SAAS,UAAU,CAAC,MAA2B,EAAE,IAAoB;IACnE,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,OAAO,IAAI,oBAAU,EAAE,CAAC;KACzB;IACD,OAAO,IAAI,oBAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,SAAwB,SAAS,CAAC,MAA2B,EAAE,IAAoB;IACjF,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAHD,4BAGC"}
@@ -1,4 +0,0 @@
1
- import IOperationResult from './IOperationResult';
2
- export default class NullResult implements IOperationResult {
3
- getValue(): null;
4
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class NullResult {
4
- getValue() {
5
- return null;
6
- }
7
- }
8
- exports.default = NullResult;
9
- //# sourceMappingURL=NullResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NullResult.js","sourceRoot":"","sources":["../../lib/result/NullResult.ts"],"names":[],"mappings":";;AAEA,MAAqB,UAAU;IAC7B,QAAQ;QACN,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAJD,6BAIC"}