@infino-ai/infino 0.2.0 → 0.2.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.
package/infino/index.d.ts CHANGED
@@ -18,7 +18,15 @@ export type SchemaDescriptor = Record<string, string | {
18
18
  }>;
19
19
  /** Accepted shapes for `Table.append`. */
20
20
  export type AppendData = RowRecord[] | arrow.Table | arrow.RecordBatch | Buffer | Uint8Array;
21
- /** Storage and cache config the `connect` URI can't carry. All optional. */
21
+ /**
22
+ * Storage and cache config the `connect` URI can't carry. All optional.
23
+ *
24
+ * Which options apply depends on the backend: `apiKey` is for a hosted
25
+ * (Infino Cloud) connection, while the storage/cache options — `storageOptions`,
26
+ * `cacheDir`, `cacheBudgetBytes`, `coldFetchMode`, `validate` — apply to **local
27
+ * connections only**; Infino Cloud manages storage, so it ignores them.
28
+ * `connectionMemoryBudgetBytes` applies to both.
29
+ */
22
30
  export interface ConnectOptions {
23
31
  /**
24
32
  * Credentials/tuning for the URI-selected backend, keyed by `object_store`
@@ -46,6 +54,12 @@ export interface ConnectOptions {
46
54
  * on bad credentials instead of on the first table operation.
47
55
  */
48
56
  validate?: boolean;
57
+ /**
58
+ * API key for a hosted (`https://<host>/<database>`) connection, sent as a
59
+ * bearer credential. Ignored by local backends. Falls back to the
60
+ * `INFINO_API_KEY` environment variable when omitted.
61
+ */
62
+ apiKey?: string;
49
63
  }
50
64
  /** Row counts returned by `update` / `delete`. */
51
65
  export interface MutationStats {
@@ -135,8 +149,10 @@ export interface CountOptions {
135
149
  export interface QueryOptions {
136
150
  arrow?: boolean;
137
151
  }
152
+ /** A table handle. Obtain one from {@link Connection.createTable} or {@link Connection.openTable}. */
138
153
  export declare class Table {
139
154
  private inner;
155
+ /** @hidden */
140
156
  constructor(inner: any);
141
157
  /** The table's Arrow schema. */
142
158
  schema(): arrow.Schema;
@@ -187,16 +203,28 @@ export declare class Table {
187
203
  /** Delete rows matching a SQL predicate (e.g. `"status = 'spam'"`).
188
204
  * Requires durable storage (not `memory://`). */
189
205
  delete(predicate: string): MutationStats;
190
- /** Merge small / underfilled superfiles into larger ones (omit `settings`
191
- * for engine defaults). */
206
+ /**
207
+ * Merge small / underfilled superfiles into larger ones (omit `settings`
208
+ * for engine defaults).
209
+ *
210
+ * **Local connections only.** On Infino Cloud, compaction is managed for you,
211
+ * so calling this on a hosted (`https://…`) connection throws.
212
+ */
192
213
  optimize(settings?: OptimizeOptions): void;
193
- /** Delete orphaned storage objects left by compaction or interrupted writes.
214
+ /**
215
+ * Delete orphaned storage objects left by compaction or interrupted writes.
194
216
  * Only objects older than `graceSecs` (a safety window against racing
195
- * readers/writers) are removed. Requires durable storage (not `memory://`). */
217
+ * readers/writers) are removed. Requires durable storage (not `memory://`).
218
+ *
219
+ * **Local connections only.** On Infino Cloud, cleanup is managed for you, so
220
+ * calling this on a hosted connection throws.
221
+ */
196
222
  gc(graceSecs: number): GcReport;
197
223
  }
224
+ /** A catalog connection. Create one with {@link connect}. */
198
225
  export declare class Connection {
199
226
  private inner;
227
+ /** @hidden */
200
228
  constructor(inner: any);
201
229
  /**
202
230
  * Provision the database this connection targets. On the hosted service this
@@ -215,5 +243,24 @@ export declare class Connection {
215
243
  }): arrow.Table;
216
244
  querySql(sql: string, opts?: QueryOptions): RowRecord[];
217
245
  }
218
- /** Open (or create) a catalog rooted at `uri`. */
246
+ /**
247
+ * Open a connection to Infino. The `uri` selects the backend:
248
+ *
249
+ * - a local path (`"./data"`) or `"memory://"` — embedded, in-process;
250
+ * - an object-store URI (`"s3://…"`, `"gs://…"`, `"az://…"`) — embedded over
251
+ * your own bucket;
252
+ * - `"https://<host>/<database>"` — Infino Cloud, the hosted service.
253
+ *
254
+ * For a hosted (`https://`) target, authenticate with an API key: pass
255
+ * {@link ConnectOptions.apiKey}, or set the `INFINO_API_KEY` environment
256
+ * variable. Storage and cache tuning the URI can't carry also goes in
257
+ * `options` (see {@link ConnectOptions}).
258
+ *
259
+ * ```ts
260
+ * // local
261
+ * const db = connect("./data");
262
+ * // Infino Cloud
263
+ * const cloud = connect("https://api.platform.infino.ai/my-app", { apiKey: "inf_…" });
264
+ * ```
265
+ */
219
266
  export declare function connect(uri: string, options?: ConnectOptions): Connection;
package/infino/index.js CHANGED
@@ -190,8 +190,10 @@ function decode(buf, asArrow) {
190
190
  });
191
191
  }
192
192
  // --- friendly handles ---
193
+ /** A table handle. Obtain one from {@link Connection.createTable} or {@link Connection.openTable}. */
193
194
  class Table {
194
195
  inner;
196
+ /** @hidden */
195
197
  constructor(inner) {
196
198
  this.inner = inner;
197
199
  }
@@ -245,21 +247,33 @@ class Table {
245
247
  delete(predicate) {
246
248
  return this.inner.delete(predicate);
247
249
  }
248
- /** Merge small / underfilled superfiles into larger ones (omit `settings`
249
- * for engine defaults). */
250
+ /**
251
+ * Merge small / underfilled superfiles into larger ones (omit `settings`
252
+ * for engine defaults).
253
+ *
254
+ * **Local connections only.** On Infino Cloud, compaction is managed for you,
255
+ * so calling this on a hosted (`https://…`) connection throws.
256
+ */
250
257
  optimize(settings) {
251
258
  this.inner.optimize(settings);
252
259
  }
253
- /** Delete orphaned storage objects left by compaction or interrupted writes.
260
+ /**
261
+ * Delete orphaned storage objects left by compaction or interrupted writes.
254
262
  * Only objects older than `graceSecs` (a safety window against racing
255
- * readers/writers) are removed. Requires durable storage (not `memory://`). */
263
+ * readers/writers) are removed. Requires durable storage (not `memory://`).
264
+ *
265
+ * **Local connections only.** On Infino Cloud, cleanup is managed for you, so
266
+ * calling this on a hosted connection throws.
267
+ */
256
268
  gc(graceSecs) {
257
269
  return this.inner.gc(graceSecs);
258
270
  }
259
271
  }
260
272
  exports.Table = Table;
273
+ /** A catalog connection. Create one with {@link connect}. */
261
274
  class Connection {
262
275
  inner;
276
+ /** @hidden */
263
277
  constructor(inner) {
264
278
  this.inner = inner;
265
279
  }
@@ -289,7 +303,26 @@ class Connection {
289
303
  }
290
304
  }
291
305
  exports.Connection = Connection;
292
- /** Open (or create) a catalog rooted at `uri`. */
306
+ /**
307
+ * Open a connection to Infino. The `uri` selects the backend:
308
+ *
309
+ * - a local path (`"./data"`) or `"memory://"` — embedded, in-process;
310
+ * - an object-store URI (`"s3://…"`, `"gs://…"`, `"az://…"`) — embedded over
311
+ * your own bucket;
312
+ * - `"https://<host>/<database>"` — Infino Cloud, the hosted service.
313
+ *
314
+ * For a hosted (`https://`) target, authenticate with an API key: pass
315
+ * {@link ConnectOptions.apiKey}, or set the `INFINO_API_KEY` environment
316
+ * variable. Storage and cache tuning the URI can't carry also goes in
317
+ * `options` (see {@link ConnectOptions}).
318
+ *
319
+ * ```ts
320
+ * // local
321
+ * const db = connect("./data");
322
+ * // Infino Cloud
323
+ * const cloud = connect("https://api.platform.infino.ai/my-app", { apiKey: "inf_…" });
324
+ * ```
325
+ */
293
326
  function connect(uri, options) {
294
327
  return new Connection((0, native_js_1.connect)(uri, options));
295
328
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infino-ai/infino",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Fast search on object storage — SQL, full-text, and vector search.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -82,12 +82,12 @@
82
82
  "apache-arrow": "^17"
83
83
  },
84
84
  "optionalDependencies": {
85
- "infx-darwin-x64": "0.2.0",
86
- "infx-darwin-arm64": "0.2.0",
87
- "infx-linux-x64-gnu": "0.2.0",
88
- "infx-linux-arm64-gnu": "0.2.0",
89
- "infx-linux-x64-musl": "0.2.0",
90
- "infx-linux-arm64-musl": "0.2.0"
85
+ "infx-darwin-x64": "0.2.1",
86
+ "infx-darwin-arm64": "0.2.1",
87
+ "infx-linux-x64-gnu": "0.2.1",
88
+ "infx-linux-arm64-gnu": "0.2.1",
89
+ "infx-linux-x64-musl": "0.2.1",
90
+ "infx-linux-arm64-musl": "0.2.1"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@napi-rs/cli": "^2.18.0",