@useairfoil/flight 0.3.0 → 0.4.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.
- package/dist/{src/index.d.ts → index.d.ts} +16 -16
- package/dist/{src/index.js → index.js} +8 -8
- package/dist/index.js.map +1 -0
- package/package.json +24 -30
- package/src/arrow-flight-sql.ts +10 -33
- package/src/arrow-flight.ts +11 -34
- package/src/arrow-utils.ts +3 -3
- package/src/flight-data-encoder.ts +5 -13
- package/src/index.ts +1 -5
- package/src/proto/Flight.ts +215 -97
- package/src/proto/FlightSql.ts +537 -291
- package/src/proto/any.ts +16 -9
- package/src/proto/google/protobuf/timestamp.ts +19 -10
- package/src/proto/typeRegistry.ts +11 -7
- package/src/proto-utils.ts +1 -5
- package/src/record-batch-decoder.ts +17 -61
- package/dist/src/index.js.map +0 -1
- package/dist/test/index.d.ts +0 -30
- package/dist/test/index.js +0 -80
- package/dist/test/index.js.map +0 -1
|
@@ -3,6 +3,22 @@ import * as apache_arrow0 from "apache-arrow";
|
|
|
3
3
|
import { RecordBatch, Schema } from "apache-arrow";
|
|
4
4
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
5
5
|
|
|
6
|
+
//#region src/proto-utils.d.ts
|
|
7
|
+
type RemoveTypeUrl<T> = Omit<T, "$type">;
|
|
8
|
+
type ClientOptions<S extends CompatServiceDefinition> = {
|
|
9
|
+
defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<S>>;
|
|
10
|
+
};
|
|
11
|
+
type HostOrChannel = {
|
|
12
|
+
host: string;
|
|
13
|
+
credentials?: ChannelCredentials;
|
|
14
|
+
channelOptions?: ChannelOptions;
|
|
15
|
+
channel?: never;
|
|
16
|
+
} | {
|
|
17
|
+
host?: never;
|
|
18
|
+
channel: Channel;
|
|
19
|
+
};
|
|
20
|
+
declare function createChannelFromConfig(config: HostOrChannel): Channel;
|
|
21
|
+
//#endregion
|
|
6
22
|
//#region src/proto/Flight.d.ts
|
|
7
23
|
|
|
8
24
|
/** The request that a client provides to a server on handshake. */
|
|
@@ -489,22 +505,6 @@ interface MessageFns$1<T, V extends string> {
|
|
|
489
505
|
fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
|
|
490
506
|
}
|
|
491
507
|
//#endregion
|
|
492
|
-
//#region src/proto-utils.d.ts
|
|
493
|
-
type RemoveTypeUrl<T> = Omit<T, "$type">;
|
|
494
|
-
type ClientOptions<S extends CompatServiceDefinition> = {
|
|
495
|
-
defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<S>>;
|
|
496
|
-
};
|
|
497
|
-
type HostOrChannel = {
|
|
498
|
-
host: string;
|
|
499
|
-
credentials?: ChannelCredentials;
|
|
500
|
-
channelOptions?: ChannelOptions;
|
|
501
|
-
channel?: never;
|
|
502
|
-
} | {
|
|
503
|
-
host?: never;
|
|
504
|
-
channel: Channel;
|
|
505
|
-
};
|
|
506
|
-
declare function createChannelFromConfig(config: HostOrChannel): Channel;
|
|
507
|
-
//#endregion
|
|
508
508
|
//#region src/arrow-flight.d.ts
|
|
509
509
|
declare class ArrowFlightClient {
|
|
510
510
|
private client;
|
|
@@ -174,6 +174,13 @@ function decodeFlightDataStream(stream, { expectedSchema: _expectedSchema }) {
|
|
|
174
174
|
return new RecordBatchStreamReaderFromFlightData(stream);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/proto-utils.ts
|
|
179
|
+
function createChannelFromConfig(config) {
|
|
180
|
+
if (config.host !== void 0) return createChannel(config.host, config.credentials, config.channelOptions);
|
|
181
|
+
return config.channel;
|
|
182
|
+
}
|
|
183
|
+
|
|
177
184
|
//#endregion
|
|
178
185
|
//#region src/proto/typeRegistry.ts
|
|
179
186
|
const messageTypeRegistry = /* @__PURE__ */ new Map();
|
|
@@ -1660,13 +1667,6 @@ function isSet$2(value) {
|
|
|
1660
1667
|
return value !== null && value !== void 0;
|
|
1661
1668
|
}
|
|
1662
1669
|
|
|
1663
|
-
//#endregion
|
|
1664
|
-
//#region src/proto-utils.ts
|
|
1665
|
-
function createChannelFromConfig(config) {
|
|
1666
|
-
if (config.host !== void 0) return createChannel(config.host, config.credentials, config.channelOptions);
|
|
1667
|
-
return config.channel;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
1670
|
//#endregion
|
|
1671
1671
|
//#region src/arrow-flight.ts
|
|
1672
1672
|
var ArrowFlightClient = class {
|
|
@@ -4106,7 +4106,7 @@ const FlightDataEncoder = {
|
|
|
4106
4106
|
function encodeRecordBatchContent(buffers, byteLength, compression = null) {
|
|
4107
4107
|
const out = new Uint8Array(byteLength);
|
|
4108
4108
|
const bufGroupSize = compression != null ? 2 : 1;
|
|
4109
|
-
const bufs =
|
|
4109
|
+
const bufs = Array.from({ length: bufGroupSize });
|
|
4110
4110
|
let pos = 0;
|
|
4111
4111
|
for (let i = 0; i < buffers.length; i += bufGroupSize) {
|
|
4112
4112
|
let size = 0;
|