@databricks/sql 1.0.0 → 1.1.1

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 (105) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/DBSQLClient.d.ts +1 -1
  3. package/dist/DBSQLClient.js +18 -4
  4. package/dist/DBSQLClient.js.map +1 -1
  5. package/dist/DBSQLOperation/SchemaHelper.d.ts +4 -1
  6. package/dist/DBSQLOperation/SchemaHelper.js +25 -4
  7. package/dist/DBSQLOperation/SchemaHelper.js.map +1 -1
  8. package/dist/DBSQLOperation/index.js +2 -3
  9. package/dist/DBSQLOperation/index.js.map +1 -1
  10. package/dist/connection/connections/HttpConnection.js +2 -2
  11. package/dist/connection/connections/HttpConnection.js.map +1 -1
  12. package/dist/index.d.ts +3 -0
  13. package/dist/index.js +8 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/result/IOperationResult.d.ts +2 -1
  16. package/dist/result/JsonResult.d.ts +3 -5
  17. package/dist/result/JsonResult.js +6 -11
  18. package/dist/result/JsonResult.js.map +1 -1
  19. package/dist/utils/buildUserAgentString.js +2 -7
  20. package/dist/utils/buildUserAgentString.js.map +1 -1
  21. package/dist/version.d.ts +2 -0
  22. package/dist/version.js +4 -0
  23. package/dist/version.js.map +1 -0
  24. package/node_modules/async-limiter/.eslintignore +2 -0
  25. package/node_modules/async-limiter/.nycrc +10 -0
  26. package/node_modules/async-limiter/.travis.yml +9 -0
  27. package/node_modules/async-limiter/LICENSE +8 -0
  28. package/node_modules/async-limiter/index.js +67 -0
  29. package/node_modules/async-limiter/package.json +39 -0
  30. package/node_modules/async-limiter/readme.md +132 -0
  31. package/node_modules/browser-or-node/LICENSE +21 -0
  32. package/node_modules/browser-or-node/README.md +63 -0
  33. package/node_modules/browser-or-node/lib/index.js +31 -0
  34. package/node_modules/browser-or-node/package.json +64 -0
  35. package/node_modules/browser-or-node/src/index.js +26 -0
  36. package/node_modules/isomorphic-ws/LICENSE +21 -0
  37. package/node_modules/isomorphic-ws/README.md +58 -0
  38. package/node_modules/isomorphic-ws/browser.js +17 -0
  39. package/node_modules/isomorphic-ws/index.d.ts +8 -0
  40. package/node_modules/isomorphic-ws/node.js +3 -0
  41. package/node_modules/isomorphic-ws/package.json +38 -0
  42. package/node_modules/node-int64/.npmignore +3 -0
  43. package/node_modules/node-int64/Int64.js +268 -0
  44. package/node_modules/node-int64/LICENSE +19 -0
  45. package/node_modules/node-int64/README.md +78 -0
  46. package/node_modules/node-int64/package.json +31 -0
  47. package/node_modules/node-int64/test.js +120 -0
  48. package/node_modules/q/CHANGES.md +800 -0
  49. package/node_modules/q/LICENSE +18 -0
  50. package/node_modules/q/README.md +874 -0
  51. package/node_modules/q/package.json +80 -0
  52. package/node_modules/q/q.js +2076 -0
  53. package/node_modules/q/queue.js +35 -0
  54. package/node_modules/thrift/LICENSE +306 -0
  55. package/node_modules/thrift/README.md +210 -0
  56. package/node_modules/thrift/lib/nodejs/README.md +142 -0
  57. package/node_modules/thrift/lib/nodejs/lib/thrift/binary.js +168 -0
  58. package/node_modules/thrift/lib/nodejs/lib/thrift/binary_protocol.js +367 -0
  59. package/node_modules/thrift/lib/nodejs/lib/thrift/browser.js +49 -0
  60. package/node_modules/thrift/lib/nodejs/lib/thrift/buffered_transport.js +186 -0
  61. package/node_modules/thrift/lib/nodejs/lib/thrift/compact_protocol.js +915 -0
  62. package/node_modules/thrift/lib/nodejs/lib/thrift/connection.js +396 -0
  63. package/node_modules/thrift/lib/nodejs/lib/thrift/create_client.js +54 -0
  64. package/node_modules/thrift/lib/nodejs/lib/thrift/framed_transport.js +185 -0
  65. package/node_modules/thrift/lib/nodejs/lib/thrift/header_protocol.js +258 -0
  66. package/node_modules/thrift/lib/nodejs/lib/thrift/header_transport.js +341 -0
  67. package/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js +282 -0
  68. package/node_modules/thrift/lib/nodejs/lib/thrift/index.js +76 -0
  69. package/node_modules/thrift/lib/nodejs/lib/thrift/input_buffer_underrun_error.js +32 -0
  70. package/node_modules/thrift/lib/nodejs/lib/thrift/int64_util.js +91 -0
  71. package/node_modules/thrift/lib/nodejs/lib/thrift/json_parse.js +299 -0
  72. package/node_modules/thrift/lib/nodejs/lib/thrift/json_protocol.js +799 -0
  73. package/node_modules/thrift/lib/nodejs/lib/thrift/log.js +87 -0
  74. package/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_processor.js +63 -0
  75. package/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_protocol.js +73 -0
  76. package/node_modules/thrift/lib/nodejs/lib/thrift/protocol.js +22 -0
  77. package/node_modules/thrift/lib/nodejs/lib/thrift/server.js +123 -0
  78. package/node_modules/thrift/lib/nodejs/lib/thrift/thrift.js +241 -0
  79. package/node_modules/thrift/lib/nodejs/lib/thrift/transport.js +22 -0
  80. package/node_modules/thrift/lib/nodejs/lib/thrift/web_server.js +567 -0
  81. package/node_modules/thrift/lib/nodejs/lib/thrift/ws_connection.js +286 -0
  82. package/node_modules/thrift/lib/nodejs/lib/thrift/ws_transport.js +206 -0
  83. package/node_modules/thrift/lib/nodejs/lib/thrift/xhr_connection.js +280 -0
  84. package/node_modules/thrift/package.json +76 -0
  85. package/node_modules/ws/LICENSE +21 -0
  86. package/node_modules/ws/README.md +417 -0
  87. package/node_modules/ws/index.js +9 -0
  88. package/node_modules/ws/lib/buffer-util.js +72 -0
  89. package/node_modules/ws/lib/constants.js +10 -0
  90. package/node_modules/ws/lib/event-target.js +170 -0
  91. package/node_modules/ws/lib/extension.js +211 -0
  92. package/node_modules/ws/lib/permessage-deflate.js +516 -0
  93. package/node_modules/ws/lib/receiver.js +513 -0
  94. package/node_modules/ws/lib/sender.js +401 -0
  95. package/node_modules/ws/lib/validation.js +29 -0
  96. package/node_modules/ws/lib/websocket-server.js +369 -0
  97. package/node_modules/ws/lib/websocket.js +828 -0
  98. package/node_modules/ws/package.json +48 -0
  99. package/package.json +9 -3
  100. package/dist/DBSQLOperation/getResult.d.ts +0 -2
  101. package/dist/DBSQLOperation/getResult.js +0 -19
  102. package/dist/DBSQLOperation/getResult.js.map +0 -1
  103. package/dist/result/NullResult.d.ts +0 -4
  104. package/dist/result/NullResult.js +0 -9
  105. package/dist/result/NullResult.js.map +0 -1
@@ -0,0 +1,35 @@
1
+
2
+ var Q = require("./q");
3
+
4
+ module.exports = Queue;
5
+ function Queue() {
6
+ var ends = Q.defer();
7
+ var closed = Q.defer();
8
+ return {
9
+ put: function (value) {
10
+ var next = Q.defer();
11
+ ends.resolve({
12
+ head: value,
13
+ tail: next.promise
14
+ });
15
+ ends.resolve = next.resolve;
16
+ },
17
+ get: function () {
18
+ var result = ends.promise.get("head");
19
+ ends.promise = ends.promise.get("tail");
20
+ return result.fail(function (error) {
21
+ closed.resolve(error);
22
+ throw error;
23
+ });
24
+ },
25
+ closed: closed.promise,
26
+ close: function (error) {
27
+ error = error || new Error("Can't get value from closed queue");
28
+ var end = {head: Q.reject(error)};
29
+ end.tail = end;
30
+ ends.resolve(end);
31
+ return closed.promise;
32
+ }
33
+ };
34
+ }
35
+
@@ -0,0 +1,306 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ --------------------------------------------------
205
+ SOFTWARE DISTRIBUTED WITH THRIFT:
206
+
207
+ The Apache Thrift software includes a number of subcomponents with
208
+ separate copyright notices and license terms. Your use of the source
209
+ code for the these subcomponents is subject to the terms and
210
+ conditions of the following licenses.
211
+
212
+ --------------------------------------------------
213
+ Portions of the following files are licensed under the MIT License:
214
+
215
+ lib/erl/src/Makefile.am
216
+
217
+ Please see doc/otp-base-license.txt for the full terms of this license.
218
+
219
+ --------------------------------------------------
220
+ For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
221
+
222
+ # Copyright (c) 2007 Thomas Porschberg <thomas@randspringer.de>
223
+ #
224
+ # Copying and distribution of this file, with or without
225
+ # modification, are permitted in any medium without royalty provided
226
+ # the copyright notice and this notice are preserved.
227
+
228
+ --------------------------------------------------
229
+ For the lib/nodejs/lib/thrift/json_parse.js:
230
+
231
+ /*
232
+ json_parse.js
233
+ 2015-05-02
234
+ Public Domain.
235
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
236
+
237
+ */
238
+ (By Douglas Crockford <douglas@crockford.com>)
239
+
240
+ --------------------------------------------------
241
+ For lib/cpp/src/thrift/windows/SocketPair.cpp
242
+
243
+ /* socketpair.c
244
+ * Copyright 2007 by Nathan C. Myers <ncm@cantrip.org>; some rights reserved.
245
+ * This code is Free Software. It may be copied freely, in original or
246
+ * modified form, subject only to the restrictions that (1) the author is
247
+ * relieved from all responsibilities for any use for any purpose, and (2)
248
+ * this copyright notice must be retained, unchanged, in its entirety. If
249
+ * for any reason the author might be held responsible for any consequences
250
+ * of copying or use, license is withheld.
251
+ */
252
+
253
+
254
+ --------------------------------------------------
255
+ For lib/py/compat/win32/stdint.h
256
+
257
+ // ISO C9x compliant stdint.h for Microsoft Visual Studio
258
+ // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
259
+ //
260
+ // Copyright (c) 2006-2008 Alexander Chemeris
261
+ //
262
+ // Redistribution and use in source and binary forms, with or without
263
+ // modification, are permitted provided that the following conditions are met:
264
+ //
265
+ // 1. Redistributions of source code must retain the above copyright notice,
266
+ // this list of conditions and the following disclaimer.
267
+ //
268
+ // 2. Redistributions in binary form must reproduce the above copyright
269
+ // notice, this list of conditions and the following disclaimer in the
270
+ // documentation and/or other materials provided with the distribution.
271
+ //
272
+ // 3. The name of the author may be used to endorse or promote products
273
+ // derived from this software without specific prior written permission.
274
+ //
275
+ // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
276
+ // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
277
+ // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
278
+ // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
279
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
280
+ // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
281
+ // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
282
+ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
283
+ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
284
+ // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
285
+ //
286
+ ///////////////////////////////////////////////////////////////////////////////
287
+
288
+
289
+ --------------------------------------------------
290
+ Codegen template in t_html_generator.h
291
+
292
+ * Bootstrap v2.0.3
293
+ *
294
+ * Copyright 2012 Twitter, Inc
295
+ * Licensed under the Apache License v2.0
296
+ * http://www.apache.org/licenses/LICENSE-2.0
297
+ *
298
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
299
+
300
+ ---------------------------------------------------
301
+ For t_cl_generator.cc
302
+
303
+ * Copyright (c) 2008- Patrick Collison <patrick@collison.ie>
304
+ * Copyright (c) 2006- Facebook
305
+
306
+ ---------------------------------------------------
@@ -0,0 +1,210 @@
1
+ Apache Thrift
2
+ =============
3
+
4
+ Introduction
5
+ ============
6
+
7
+ Thrift is a lightweight, language-independent software stack for
8
+ point-to-point RPC implementation.
9
+ Thrift provides clean abstractions and implementations for data transport,
10
+ data serialization, and application level processing. The code generation
11
+ system takes a simple definition language as input and generates code
12
+ across programming languages that uses the abstracted stack to build
13
+ interoperable RPC clients and servers.
14
+
15
+ ![Apache Thrift Layered Architecture](doc/images/thrift-layers.png)
16
+
17
+ Thrift makes it easy for programs written in different programming
18
+ languages to share data and call remote procedures. With support
19
+ for [28 programming languages](LANGUAGES.md), chances are Thrift
20
+ supports the languages that you currently use.
21
+
22
+ Thrift is specifically designed to support non-atomic version changes
23
+ across client and server code. This allows you to upgrade your
24
+ server while still being able to service older clients; or have newer
25
+ clients issue requests to older servers. An excellent community-provided
26
+ write-up about thrift and compatibility when versioning an API can be
27
+ found in the [Thrift Missing Guide](https://diwakergupta.github.io/thrift-missing-guide/#_versioning_compatibility).
28
+
29
+ For more details on Thrift's design and implementation, see the Thrift
30
+ whitepaper included in this distribution, or at the README.md file
31
+ in your particular subdirectory of interest.
32
+
33
+ Status
34
+ ======
35
+
36
+ | Branch | Travis | Appveyor | Coverity Scan | codecov.io | Website |
37
+ | :----- | :----- | :------- | :------------ | :--------- | :------ |
38
+ | [`master`](https://github.com/apache/thrift/tree/master) | [![Build Status](https://travis-ci.org/apache/thrift.svg?branch=master)](https://travis-ci.org/apache/thrift/branches) | [![Build status](https://ci.appveyor.com/api/projects/status/github/apache/thrift?branch=master&svg=true)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/thrift/history) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/1345/badge.svg)](https://scan.coverity.com/projects/thrift) | | [![Website](https://img.shields.io/badge/official-website-brightgreen.svg)](https://thrift.apache.org/) |
39
+ | [`0.14.0`](https://github.com/apache/thrift/tree/0.14.0) | [![Build Status](https://travis-ci.org/apache/thrift.svg?branch=0.14.0)](https://travis-ci.org/apache/thrift/branches) | | | | |
40
+
41
+ Releases
42
+ ========
43
+
44
+ Thrift does not maintain a specific release calendar at this time.
45
+
46
+ We strive to release twice yearly. Download the [current release](http://thrift.apache.org/download).
47
+
48
+ License
49
+ =======
50
+
51
+ Licensed to the Apache Software Foundation (ASF) under one
52
+ or more contributor license agreements. See the NOTICE file
53
+ distributed with this work for additional information
54
+ regarding copyright ownership. The ASF licenses this file
55
+ to you under the Apache License, Version 2.0 (the
56
+ "License"); you may not use this file except in compliance
57
+ with the License. You may obtain a copy of the License at
58
+
59
+ http://www.apache.org/licenses/LICENSE-2.0
60
+
61
+ Unless required by applicable law or agreed to in writing,
62
+ software distributed under the License is distributed on an
63
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
64
+ KIND, either express or implied. See the License for the
65
+ specific language governing permissions and limitations
66
+ under the License.
67
+
68
+ Project Hierarchy
69
+ =================
70
+
71
+ thrift/
72
+
73
+ compiler/
74
+
75
+ Contains the Thrift compiler, implemented in C++.
76
+
77
+ lib/
78
+
79
+ Contains the Thrift software library implementation, subdivided by
80
+ language of implementation.
81
+
82
+ cpp/
83
+ go/
84
+ java/
85
+ php/
86
+ py/
87
+ rb/
88
+ ...
89
+
90
+ test/
91
+
92
+ Contains sample Thrift files and test code across the target programming
93
+ languages.
94
+
95
+ tutorial/
96
+
97
+ Contains a basic tutorial that will teach you how to develop software
98
+ using Thrift.
99
+
100
+ Development
101
+ ===========
102
+
103
+ To build the same way Travis CI builds the project you should use docker.
104
+ We have [comprehensive building instructions for docker](build/docker/README.md).
105
+
106
+ Requirements
107
+ ============
108
+
109
+ See http://thrift.apache.org/docs/install for a list of build requirements (may be stale). Alternatively, see the docker build environments for a list of prerequisites.
110
+
111
+ Resources
112
+ =========
113
+
114
+ More information about Thrift can be obtained on the Thrift webpage at:
115
+
116
+ http://thrift.apache.org
117
+
118
+ Acknowledgments
119
+ ===============
120
+
121
+ Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo,
122
+ and also by Google's protocol buffers.
123
+
124
+ Installation
125
+ ============
126
+
127
+ If you are building from the first time out of the source repository, you will
128
+ need to generate the configure scripts. (This is not necessary if you
129
+ downloaded a tarball.) From the top directory, do:
130
+
131
+ ./bootstrap.sh
132
+
133
+ Once the configure scripts are generated, thrift can be configured.
134
+ From the top directory, do:
135
+
136
+ ./configure
137
+
138
+ You may need to specify the location of the boost files explicitly.
139
+ If you installed boost in `/usr/local`, you would run configure as follows:
140
+
141
+ ./configure --with-boost=/usr/local
142
+
143
+ Note that by default the thrift C++ library is typically built with debugging
144
+ symbols included. If you want to customize these options you should use the
145
+ CXXFLAGS option in configure, as such:
146
+
147
+ ./configure CXXFLAGS='-g -O2'
148
+ ./configure CFLAGS='-g -O2'
149
+ ./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
150
+
151
+ To enable gcov required options -fprofile-arcs -ftest-coverage enable them:
152
+
153
+ ./configure --enable-coverage
154
+
155
+ Run ./configure --help to see other configuration options
156
+
157
+ Please be aware that the Python library will ignore the --prefix option
158
+ and just install wherever Python's distutils puts it (usually along
159
+ the lines of `/usr/lib/pythonX.Y/site-packages/`). If you need to control
160
+ where the Python modules are installed, set the PY_PREFIX variable.
161
+ (DESTDIR is respected for Python and C++.)
162
+
163
+ Make thrift:
164
+
165
+ make
166
+
167
+ From the top directory, become superuser and do:
168
+
169
+ make install
170
+
171
+ Uninstall thrift:
172
+
173
+ make uninstall
174
+
175
+ Note that some language packages must be installed manually using build tools
176
+ better suited to those languages (at the time of this writing, this applies
177
+ to Java, Ruby, PHP).
178
+
179
+ Look for the README.md file in the lib/<language>/ folder for more details on the
180
+ installation of each language library package.
181
+
182
+ Package Managers
183
+ ================
184
+
185
+ Apache Thrift is available via a number of package managers, a list which is
186
+ is steadily growing. A more detailed overview can be found
187
+ [at the Apache Thrift web site under "Libraries"](http://thrift.apache.org/lib/)
188
+ and/or in the respective READMEs for each language under /lib
189
+
190
+ Testing
191
+ =======
192
+
193
+ There are a large number of client library tests that can all be run
194
+ from the top-level directory.
195
+
196
+ make -k check
197
+
198
+ This will make all of the libraries (as necessary), and run through
199
+ the unit tests defined in each of the client libraries. If a single
200
+ language fails, the make check will continue on and provide a synopsis
201
+ at the end.
202
+
203
+ To run the cross-language test suite, please run:
204
+
205
+ make cross
206
+
207
+ This will run a set of tests that use different language clients and
208
+ servers.
209
+
210
+
@@ -0,0 +1,142 @@
1
+ Thrift Node.js Library
2
+ =========================
3
+
4
+ License
5
+ -------
6
+ Licensed to the Apache Software Foundation (ASF) under one
7
+ or more contributor license agreements. See the NOTICE file
8
+ distributed with this work for additional information
9
+ regarding copyright ownership. The ASF licenses this file
10
+ to you under the Apache License, Version 2.0 (the
11
+ "License"); you may not use this file except in compliance
12
+ with the License. You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing,
17
+ software distributed under the License is distributed on an
18
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
+ KIND, either express or implied. See the License for the
20
+ specific language governing permissions and limitations
21
+ under the License.
22
+
23
+ ## Compatibility
24
+
25
+ node version 6 or later is required
26
+
27
+ ## Install
28
+
29
+ npm install thrift
30
+
31
+ ## Thrift Compiler
32
+
33
+ You can compile IDL sources for Node.js with the following command:
34
+
35
+ thrift --gen js:node thrift_file
36
+
37
+ ## Cassandra Client Example:
38
+
39
+ Here is a Cassandra example:
40
+
41
+ ```js
42
+ var thrift = require('thrift'),
43
+ Cassandra = require('./gen-nodejs/Cassandra')
44
+ ttypes = require('./gen-nodejs/cassandra_types');
45
+
46
+ var connection = thrift.createConnection("localhost", 9160),
47
+ client = thrift.createClient(Cassandra, connection);
48
+
49
+ connection.on('error', function(err) {
50
+ console.error(err);
51
+ });
52
+
53
+ client.get_slice("Keyspace", "key", new ttypes.ColumnParent({column_family: "ExampleCF"}), new ttypes.SlicePredicate({slice_range: new ttypes.SliceRange({start: '', finish: ''})}), ttypes.ConsistencyLevel.ONE, function(err, data) {
54
+ if (err) {
55
+ // handle err
56
+ } else {
57
+ // data == [ttypes.ColumnOrSuperColumn, ...]
58
+ }
59
+ connection.end();
60
+ });
61
+ ```
62
+
63
+ <a name="int64"></a>
64
+ ## Int64
65
+
66
+ Since JavaScript represents all numbers as doubles, int64 values cannot be accurately represented naturally. To solve this, int64 values in responses will be wrapped with Thrift.Int64 objects. The Int64 implementation used is [broofa/node-int64](https://github.com/broofa/node-int64).
67
+
68
+ ## Client and server examples
69
+
70
+ Several example clients and servers are included in the thrift/lib/nodejs/examples folder and the cross language tutorial thrift/tutorial/nodejs folder.
71
+
72
+ ## Use on browsers
73
+
74
+ You can use code generated with js:node on browsers with Webpack. Here is an example.
75
+
76
+ thrift --gen js:node,ts,es6,with_ns
77
+
78
+ ```javascript
79
+ import * as thrift from 'thrift';
80
+ import { MyServiceClient } from '../gen-nodejs/MyService';
81
+
82
+ let host = window.location.hostname;
83
+ let port = 443;
84
+ let opts = {
85
+ transport: thrift.TBufferedTransport,
86
+ protocol: thrift.TJSONProtocol,
87
+ headers: {
88
+ 'Content-Type': 'application/vnd.apache.thrift.json',
89
+ },
90
+ https: true,
91
+ path: '/url/path',
92
+ useCORS: true,
93
+ };
94
+
95
+ let connection = thrift.createXHRConnection(host, port, opts);
96
+ let thriftClient = thrift.createXHRClient(MyServiceClient, connection);
97
+
98
+ connection.on('error', (err) => {
99
+ console.error(err);
100
+ });
101
+
102
+ thriftClient.myService(param)
103
+ .then((result) => {
104
+ console.log(result);
105
+ })
106
+ .catch((err) => {
107
+ ....
108
+ });
109
+ ```
110
+
111
+ Bundlers, like webpack, will use thrift/browser.js by default because of the
112
+ `"browser": "./lib/nodejs/lib/thrift/browser.js"` field in package.json.
113
+
114
+ ### Browser example with WebSocket, BufferedTransport and BinaryProtocol
115
+ ```javascript
116
+ import thrift from 'thrift';
117
+ import { MyServiceClient } from '../gen-nodejs/MyService';
118
+
119
+ const host = window.location.hostname;
120
+ const port = 9090;
121
+ const opts = {
122
+ transport: thrift.TBufferedTransport,
123
+ protocol: thrift.TBinaryProtocol
124
+ }
125
+ const connection = thrift.createWSConnection(host, port, opts);
126
+ connection.open();
127
+ const thriftClient = thrift.createWSClient(MyServiceClient, connection);
128
+
129
+ connection.on('error', (err) => {
130
+ console.error(err);
131
+ });
132
+
133
+ thriftClient.myService(param)
134
+ .then((result) => {
135
+ console.log(result);
136
+ })
137
+ .catch((err) => {
138
+ ....
139
+ });
140
+ ```
141
+
142
+