@loams/client 0.1.0 → 0.1.2
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/README.md +104 -4
- package/dist/app.d.ts +149 -0
- package/dist/app.js +317 -0
- package/dist/builders/filter.d.ts +96 -0
- package/dist/builders/filter.js +190 -0
- package/dist/builders/schema.d.ts +50 -0
- package/dist/builders/schema.js +92 -0
- package/dist/builders/search.d.ts +159 -0
- package/dist/builders/search.js +307 -0
- package/dist/gen/facade.d.ts +267 -2
- package/dist/gen/facade.js +194 -0
- package/dist/handle.d.ts +67 -0
- package/dist/handle.js +107 -0
- package/dist/index.d.ts +13 -5
- package/dist/index.js +13 -3
- package/dist/loams.d.ts +78 -3
- package/dist/loams.js +84 -6
- package/dist/node.js +1 -1
- package/dist/runtime/batch.d.ts +29 -0
- package/dist/runtime/batch.js +95 -0
- package/dist/runtime/call.d.ts +63 -9
- package/dist/runtime/call.js +243 -41
- package/dist/runtime/consistency.d.ts +65 -11
- package/dist/runtime/consistency.js +212 -46
- package/dist/runtime/errors.d.ts +29 -2
- package/dist/runtime/errors.js +26 -0
- package/dist/runtime/machine-key.d.ts +33 -0
- package/dist/runtime/machine-key.js +174 -0
- package/dist/runtime/pagination.js +8 -2
- package/dist/runtime/subscribe.d.ts +37 -0
- package/dist/runtime/subscribe.js +128 -0
- package/dist/runtime/token-source.d.ts +1 -1
- package/dist/runtime/token-source.js +1 -1
- package/dist/runtime/transports.d.ts +22 -1
- package/dist/runtime/transports.js +28 -2
- package/dist/vendor/proto/collection-v1.d.ts +3 -0
- package/dist/vendor/proto/collection-v1.js +7 -0
- package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.d.ts +7 -2
- package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.js +5 -1
- package/dist/vendor/proto/gen/loams/collection/v1/collection_pb.d.ts +1610 -0
- package/dist/vendor/proto/gen/loams/collection/v1/collection_pb.js +399 -0
- package/dist/vendor/proto/gen/loams/collection/v1/document_pb.d.ts +1054 -0
- package/dist/vendor/proto/gen/loams/collection/v1/document_pb.js +327 -0
- package/dist/vendor/proto/gen/loams/collection/v1/query_pb.d.ts +2101 -0
- package/dist/vendor/proto/gen/loams/collection/v1/query_pb.js +608 -0
- package/dist/vendor/proto/gen/loams/graph/v1/graph_pb.d.ts +2299 -0
- package/dist/vendor/proto/gen/loams/graph/v1/graph_pb.js +596 -0
- package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.d.ts +23 -7
- package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.js +20 -5
- package/dist/vendor/proto/gen/loams/operations/v1/operations_pb.d.ts +399 -0
- package/dist/vendor/proto/gen/loams/operations/v1/operations_pb.js +118 -0
- package/dist/vendor/proto/gen/loams/sql/v1/sql_pb.d.ts +182 -0
- package/dist/vendor/proto/gen/loams/sql/v1/sql_pb.js +72 -0
- package/dist/vendor/proto/gen/loams/stream/v1/stream_pb.d.ts +688 -0
- package/dist/vendor/proto/gen/loams/stream/v1/stream_pb.js +180 -0
- package/package.json +2 -2
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { ListValue, Value } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { Consistency } from "../../collection/v1/document_pb.js";
|
|
4
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
5
|
+
/**
|
|
6
|
+
* Describes the file loams/sql/v1/sql.proto.
|
|
7
|
+
*/
|
|
8
|
+
export declare const file_loams_sql_v1_sql: GenFile;
|
|
9
|
+
/**
|
|
10
|
+
* @generated from message loams.sql.v1.QueryRequest
|
|
11
|
+
*/
|
|
12
|
+
export type QueryRequest = Message<"loams.sql.v1.QueryRequest"> & {
|
|
13
|
+
/**
|
|
14
|
+
* The namespace whose collections are the statement's tables.
|
|
15
|
+
*
|
|
16
|
+
* @generated from field: string namespace = 1;
|
|
17
|
+
*/
|
|
18
|
+
namespace: string;
|
|
19
|
+
/**
|
|
20
|
+
* One read-only SQL statement.
|
|
21
|
+
*
|
|
22
|
+
* @generated from field: string sql = 2;
|
|
23
|
+
*/
|
|
24
|
+
sql: string;
|
|
25
|
+
/**
|
|
26
|
+
* The values of `$1…$n`, in order.
|
|
27
|
+
*
|
|
28
|
+
* @generated from field: repeated google.protobuf.Value params = 3;
|
|
29
|
+
*/
|
|
30
|
+
params: Value[];
|
|
31
|
+
/**
|
|
32
|
+
* How fresh the read is; strong when unset.
|
|
33
|
+
*
|
|
34
|
+
* @generated from field: loams.collection.v1.Consistency consistency = 4;
|
|
35
|
+
*/
|
|
36
|
+
consistency?: Consistency | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* At most this many rows (default 10 000, at most 100 000).
|
|
39
|
+
*
|
|
40
|
+
* @generated from field: optional uint32 max_rows = 5;
|
|
41
|
+
*/
|
|
42
|
+
maxRows?: number | undefined;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Describes the message loams.sql.v1.QueryRequest.
|
|
46
|
+
* Use `create(QueryRequestSchema)` to create a new message.
|
|
47
|
+
*/
|
|
48
|
+
export declare const QueryRequestSchema: GenMessage<QueryRequest>;
|
|
49
|
+
/**
|
|
50
|
+
* One result column: its name and its Arrow type, as Arrow prints it
|
|
51
|
+
* (`Int64`, `Utf8`, `List(Float32)`).
|
|
52
|
+
*
|
|
53
|
+
* @generated from message loams.sql.v1.Column
|
|
54
|
+
*/
|
|
55
|
+
export type Column = Message<"loams.sql.v1.Column"> & {
|
|
56
|
+
/**
|
|
57
|
+
* @generated from field: string name = 1;
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* @generated from field: string type = 2;
|
|
62
|
+
*/
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Describes the message loams.sql.v1.Column.
|
|
67
|
+
* Use `create(ColumnSchema)` to create a new message.
|
|
68
|
+
*/
|
|
69
|
+
export declare const ColumnSchema: GenMessage<Column>;
|
|
70
|
+
/**
|
|
71
|
+
* @generated from message loams.sql.v1.QueryResponse
|
|
72
|
+
*/
|
|
73
|
+
export type QueryResponse = Message<"loams.sql.v1.QueryResponse"> & {
|
|
74
|
+
/**
|
|
75
|
+
* @generated from field: repeated loams.sql.v1.Column columns = 1;
|
|
76
|
+
*/
|
|
77
|
+
columns: Column[];
|
|
78
|
+
/**
|
|
79
|
+
* One list per row, one value per column, in column order. A 64-bit
|
|
80
|
+
* integer past 2^53 is a decimal string, so it stays exact.
|
|
81
|
+
*
|
|
82
|
+
* @generated from field: repeated google.protobuf.ListValue rows = 2;
|
|
83
|
+
*/
|
|
84
|
+
rows: ListValue[];
|
|
85
|
+
/**
|
|
86
|
+
* More rows existed than `max_rows` allowed.
|
|
87
|
+
*
|
|
88
|
+
* @generated from field: bool truncated = 3;
|
|
89
|
+
*/
|
|
90
|
+
truncated: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The token the read was answered at, when it waited for one.
|
|
93
|
+
*
|
|
94
|
+
* @generated from field: string consistency_token = 4;
|
|
95
|
+
*/
|
|
96
|
+
consistencyToken: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Describes the message loams.sql.v1.QueryResponse.
|
|
100
|
+
* Use `create(QueryResponseSchema)` to create a new message.
|
|
101
|
+
*/
|
|
102
|
+
export declare const QueryResponseSchema: GenMessage<QueryResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* @generated from message loams.sql.v1.QueryArrowRequest
|
|
105
|
+
*/
|
|
106
|
+
export type QueryArrowRequest = Message<"loams.sql.v1.QueryArrowRequest"> & {
|
|
107
|
+
/**
|
|
108
|
+
* @generated from field: string namespace = 1;
|
|
109
|
+
*/
|
|
110
|
+
namespace: string;
|
|
111
|
+
/**
|
|
112
|
+
* @generated from field: string sql = 2;
|
|
113
|
+
*/
|
|
114
|
+
sql: string;
|
|
115
|
+
/**
|
|
116
|
+
* @generated from field: repeated google.protobuf.Value params = 3;
|
|
117
|
+
*/
|
|
118
|
+
params: Value[];
|
|
119
|
+
/**
|
|
120
|
+
* @generated from field: loams.collection.v1.Consistency consistency = 4;
|
|
121
|
+
*/
|
|
122
|
+
consistency?: Consistency | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* @generated from field: optional uint32 max_rows = 5;
|
|
125
|
+
*/
|
|
126
|
+
maxRows?: number | undefined;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Describes the message loams.sql.v1.QueryArrowRequest.
|
|
130
|
+
* Use `create(QueryArrowRequestSchema)` to create a new message.
|
|
131
|
+
*/
|
|
132
|
+
export declare const QueryArrowRequestSchema: GenMessage<QueryArrowRequest>;
|
|
133
|
+
/**
|
|
134
|
+
* @generated from message loams.sql.v1.QueryArrowResponse
|
|
135
|
+
*/
|
|
136
|
+
export type QueryArrowResponse = Message<"loams.sql.v1.QueryArrowResponse"> & {
|
|
137
|
+
/**
|
|
138
|
+
* The result as one Arrow IPC stream: the schema, then the batches.
|
|
139
|
+
*
|
|
140
|
+
* @generated from field: bytes arrow_ipc = 1;
|
|
141
|
+
*/
|
|
142
|
+
arrowIpc: Uint8Array;
|
|
143
|
+
/**
|
|
144
|
+
* @generated from field: bool truncated = 2;
|
|
145
|
+
*/
|
|
146
|
+
truncated: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* @generated from field: string consistency_token = 3;
|
|
149
|
+
*/
|
|
150
|
+
consistencyToken: string;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Describes the message loams.sql.v1.QueryArrowResponse.
|
|
154
|
+
* Use `create(QueryArrowResponseSchema)` to create a new message.
|
|
155
|
+
*/
|
|
156
|
+
export declare const QueryArrowResponseSchema: GenMessage<QueryArrowResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* @generated from service loams.sql.v1.SqlService
|
|
159
|
+
*/
|
|
160
|
+
export declare const SqlService: GenService<{
|
|
161
|
+
/**
|
|
162
|
+
* Runs one read-only statement and answers its rows.
|
|
163
|
+
*
|
|
164
|
+
* @generated from rpc loams.sql.v1.SqlService.Query
|
|
165
|
+
*/
|
|
166
|
+
query: {
|
|
167
|
+
methodKind: "unary";
|
|
168
|
+
input: typeof QueryRequestSchema;
|
|
169
|
+
output: typeof QueryResponseSchema;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Runs one read-only statement and answers its result as an Arrow IPC
|
|
173
|
+
* stream.
|
|
174
|
+
*
|
|
175
|
+
* @generated from rpc loams.sql.v1.SqlService.QueryArrow
|
|
176
|
+
*/
|
|
177
|
+
queryArrow: {
|
|
178
|
+
methodKind: "unary";
|
|
179
|
+
input: typeof QueryArrowRequestSchema;
|
|
180
|
+
output: typeof QueryArrowResponseSchema;
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// SQL over a namespace's collections (design §44 §5.1; API2 Task 1; SDKP
|
|
2
|
+
// P0b, docs/plans/2026-10-19-sdk-parity.md).
|
|
3
|
+
//
|
|
4
|
+
// `SqlService/Query` runs one read-only statement through the same
|
|
5
|
+
// DataFusion context the native REST route (`POST /v1/namespaces/{ns}/sql`)
|
|
6
|
+
// and Flight SQL use: the namespace's collections are its tables, the search
|
|
7
|
+
// table functions are in scope, and anything that is not a query is
|
|
8
|
+
// `invalid_argument`. Rows come back as JSON-shaped values; `QueryArrow`
|
|
9
|
+
// answers the same result as one Arrow IPC stream for callers that read
|
|
10
|
+
// Arrow.
|
|
11
|
+
//
|
|
12
|
+
// ## Parameters
|
|
13
|
+
//
|
|
14
|
+
// `params` binds the positional placeholders `$1…$n`, in order. A value is
|
|
15
|
+
// cast to the type the planner inferred for its placeholder (`n > $1` on an
|
|
16
|
+
// `i64` column binds a JSON number as an `Int64`), and a statement whose
|
|
17
|
+
// placeholder count is not the number of values given is `invalid_argument`
|
|
18
|
+
// with reason `sql_param_count`. Named placeholders (`$name`) are not
|
|
19
|
+
// accepted. A list or an object is not a scalar and is refused.
|
|
20
|
+
//
|
|
21
|
+
// ## Limits
|
|
22
|
+
//
|
|
23
|
+
// `max_rows` (default 10 000, at most 100 000) caps the rows a statement
|
|
24
|
+
// answers; `truncated` says more existed. A statement runs within the
|
|
25
|
+
// server's SQL timeout. `QueryArrow`'s stream is capped at
|
|
26
|
+
// `--sql-arrow-max-bytes` (16 MiB by default); over it the call is
|
|
27
|
+
// `resource_exhausted` with reason `result_too_large` and `metadata.use =
|
|
28
|
+
// "flight"`, because Flight SQL streams a result of any size.
|
|
29
|
+
//
|
|
30
|
+
// ## Consistency
|
|
31
|
+
//
|
|
32
|
+
// `consistency` is `loams.collection.v1.Consistency`, read by the same rule
|
|
33
|
+
// as `GetDocuments`: `at_least` waits for a write's token, `pin` reads a
|
|
34
|
+
// pinned version, and the `loams-consistency-token` request header merges
|
|
35
|
+
// in.
|
|
36
|
+
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
37
|
+
import { file_google_protobuf_struct } from "@bufbuild/protobuf/wkt";
|
|
38
|
+
import { file_loams_collection_v1_document } from "../../collection/v1/document_pb.js";
|
|
39
|
+
import { file_loams_options_v1_options } from "../../options/v1/options_pb.js";
|
|
40
|
+
/**
|
|
41
|
+
* Describes the file loams/sql/v1/sql.proto.
|
|
42
|
+
*/
|
|
43
|
+
export const file_loams_sql_v1_sql = /*@__PURE__*/ fileDesc("ChZsb2Ftcy9zcWwvdjEvc3FsLnByb3RvEgxsb2Ftcy5zcWwudjEisQEKDFF1ZXJ5UmVxdWVzdBIRCgluYW1lc3BhY2UYASABKAkSCwoDc3FsGAIgASgJEiYKBnBhcmFtcxgDIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZRI1Cgtjb25zaXN0ZW5jeRgEIAEoCzIgLmxvYW1zLmNvbGxlY3Rpb24udjEuQ29uc2lzdGVuY3kSFQoIbWF4X3Jvd3MYBSABKA1IAIgBAUILCglfbWF4X3Jvd3MiJAoGQ29sdW1uEgwKBG5hbWUYASABKAkSDAoEdHlwZRgCIAEoCSKOAQoNUXVlcnlSZXNwb25zZRIlCgdjb2x1bW5zGAEgAygLMhQubG9hbXMuc3FsLnYxLkNvbHVtbhIoCgRyb3dzGAIgAygLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZRIRCgl0cnVuY2F0ZWQYAyABKAgSGQoRY29uc2lzdGVuY3lfdG9rZW4YBCABKAkitgEKEVF1ZXJ5QXJyb3dSZXF1ZXN0EhEKCW5hbWVzcGFjZRgBIAEoCRILCgNzcWwYAiABKAkSJgoGcGFyYW1zGAMgAygLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlEjUKC2NvbnNpc3RlbmN5GAQgASgLMiAubG9hbXMuY29sbGVjdGlvbi52MS5Db25zaXN0ZW5jeRIVCghtYXhfcm93cxgFIAEoDUgAiAEBQgsKCV9tYXhfcm93cyJVChJRdWVyeUFycm93UmVzcG9uc2USEQoJYXJyb3dfaXBjGAEgASgMEhEKCXRydW5jYXRlZBgCIAEoCBIZChFjb25zaXN0ZW5jeV90b2tlbhgDIAEoCTKfAgoKU3FsU2VydmljZRJQCgVRdWVyeRIaLmxvYW1zLnNxbC52MS5RdWVyeVJlcXVlc3QaGy5sb2Ftcy5zcWwudjEuUXVlcnlSZXNwb25zZSIOkAIBkrUYBxIFcXVlcnkSZQoKUXVlcnlBcnJvdxIfLmxvYW1zLnNxbC52MS5RdWVyeUFycm93UmVxdWVzdBogLmxvYW1zLnNxbC52MS5RdWVyeUFycm93UmVzcG9uc2UiFJACAZK1GA0SC3F1ZXJ5X2Fycm93GliKtRhUCgNzcWwSTVNRTDogb25lIHJlYWQtb25seSBzdGF0ZW1lbnQgb3ZlciBhIG5hbWVzcGFjZSdzIGNvbGxlY3Rpb25zLCB3aXRoIHBhcmFtZXRlcnMuYgZwcm90bzM", [file_google_protobuf_struct, file_loams_collection_v1_document, file_loams_options_v1_options]);
|
|
44
|
+
/**
|
|
45
|
+
* Describes the message loams.sql.v1.QueryRequest.
|
|
46
|
+
* Use `create(QueryRequestSchema)` to create a new message.
|
|
47
|
+
*/
|
|
48
|
+
export const QueryRequestSchema = /*@__PURE__*/ messageDesc(file_loams_sql_v1_sql, 0);
|
|
49
|
+
/**
|
|
50
|
+
* Describes the message loams.sql.v1.Column.
|
|
51
|
+
* Use `create(ColumnSchema)` to create a new message.
|
|
52
|
+
*/
|
|
53
|
+
export const ColumnSchema = /*@__PURE__*/ messageDesc(file_loams_sql_v1_sql, 1);
|
|
54
|
+
/**
|
|
55
|
+
* Describes the message loams.sql.v1.QueryResponse.
|
|
56
|
+
* Use `create(QueryResponseSchema)` to create a new message.
|
|
57
|
+
*/
|
|
58
|
+
export const QueryResponseSchema = /*@__PURE__*/ messageDesc(file_loams_sql_v1_sql, 2);
|
|
59
|
+
/**
|
|
60
|
+
* Describes the message loams.sql.v1.QueryArrowRequest.
|
|
61
|
+
* Use `create(QueryArrowRequestSchema)` to create a new message.
|
|
62
|
+
*/
|
|
63
|
+
export const QueryArrowRequestSchema = /*@__PURE__*/ messageDesc(file_loams_sql_v1_sql, 3);
|
|
64
|
+
/**
|
|
65
|
+
* Describes the message loams.sql.v1.QueryArrowResponse.
|
|
66
|
+
* Use `create(QueryArrowResponseSchema)` to create a new message.
|
|
67
|
+
*/
|
|
68
|
+
export const QueryArrowResponseSchema = /*@__PURE__*/ messageDesc(file_loams_sql_v1_sql, 4);
|
|
69
|
+
/**
|
|
70
|
+
* @generated from service loams.sql.v1.SqlService
|
|
71
|
+
*/
|
|
72
|
+
export const SqlService = /*@__PURE__*/ serviceDesc(file_loams_sql_v1_sql, 0);
|