@useairfoil/flight 0.4.0 → 0.4.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.
@@ -0,0 +1,13 @@
1
+ //#region rolldown:runtime
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (all) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ return target;
10
+ };
11
+
12
+ //#endregion
13
+ export { __export as t };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,48 @@
1
- import { CallOptions, Channel, ChannelCredentials, ChannelOptions, CompatServiceDefinition, DefaultCallOptions, Metadata, NormalizedServiceDefinition } from "nice-grpc";
2
- import * as apache_arrow0 from "apache-arrow";
3
- import { RecordBatch, Schema } from "apache-arrow";
1
+ import { Config, Context, Effect, Layer, Scope, Stream } from "effect";
2
+ import { CallOptions, CallOptions as CallOptions$1, Channel, ChannelCredentials, ChannelOptions, CompatServiceDefinition, DefaultCallOptions, NormalizedServiceDefinition } from "nice-grpc";
3
+ import { RecordBatch, RecordBatch as RecordBatch$1, Schema, TypeMap } from "apache-arrow";
4
4
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
5
+ import * as effect_Types0 from "effect/Types";
6
+ import * as effect_Cause0 from "effect/Cause";
5
7
 
8
+ //#region src/record-batch-with-metadata.d.ts
9
+ type RecordBatchWithMetadata<T extends TypeMap = any> = {
10
+ readonly batch: RecordBatch<T>;
11
+ readonly appMetadata: Uint8Array;
12
+ };
13
+ declare namespace flight_client_error_d_exports {
14
+ export { FlightClientError, FlightClientErrorLike, FlightDecodeError, FlightProtocolError, FlightTransportError };
15
+ }
16
+ declare const FlightClientError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => effect_Cause0.YieldableError & {
17
+ readonly _tag: "FlightClientError";
18
+ } & Readonly<A>;
19
+ declare class FlightClientError extends FlightClientError_base<{
20
+ readonly message: string;
21
+ readonly cause?: unknown;
22
+ }> {}
23
+ declare const FlightTransportError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => effect_Cause0.YieldableError & {
24
+ readonly _tag: "FlightTransportError";
25
+ } & Readonly<A>;
26
+ declare class FlightTransportError extends FlightTransportError_base<{
27
+ readonly message: string;
28
+ readonly cause?: unknown;
29
+ }> {}
30
+ declare const FlightDecodeError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => effect_Cause0.YieldableError & {
31
+ readonly _tag: "FlightDecodeError";
32
+ } & Readonly<A>;
33
+ declare class FlightDecodeError extends FlightDecodeError_base<{
34
+ readonly message: string;
35
+ readonly cause?: unknown;
36
+ }> {}
37
+ declare const FlightProtocolError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => effect_Cause0.YieldableError & {
38
+ readonly _tag: "FlightProtocolError";
39
+ } & Readonly<A>;
40
+ declare class FlightProtocolError extends FlightProtocolError_base<{
41
+ readonly message: string;
42
+ readonly cause?: unknown;
43
+ }> {}
44
+ type FlightClientErrorLike = FlightClientError | FlightTransportError | FlightDecodeError | FlightProtocolError;
45
+ //#endregion
6
46
  //#region src/proto-utils.d.ts
7
47
  type RemoveTypeUrl<T> = Omit<T, "$type">;
8
48
  type ClientOptions<S extends CompatServiceDefinition> = {
@@ -20,7 +60,6 @@ type HostOrChannel = {
20
60
  declare function createChannelFromConfig(config: HostOrChannel): Channel;
21
61
  //#endregion
22
62
  //#region src/proto/Flight.d.ts
23
-
24
63
  /** The request that a client provides to a server on handshake. */
25
64
  interface HandshakeRequest {
26
65
  $type: "arrow.flight.protocol.HandshakeRequest";
@@ -494,7 +533,7 @@ type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<inf
494
533
  readonly $case: T["$case"];
495
534
  } : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial$1<T[K]> } : Partial<T>;
496
535
  type KeysOfUnion$1<T> = T extends T ? keyof T : never;
497
- type Exact$1<P, I extends P> = P extends Builtin$1 ? P : P & { [K in keyof P]: Exact$1<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion$1<P> | "$type">]: never };
536
+ type Exact$1<P$1, I extends P$1> = P$1 extends Builtin$1 ? P$1 : P$1 & { [K in keyof P$1]: Exact$1<P$1[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion$1<P$1> | "$type">]: never };
498
537
  interface MessageFns$1<T, V extends string> {
499
538
  readonly $type: V;
500
539
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
@@ -504,41 +543,26 @@ interface MessageFns$1<T, V extends string> {
504
543
  create<I extends Exact$1<DeepPartial$1<T>, I>>(base?: I): T;
505
544
  fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
506
545
  }
507
- //#endregion
508
- //#region src/arrow-flight.d.ts
509
- declare class ArrowFlightClient {
510
- private client;
511
- constructor(config: HostOrChannel, options?: ClientOptions<FlightServiceDefinition>);
512
- executeFlightInfo(info: FlightInfo, options?: CallOptions): AsyncGenerator<RecordBatch>;
513
- /**
514
- * Handshake between client and server.
515
- *
516
- * Depending on the server, the handshake may be required to determine the
517
- * token that should be used for future operations. Both request and response
518
- * are streams to allow multiple round-trips depending on auth mechanism.
519
- */
520
- handshake(request: AsyncIterable<HandshakeRequest>, options?: CallOptions): AsyncIterable<HandshakeResponse>;
521
- /** Get a list of available streams given a particular criteria. */
522
- getFlightInfo(request: FlightDescriptor, options?: CallOptions): Promise<FlightInfo>;
523
- /**
524
- * Retrieve a single stream associated with a particular descriptor
525
- * associated with the referenced ticket. A Flight can be composed of one or
526
- * more streams where each stream can be retrieved using a separate opaque
527
- * ticket that the flight service uses for managing a collection of streams.
528
- */
529
- doGet(request: Ticket, options: {
530
- schema: Schema;
531
- } & CallOptions): AsyncIterable<RecordBatch>;
532
- /**
533
- * Push a stream to the flight service associated with a particular
534
- * flight stream. This allows a client of a flight service to upload a stream
535
- * of data. Depending on the particular flight service, a client consumer
536
- * could be allowed to upload a single stream per descriptor or an unlimited
537
- * number. In the latter, the service might implement a 'seal' action that
538
- * can be applied to a descriptor once all streams are uploaded.
539
- */
540
- doPut(request: AsyncIterable<FlightData>, options?: CallOptions): AsyncIterable<PutResult>;
546
+ declare namespace arrow_flight_client_d_exports {
547
+ export { ArrowFlightClient, ArrowFlightClientOptions, ArrowFlightClientService, CallOptions$1 as CallOptions, ClientOptions, HostOrChannel, RecordBatch$1 as RecordBatch, RecordBatchWithMetadata, layer$1 as layer, layerConfig$1 as layerConfig, make$1 as make };
541
548
  }
549
+ type ArrowFlightClientOptions = HostOrChannel & {
550
+ readonly defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<FlightServiceDefinition>>;
551
+ };
552
+ interface ArrowFlightClientService {
553
+ readonly handshake: (request: AsyncIterable<HandshakeRequest>, options?: CallOptions$1) => Stream.Stream<HandshakeResponse, FlightClientErrorLike>;
554
+ readonly getFlightInfo: (request: FlightDescriptor, options?: CallOptions$1) => Effect.Effect<FlightInfo, FlightClientErrorLike>;
555
+ readonly doGet: (request: Ticket, options: {
556
+ readonly schema: Schema;
557
+ } & CallOptions$1) => Stream.Stream<RecordBatchWithMetadata, FlightClientErrorLike>;
558
+ readonly doPut: (request: AsyncIterable<FlightData>, options?: CallOptions$1) => AsyncIterable<PutResult>;
559
+ readonly executeFlightInfo: (info: FlightInfo, options?: CallOptions$1) => Stream.Stream<RecordBatchWithMetadata, FlightClientErrorLike>;
560
+ }
561
+ declare const ArrowFlightClient_base: Context.ServiceClass<ArrowFlightClient, "@useairfoil/flight/ArrowFlightClient", ArrowFlightClientService>;
562
+ declare class ArrowFlightClient extends ArrowFlightClient_base {}
563
+ declare const make$1: (options: ArrowFlightClientOptions) => Effect.Effect<ArrowFlightClientService, never, Scope.Scope>;
564
+ declare const layer$1: (options: ArrowFlightClientOptions) => Layer.Layer<ArrowFlightClient>;
565
+ declare const layerConfig$1: (options: Config.Wrap<ArrowFlightClientOptions>) => Layer.Layer<ArrowFlightClient, Config.ConfigError, never>;
542
566
  //#endregion
543
567
  //#region src/proto/FlightSql.d.ts
544
568
 
@@ -703,7 +727,7 @@ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U
703
727
  readonly $case: T["$case"];
704
728
  } : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> } : Partial<T>;
705
729
  type KeysOfUnion<T> = T extends T ? keyof T : never;
706
- type Exact<P, I extends P> = P extends Builtin ? P : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
730
+ type Exact<P$1, I extends P$1> = P$1 extends Builtin ? P$1 : P$1 & { [K in keyof P$1]: Exact<P$1[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P$1> | "$type">]: never };
707
731
  interface MessageFns<T, V extends string> {
708
732
  readonly $type: V;
709
733
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
@@ -713,18 +737,23 @@ interface MessageFns<T, V extends string> {
713
737
  create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
714
738
  fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
715
739
  }
716
- //#endregion
717
- //#region src/arrow-flight-sql.d.ts
718
- declare class ArrowFlightSqlClient {
719
- private inner;
720
- constructor(config: HostOrChannel, options?: ClientOptions<FlightServiceDefinition>);
721
- executeFlightInfo(request: FlightInfo, options?: CallOptions): AsyncGenerator<apache_arrow0.RecordBatch<any>, any, any>;
722
- getCatalogs(request: RemoveTypeUrl<CommandGetCatalogs>, options?: CallOptions): Promise<FlightInfo>;
723
- getDbSchemas(request: RemoveTypeUrl<CommandGetDbSchemas>, options?: CallOptions): Promise<FlightInfo>;
724
- getTables(request: RemoveTypeUrl<CommandGetTables>, options?: CallOptions): Promise<FlightInfo>;
725
- getTableTypes(request: RemoveTypeUrl<CommandGetTableTypes>, options?: CallOptions): Promise<FlightInfo>;
726
- executeQuery(request: RemoveTypeUrl<CommandStatementQuery>, options?: CallOptions): Promise<FlightInfo>;
740
+ declare namespace arrow_flight_sql_client_d_exports {
741
+ export { ArrowFlightSqlClient, ArrowFlightSqlClientOptions, ArrowFlightSqlClientService, CallOptions, FlightInfo, RecordBatchWithMetadata, layer, layerConfig, make };
742
+ }
743
+ type ArrowFlightSqlClientOptions = ArrowFlightClientOptions;
744
+ interface ArrowFlightSqlClientService {
745
+ readonly executeFlightInfo: (info: FlightInfo, options?: CallOptions) => Stream.Stream<RecordBatchWithMetadata, FlightClientErrorLike>;
746
+ readonly getCatalogs: (request: RemoveTypeUrl<CommandGetCatalogs>, options?: CallOptions) => Effect.Effect<FlightInfo, FlightClientErrorLike>;
747
+ readonly getDbSchemas: (request: RemoveTypeUrl<CommandGetDbSchemas>, options?: CallOptions) => Effect.Effect<FlightInfo, FlightClientErrorLike>;
748
+ readonly getTables: (request: RemoveTypeUrl<CommandGetTables>, options?: CallOptions) => Effect.Effect<FlightInfo, FlightClientErrorLike>;
749
+ readonly getTableTypes: (request: RemoveTypeUrl<CommandGetTableTypes>, options?: CallOptions) => Effect.Effect<FlightInfo, FlightClientErrorLike>;
750
+ readonly executeQuery: (request: RemoveTypeUrl<CommandStatementQuery>, options?: CallOptions) => Effect.Effect<FlightInfo, FlightClientErrorLike>;
727
751
  }
752
+ declare const ArrowFlightSqlClient_base: Context.ServiceClass<ArrowFlightSqlClient, "@useairfoil/flight/ArrowFlightSqlClient", ArrowFlightSqlClientService>;
753
+ declare class ArrowFlightSqlClient extends ArrowFlightSqlClient_base {}
754
+ declare const make: (options: ArrowFlightClientOptions) => Effect.Effect<ArrowFlightSqlClientService, never, Scope.Scope>;
755
+ declare const layer: (options: ArrowFlightSqlClientOptions) => Layer.Layer<ArrowFlightSqlClient>;
756
+ declare const layerConfig: (options: Config.Wrap<ArrowFlightSqlClientOptions>) => Layer.Layer<ArrowFlightSqlClient, Config.ConfigError, never>;
728
757
  //#endregion
729
758
  //#region src/flight-data-encoder.d.ts
730
759
  declare const FlightDataEncoder: {
@@ -745,5 +774,5 @@ declare const FlightDataEncoder: {
745
774
  }): ReadonlyArray<FlightData>;
746
775
  };
747
776
  //#endregion
748
- export { ArrowFlightClient, ArrowFlightSqlClient, type ClientOptions, FlightData, FlightDataEncoder, FlightDescriptor, FlightDescriptor_DescriptorType, type HostOrChannel, Metadata, PutResult, Ticket, createChannelFromConfig };
777
+ export { arrow_flight_client_d_exports as ArrowFlightClient, type ArrowFlightClientOptions, type ArrowFlightClientService, arrow_flight_sql_client_d_exports as ArrowFlightSqlClient, type ArrowFlightSqlClientOptions, type ArrowFlightSqlClientService, type ClientOptions, flight_client_error_d_exports as FlightClientError, type FlightClientErrorLike, FlightData, FlightDataEncoder, FlightDescriptor, FlightDescriptor_DescriptorType, type FlightInfo, type HostOrChannel, PutResult, type RecordBatchWithMetadata, Ticket, createChannelFromConfig };
749
778
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
- import { Metadata, createChannel, createClient } from "nice-grpc";
1
+ import { t as __export } from "./chunk-Bp6m_JJh.js";
2
+ import { Config, Context, Data, Effect, Layer, Scope, Stream } from "effect";
3
+ import { createChannel, createClient } from "nice-grpc";
2
4
  import { Message, MessageHeader, RecordBatch, Struct, Vector, compressionRegistry, makeData } from "apache-arrow";
3
5
  import { ITERATOR_DONE } from "apache-arrow/io/interfaces";
4
6
  import { COMPRESS_LENGTH_PREFIX, LENGTH_NO_COMPRESSED_DATA } from "apache-arrow/ipc/compression/constants";
@@ -132,7 +134,10 @@ var RecordBatchStreamReaderFromFlightData = class extends RecordBatchReaderImpl
132
134
  const header = message.header();
133
135
  return {
134
136
  done: false,
135
- value: this._loadRecordBatch(header, flight.dataBody)
137
+ value: {
138
+ batch: this._loadRecordBatch(header, flight.dataBody),
139
+ appMetadata: flight.appMetadata
140
+ }
136
141
  };
137
142
  } else if (message.isDictionaryBatch()) {
138
143
  this._dictionaryIndex++;
@@ -145,7 +150,10 @@ var RecordBatchStreamReaderFromFlightData = class extends RecordBatchReaderImpl
145
150
  this._recordBatchIndex++;
146
151
  return {
147
152
  done: false,
148
- value: new _InternalEmptyPlaceholderRecordBatch(this.schema)
153
+ value: {
154
+ batch: new _InternalEmptyPlaceholderRecordBatch(this.schema),
155
+ appMetadata: new Uint8Array(0)
156
+ }
149
157
  };
150
158
  }
151
159
  return ITERATOR_DONE;
@@ -174,6 +182,19 @@ function decodeFlightDataStream(stream, { expectedSchema: _expectedSchema }) {
174
182
  return new RecordBatchStreamReaderFromFlightData(stream);
175
183
  }
176
184
 
185
+ //#endregion
186
+ //#region src/flight-client-error.ts
187
+ var flight_client_error_exports = /* @__PURE__ */ __export({
188
+ FlightClientError: () => FlightClientError,
189
+ FlightDecodeError: () => FlightDecodeError,
190
+ FlightProtocolError: () => FlightProtocolError,
191
+ FlightTransportError: () => FlightTransportError
192
+ });
193
+ var FlightClientError = class extends Data.TaggedError("FlightClientError") {};
194
+ var FlightTransportError = class extends Data.TaggedError("FlightTransportError") {};
195
+ var FlightDecodeError = class extends Data.TaggedError("FlightDecodeError") {};
196
+ var FlightProtocolError = class extends Data.TaggedError("FlightProtocolError") {};
197
+
177
198
  //#endregion
178
199
  //#region src/proto-utils.ts
179
200
  function createChannelFromConfig(config) {
@@ -1668,62 +1689,60 @@ function isSet$2(value) {
1668
1689
  }
1669
1690
 
1670
1691
  //#endregion
1671
- //#region src/arrow-flight.ts
1672
- var ArrowFlightClient = class {
1673
- client;
1674
- constructor(config, options = {}) {
1675
- this.client = createClient(FlightServiceDefinition, createChannelFromConfig(config), options.defaultCallOptions);
1692
+ //#region src/arrow-flight-client.ts
1693
+ var arrow_flight_client_exports = /* @__PURE__ */ __export({
1694
+ ArrowFlightClient: () => ArrowFlightClient,
1695
+ layer: () => layer$1,
1696
+ layerConfig: () => layerConfig$1,
1697
+ make: () => make
1698
+ });
1699
+ var ArrowFlightClient = class extends Context.Service()("@useairfoil/flight/ArrowFlightClient") {};
1700
+ const mapTransportError = (message, cause) => new FlightTransportError({
1701
+ message,
1702
+ cause
1703
+ });
1704
+ const mapDecodeError = (message, cause) => new FlightDecodeError({
1705
+ message,
1706
+ cause
1707
+ });
1708
+ const streamFromAsyncIterable = (iterable, message) => Stream.fromAsyncIterable(iterable, (cause) => mapTransportError(message, cause));
1709
+ const make = Effect.fnUntraced(function* (options) {
1710
+ const ownsChannel = "host" in options;
1711
+ const channel = createChannelFromConfig(options);
1712
+ const client = createClient(FlightServiceDefinition, channel, options.defaultCallOptions);
1713
+ if (ownsChannel) {
1714
+ const scope = yield* Scope.Scope;
1715
+ yield* Scope.addFinalizer(scope, Effect.sync(() => {
1716
+ channel.close();
1717
+ }));
1676
1718
  }
1677
- executeFlightInfo(info, options) {
1719
+ const doGet = (request, options$1) => {
1720
+ const { schema: expectedSchema } = options$1;
1721
+ return Stream.fromAsyncIterable(decodeFlightDataStream(client.doGet(request, options$1), { expectedSchema }), (cause) => mapDecodeError("Flight batch decoding failed", cause));
1722
+ };
1723
+ const executeFlightInfo = (info, options$1) => {
1678
1724
  const schema = decodeSchemaFromFlightInfo(info);
1679
- if (!schema) throw new Error("FlightInfo must have a schema");
1680
- const client = this;
1681
- return (async function* () {
1682
- for (const endpoint of info.endpoint) {
1683
- if (endpoint.ticket === void 0) continue;
1684
- yield* client.doGet(endpoint.ticket, {
1685
- schema,
1686
- ...options
1687
- });
1688
- }
1689
- })();
1690
- }
1691
- /**
1692
- * Handshake between client and server.
1693
- *
1694
- * Depending on the server, the handshake may be required to determine the
1695
- * token that should be used for future operations. Both request and response
1696
- * are streams to allow multiple round-trips depending on auth mechanism.
1697
- */
1698
- handshake(request, options) {
1699
- return this.client.handshake(request, options);
1700
- }
1701
- /** Get a list of available streams given a particular criteria. */
1702
- getFlightInfo(request, options) {
1703
- return this.client.getFlightInfo(request, options);
1704
- }
1705
- /**
1706
- * Retrieve a single stream associated with a particular descriptor
1707
- * associated with the referenced ticket. A Flight can be composed of one or
1708
- * more streams where each stream can be retrieved using a separate opaque
1709
- * ticket that the flight service uses for managing a collection of streams.
1710
- */
1711
- doGet(request, options) {
1712
- const { schema: expectedSchema } = options;
1713
- return decodeFlightDataStream(this.client.doGet(request, options), { expectedSchema });
1714
- }
1715
- /**
1716
- * Push a stream to the flight service associated with a particular
1717
- * flight stream. This allows a client of a flight service to upload a stream
1718
- * of data. Depending on the particular flight service, a client consumer
1719
- * could be allowed to upload a single stream per descriptor or an unlimited
1720
- * number. In the latter, the service might implement a 'seal' action that
1721
- * can be applied to a descriptor once all streams are uploaded.
1722
- */
1723
- doPut(request, options) {
1724
- return this.client.doPut(request, options);
1725
- }
1726
- };
1725
+ if (!schema) return Stream.fail(new FlightProtocolError({ message: "FlightInfo must include a schema" }));
1726
+ return Stream.fromIterable(info.endpoint).pipe(Stream.flatMap((endpoint) => endpoint.ticket === void 0 ? Stream.empty : doGet(endpoint.ticket, {
1727
+ schema,
1728
+ ...options$1
1729
+ })));
1730
+ };
1731
+ return ArrowFlightClient.of({
1732
+ handshake: (request, options$1) => streamFromAsyncIterable(client.handshake(request, options$1), "Flight handshake failed"),
1733
+ getFlightInfo: (request, options$1) => Effect.tryPromise({
1734
+ try: () => client.getFlightInfo(request, options$1),
1735
+ catch: (cause) => mapTransportError("Flight getFlightInfo failed", cause)
1736
+ }),
1737
+ doGet,
1738
+ doPut: (request, options$1) => client.doPut(request, options$1),
1739
+ executeFlightInfo
1740
+ });
1741
+ });
1742
+ const layer$1 = (options) => Layer.effect(ArrowFlightClient, make(options));
1743
+ const layerConfig$1 = (options) => Layer.effect(ArrowFlightClient, Effect.gen(function* () {
1744
+ return yield* make(yield* Config.unwrap(options));
1745
+ }));
1727
1746
 
1728
1747
  //#endregion
1729
1748
  //#region src/proto/any.ts
@@ -4022,51 +4041,44 @@ function isSet(value) {
4022
4041
  }
4023
4042
 
4024
4043
  //#endregion
4025
- //#region src/arrow-flight-sql.ts
4026
- var ArrowFlightSqlClient = class {
4027
- inner;
4028
- constructor(config, options = {}) {
4029
- this.inner = new ArrowFlightClient(config, options);
4030
- }
4031
- executeFlightInfo(request, options) {
4032
- return this.inner.executeFlightInfo(request, options);
4033
- }
4034
- async getCatalogs(request, options) {
4035
- const descriptor = createCommandDescriptor(CommandGetCatalogs.$type, CommandGetCatalogs.encode({
4044
+ //#region src/arrow-flight-sql-client.ts
4045
+ var arrow_flight_sql_client_exports = /* @__PURE__ */ __export({
4046
+ ArrowFlightSqlClient: () => ArrowFlightSqlClient,
4047
+ layer: () => layer,
4048
+ layerConfig: () => layerConfig,
4049
+ make: () => make$1
4050
+ });
4051
+ var ArrowFlightSqlClient = class extends Context.Service()("@useairfoil/flight/ArrowFlightSqlClient") {};
4052
+ const make$1 = Effect.fnUntraced(function* (options) {
4053
+ const inner = yield* make(options);
4054
+ return ArrowFlightSqlClient.of({
4055
+ executeFlightInfo: (info, options$1) => inner.executeFlightInfo(info, options$1),
4056
+ getCatalogs: (request, options$1) => inner.getFlightInfo(createCommandDescriptor(CommandGetCatalogs.$type, CommandGetCatalogs.encode({
4036
4057
  $type: CommandGetCatalogs.$type,
4037
4058
  ...request
4038
- }).finish());
4039
- return this.inner.getFlightInfo(descriptor, options);
4040
- }
4041
- async getDbSchemas(request, options) {
4042
- const descriptor = createCommandDescriptor(CommandGetDbSchemas.$type, CommandGetDbSchemas.encode({
4059
+ }).finish()), options$1),
4060
+ getDbSchemas: (request, options$1) => inner.getFlightInfo(createCommandDescriptor(CommandGetDbSchemas.$type, CommandGetDbSchemas.encode({
4043
4061
  $type: CommandGetDbSchemas.$type,
4044
4062
  ...request
4045
- }).finish());
4046
- return this.inner.getFlightInfo(descriptor, options);
4047
- }
4048
- async getTables(request, options) {
4049
- const descriptor = createCommandDescriptor(CommandGetTables.$type, CommandGetTables.encode({
4063
+ }).finish()), options$1),
4064
+ getTables: (request, options$1) => inner.getFlightInfo(createCommandDescriptor(CommandGetTables.$type, CommandGetTables.encode({
4050
4065
  $type: CommandGetTables.$type,
4051
4066
  ...request
4052
- }).finish());
4053
- return this.inner.getFlightInfo(descriptor, options);
4054
- }
4055
- async getTableTypes(request, options) {
4056
- const descriptor = createCommandDescriptor(CommandGetTableTypes.$type, CommandGetTableTypes.encode({
4067
+ }).finish()), options$1),
4068
+ getTableTypes: (request, options$1) => inner.getFlightInfo(createCommandDescriptor(CommandGetTableTypes.$type, CommandGetTableTypes.encode({
4057
4069
  $type: CommandGetTableTypes.$type,
4058
4070
  ...request
4059
- }).finish());
4060
- return this.inner.getFlightInfo(descriptor, options);
4061
- }
4062
- async executeQuery(request, options) {
4063
- const descriptor = createCommandDescriptor(CommandStatementQuery.$type, CommandStatementQuery.encode({
4071
+ }).finish()), options$1),
4072
+ executeQuery: (request, options$1) => inner.getFlightInfo(createCommandDescriptor(CommandStatementQuery.$type, CommandStatementQuery.encode({
4064
4073
  $type: CommandStatementQuery.$type,
4065
4074
  ...request
4066
- }).finish());
4067
- return this.inner.getFlightInfo(descriptor, options);
4068
- }
4069
- };
4075
+ }).finish()), options$1)
4076
+ });
4077
+ });
4078
+ const layer = (options) => Layer.effect(ArrowFlightSqlClient, make$1(options));
4079
+ const layerConfig = (options) => Layer.effect(ArrowFlightSqlClient, Effect.gen(function* () {
4080
+ return yield* make$1(yield* Config.unwrap(options));
4081
+ }));
4070
4082
  function createCommandDescriptor(typeUrl, value) {
4071
4083
  const cmd = Any.create({
4072
4084
  typeUrl: `type.googleapis.com/${typeUrl}`,
@@ -4129,5 +4141,5 @@ function encodeRecordBatchContent(buffers, byteLength, compression = null) {
4129
4141
  }
4130
4142
 
4131
4143
  //#endregion
4132
- export { ArrowFlightClient, ArrowFlightSqlClient, FlightData, FlightDataEncoder, FlightDescriptor, FlightDescriptor_DescriptorType, Metadata, PutResult, Ticket, createChannelFromConfig };
4144
+ export { arrow_flight_client_exports as ArrowFlightClient, arrow_flight_sql_client_exports as ArrowFlightSqlClient, flight_client_error_exports as FlightClientError, FlightData, FlightDataEncoder, FlightDescriptor, FlightDescriptor_DescriptorType, FlightInfo, PutResult, Ticket, createChannelFromConfig };
4133
4145
  //# sourceMappingURL=index.js.map