@lancedb/lancedb 0.40.0-beta.1 → 0.40.0-beta.11

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.
@@ -4,6 +4,7 @@ import { Job } from "./job";
4
4
  import { MaterializedView, MaterializedViewSelect } from "./materialized_view";
5
5
  import { Connection as LanceDbConnection } from "./native";
6
6
  import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, JobInfo, ListNamespacesResponse, ListTablesResponse } from "./native";
7
+ import { ViewDescription } from "./view";
7
8
  export type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, ListNamespacesResponse, ListTablesResponse, };
8
9
  import { Table } from "./table";
9
10
  export interface CreateTableOptions {
@@ -298,6 +299,43 @@ export declare abstract class Connection {
298
299
  * Rejects a table that exists but is not a materialized view.
299
300
  */
300
301
  abstract dropMaterializedViewAsync(name: string, namespacePath?: string[]): Promise<Job>;
302
+ /**
303
+ * Create a view: a named query the database plans on every read.
304
+ *
305
+ * The query is planned once, at creation, so one that cannot be planned is
306
+ * rejected now rather than at the first read. A view holds no rows, and its
307
+ * readers see its sources as they are at read time.
308
+ *
309
+ * There is no replace: a name already taken is an error, and changing a
310
+ * view is a drop followed by a create.
311
+ */
312
+ abstract createView(name: string, query: string, namespacePath?: string[]): Promise<ViewDescription>;
313
+ /**
314
+ * What this database records about the view named `name`: its defining
315
+ * query and the schema that query resolved to.
316
+ */
317
+ abstract describeView(name: string, namespacePath?: string[]): Promise<ViewDescription>;
318
+ /**
319
+ * Drop the view named `name` and wait for its definition to be deleted.
320
+ *
321
+ * The tables it reads are untouched: a view holds no rows of its own. Use
322
+ * {@link dropViewAsync} to retain the cleanup job instead of waiting on it.
323
+ */
324
+ abstract dropView(name: string, namespacePath?: string[]): Promise<void>;
325
+ /**
326
+ * Start dropping the view named `name` and return the job deleting its
327
+ * definition, without waiting for completion.
328
+ *
329
+ * The name is free before this resolves. When nothing was bound to it, the
330
+ * returned job is already finished and has no id.
331
+ */
332
+ abstract dropViewAsync(name: string, namespacePath?: string[]): Promise<Job>;
333
+ /**
334
+ * The names of the views in one namespace.
335
+ *
336
+ * Names only; a definition comes from {@link describeView}.
337
+ */
338
+ abstract listViews(namespacePath?: string[]): Promise<string[]>;
301
339
  abstract openTable(name: string, namespacePath?: string[], options?: Partial<OpenTableOptions>): Promise<Table>;
302
340
  /**
303
341
  * Creates a new Table and initialize it with new data.
@@ -483,6 +521,11 @@ export declare class LocalConnection extends Connection {
483
521
  listMaterializedViews(): Promise<string[]>;
484
522
  dropMaterializedView(name: string, namespacePath?: string[]): Promise<void>;
485
523
  dropMaterializedViewAsync(name: string, namespacePath?: string[]): Promise<Job>;
524
+ createView(name: string, query: string, namespacePath?: string[]): Promise<ViewDescription>;
525
+ describeView(name: string, namespacePath?: string[]): Promise<ViewDescription>;
526
+ dropView(name: string, namespacePath?: string[]): Promise<void>;
527
+ dropViewAsync(name: string, namespacePath?: string[]): Promise<Job>;
528
+ listViews(namespacePath?: string[]): Promise<string[]>;
486
529
  listTables(namespacePathOrOptions?: string[] | Partial<ListTablesOptions>, options?: Partial<ListTablesOptions>): Promise<ListTablesResponse>;
487
530
  openTable(name: string, namespacePath?: string[], options?: Partial<OpenTableOptions>): Promise<Table>;
488
531
  cloneTable(targetTableName: string, sourceUri: string, options?: {
@@ -9,6 +9,7 @@ const arrow_2 = require("./arrow");
9
9
  const registry_1 = require("./embedding/registry");
10
10
  const job_1 = require("./job");
11
11
  const materialized_view_1 = require("./materialized_view");
12
+ const view_1 = require("./view");
12
13
  const sanitize_1 = require("./sanitize");
13
14
  const table_1 = require("./table");
14
15
  /**
@@ -87,6 +88,21 @@ class LocalConnection extends Connection {
87
88
  async dropMaterializedViewAsync(name, namespacePath) {
88
89
  return new job_1.Job(await this.inner.dropMaterializedViewAsync(name, namespacePath ?? []));
89
90
  }
91
+ async createView(name, query, namespacePath) {
92
+ return (0, view_1.viewDescriptionFromNative)(await this.inner.createView(name, query, namespacePath ?? []));
93
+ }
94
+ async describeView(name, namespacePath) {
95
+ return (0, view_1.viewDescriptionFromNative)(await this.inner.describeView(name, namespacePath ?? []));
96
+ }
97
+ async dropView(name, namespacePath) {
98
+ return this.inner.dropView(name, namespacePath ?? []);
99
+ }
100
+ async dropViewAsync(name, namespacePath) {
101
+ return new job_1.Job(await this.inner.dropViewAsync(name, namespacePath ?? []));
102
+ }
103
+ async listViews(namespacePath) {
104
+ return this.inner.listViews(namespacePath ?? []);
105
+ }
90
106
  async listTables(namespacePathOrOptions, options) {
91
107
  // Detect if first argument is namespacePath array or options object
92
108
  const namespacePath = Array.isArray(namespacePathOrOptions)
package/dist/index.d.ts CHANGED
@@ -4,9 +4,10 @@ import { HeaderProvider } from "./header";
4
4
  import type { BaseTokenizer } from "./indices";
5
5
  import type { FtsToken } from "./table";
6
6
  export { MaterializedView, MaterializedViewDefinition, MaterializedViewSelect, } from "./materialized_view";
7
+ export { ViewDescription } from "./view";
7
8
  export { JsHeaderProvider as NativeJsHeaderProvider } from "./native.js";
8
9
  export { instrumentLanceDbMetrics } from "./otel";
9
- export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, RefreshColumnResult, RefreshMaterializedViewResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
10
+ export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, RefreshColumnResult, FunctionErrors, FunctionErrorsOptions, FunctionErrorRecord, FunctionErrorFragment, RefreshMaterializedViewResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
10
11
  export { makeArrowTable, makeJsonField, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
11
12
  export { blob, isBlobField, BlobFile } from "./blob";
12
13
  export type { BlobOptions } from "./blob";
@@ -2,20 +2,20 @@ import { RefreshMaterializedViewResult } from "./native";
2
2
  import { Table } from "./table";
3
3
  /** Schema metadata key holding a materialized view's definition. */
4
4
  export declare const DEFINITION_META_KEY = "mv.definition";
5
- /** The query that defines a materialized view. */
5
+ /**
6
+ * The newest stored layout this version reads: `{"format": N, "query": "<SQL>"}`,
7
+ * format 2 being a query with `GROUP BY`.
8
+ */
9
+ export declare const DEFINITION_FORMAT = 2;
10
+ /**
11
+ * The query that defines a materialized view, as stored:
12
+ * `SELECT columns FROM [ns.]table [, function(args) AS alias | , UNNEST(column) AS alias]
13
+ * [WHERE predicate] [GROUP BY expr, ...] [LIMIT n]`. A Function in `FROM`
14
+ * position yields one row per element it returns.
15
+ */
6
16
  export interface MaterializedViewDefinition {
7
- /** Name of the source table, in the same database as the view. */
8
- sourceTable: string;
9
- /** `[output column, SQL expression]` pairs, in view schema order. */
10
- projections: [string, string][];
11
- /** SQL predicate selecting the source rows the view holds. */
12
- filter?: string;
13
- /** Cap on the number of rows the view holds. */
14
- limit?: number;
15
- /** Source columns the projections and filter read. */
16
- inputs: string[];
17
- /** Namespace holding the source table; empty is the root namespace. */
18
- sourceNamespace: string[];
17
+ /** The defining query, in the canonical spelling the server stores. */
18
+ query: string;
19
19
  }
20
20
  /**
21
21
  * The view's columns: column names, `[alias, SQL expression]` pairs, or a
@@ -2,13 +2,18 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // SPDX-FileCopyrightText: Copyright The LanceDB Authors
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.MaterializedView = exports.DEFINITION_META_KEY = void 0;
5
+ exports.MaterializedView = exports.DEFINITION_FORMAT = exports.DEFINITION_META_KEY = void 0;
6
6
  exports.validateNonNegativeInteger = validateNonNegativeInteger;
7
7
  exports.normalizeSelect = normalizeSelect;
8
8
  exports.definitionFromMetadata = definitionFromMetadata;
9
9
  exports.definitionFromJson = definitionFromJson;
10
10
  /** Schema metadata key holding a materialized view's definition. */
11
11
  exports.DEFINITION_META_KEY = "mv.definition";
12
+ /**
13
+ * The newest stored layout this version reads: `{"format": N, "query": "<SQL>"}`,
14
+ * format 2 being a query with `GROUP BY`.
15
+ */
16
+ exports.DEFINITION_FORMAT = 2;
12
17
  /**
13
18
  * @internal Reject a numeric option N-API would otherwise silently coerce:
14
19
  * `Infinity` reaches Rust as 0, `1.5` as 1.
@@ -49,12 +54,18 @@ function definitionFromMetadata(metadata, name) {
49
54
  function definitionFromJson(raw, name) {
50
55
  // biome-ignore lint/suspicious/noExplicitAny: raw JSON
51
56
  const value = JSON.parse(raw);
52
- // "namespaced_select" keeps older readers from resolving the source at root.
53
- if (value.kind !== undefined &&
54
- value.kind !== "select" &&
55
- value.kind !== "namespaced_select") {
56
- throw new Error(`materialized view '${name}' is defined by '${value.kind}', which this ` +
57
- "version of lancedb cannot refresh");
57
+ if (value.format !== undefined) {
58
+ // A newer writer's layout is reported, never guessed at.
59
+ if (!Number.isInteger(value.format) || value.format > exports.DEFINITION_FORMAT) {
60
+ throw new Error(`materialized view '${name}' is stored in format ${value.format}, ` +
61
+ "which this version of lancedb cannot refresh");
62
+ }
63
+ return { query: value.query };
64
+ }
65
+ // The structured layout written before the format number.
66
+ if (value.kind !== "select" && value.kind !== "namespaced_select") {
67
+ throw new Error(`materialized view '${name}' is stored in format kind '${value.kind}', ` +
68
+ "which this version of lancedb cannot refresh");
58
69
  }
59
70
  const limit = value.limit ?? undefined;
60
71
  // JSON.parse rounds integers past 2^53; every exact u64 parses to a safe
@@ -63,18 +74,36 @@ function definitionFromJson(raw, name) {
63
74
  if (limit !== undefined && !Number.isSafeInteger(limit)) {
64
75
  throw new Error(`materialized view '${name}' has a stored limit too large to represent exactly`);
65
76
  }
66
- return {
67
- sourceTable: value.source_table,
68
- // biome-ignore lint/suspicious/noExplicitAny: raw JSON
69
- projections: (value.projections ?? []).map((p) => [
70
- p.output,
71
- p.expression,
72
- ]),
73
- filter: value.filter ?? undefined,
74
- limit,
75
- inputs: value.inputs ?? [],
76
- sourceNamespace: value.source_namespace ?? [],
77
- };
77
+ return { query: legacyQuery(value, limit) };
78
+ }
79
+ function legacyIdent(name) {
80
+ return /^[a-z_][a-z0-9_]*$/.test(name)
81
+ ? name
82
+ : `\`${name.replace(/`/g, "``")}\``;
83
+ }
84
+ /** Render the pre-format structured layout as the query it described. */
85
+ // biome-ignore lint/suspicious/noExplicitAny: raw JSON
86
+ function legacyQuery(value, limit) {
87
+ // biome-ignore lint/suspicious/noExplicitAny: raw JSON
88
+ const projections = value.projections ?? [];
89
+ const columns = projections.length === 0
90
+ ? "*"
91
+ : projections
92
+ .map((p) => p.expression === p.output || p.expression === `\`${p.output}\``
93
+ ? p.expression
94
+ : `${p.expression} AS ${legacyIdent(p.output)}`)
95
+ .join(", ");
96
+ const table = [...(value.source_namespace ?? []), value.source_table]
97
+ .map(legacyIdent)
98
+ .join(".");
99
+ let query = `SELECT ${columns} FROM ${table}`;
100
+ if (value.filter !== undefined && value.filter !== null) {
101
+ query += ` WHERE ${value.filter}`;
102
+ }
103
+ if (limit !== undefined) {
104
+ query += ` LIMIT ${limit}`;
105
+ }
106
+ return query;
78
107
  }
79
108
  /**
80
109
  * A handle on a materialized view: its table plus its definition.
package/dist/native.d.ts CHANGED
@@ -56,6 +56,19 @@ export declare class Connection {
56
56
  listMaterializedViews(): Promise<Array<string>>
57
57
  /** Drop a materialized view. */
58
58
  dropMaterializedView(name: string, namespacePath?: Array<string> | undefined | null): Promise<void>
59
+ /** Create a view: a named query planned on every read. */
60
+ createView(name: string, query: string, namespacePath?: Array<string> | undefined | null): Promise<ViewDescription>
61
+ /** What the database records about one view. */
62
+ describeView(name: string, namespacePath?: Array<string> | undefined | null): Promise<ViewDescription>
63
+ /**
64
+ * Drop a view and wait for its definition to be deleted. The tables it
65
+ * reads are untouched.
66
+ */
67
+ dropView(name: string, namespacePath?: Array<string> | undefined | null): Promise<void>
68
+ /** Start dropping a view and return the job deleting its definition. */
69
+ dropViewAsync(name: string, namespacePath?: Array<string> | undefined | null): Promise<Job>
70
+ /** The names of the views in one namespace. */
71
+ listViews(namespacePath?: Array<string> | undefined | null): Promise<Array<string>>
59
72
  /** Start dropping a materialized view and return its cleanup job. */
60
73
  dropMaterializedViewAsync(name: string, namespacePath?: Array<string> | undefined | null): Promise<Job>
61
74
  openTable(name: string, namespacePath?: Array<string> | undefined | null, storageOptions?: Record<string, string> | undefined | null, indexCacheSize?: number | undefined | null): Promise<Table>
@@ -381,6 +394,7 @@ export declare class Table {
381
394
  addComputedColumns(columns: Array<AddColumnsSql>): Promise<AddColumnsResult>
382
395
  refreshColumn(column: string): Promise<RefreshColumnResult>
383
396
  refreshColumnAsync(column: string): Promise<Job>
397
+ functionErrors(options?: FunctionErrorsOptions | undefined | null): Promise<FunctionErrors>
384
398
  refreshMaterializedView(full?: boolean | undefined | null, sourceVersion?: number | undefined | null): Promise<RefreshMaterializedViewResult>
385
399
  materializedViewDefinition(): Promise<string>
386
400
  addColumnsWithSchema(schemaBuf: Buffer): Promise<AddColumnsResult>
@@ -546,6 +560,11 @@ export interface ClientConfig {
546
560
  retryConfig?: RetryConfig
547
561
  timeoutConfig?: TimeoutConfig
548
562
  extraHeaders?: Record<string, string>
563
+ /**
564
+ * The delimiter joining a namespace path and a name into one object
565
+ * identifier. `"$"` is the only supported value, and leaving this unset is
566
+ * how to get it; anything else is rejected when the connection is created.
567
+ */
549
568
  idDelimiter?: string
550
569
  tlsConfig?: TlsConfig
551
570
  /**
@@ -773,6 +792,55 @@ export interface FtsToken {
773
792
  position: number
774
793
  }
775
794
 
795
+ /**
796
+ * A fragment whose per-row error detail was capped: `rowsSkipped` rows
797
+ * failed, of which only `rowsRecorded` have a record of their own.
798
+ */
799
+ export interface FunctionErrorFragment {
800
+ jobId: string
801
+ fragmentId: number
802
+ rowsSkipped: number
803
+ rowsRecorded: number
804
+ }
805
+
806
+ /** One row a Function refresh skipped, as the server recorded it. */
807
+ export interface FunctionErrorRecord {
808
+ jobId: string
809
+ fragmentId: number
810
+ /**
811
+ * The row's offset within the fragment; absent when the fragment's
812
+ * detail was capped.
813
+ */
814
+ rowOffset?: number
815
+ column: string
816
+ function: string
817
+ functionVersion: string
818
+ tableVersion: number
819
+ errorType: string
820
+ errorMessage: string
821
+ createdAtMillis: number
822
+ }
823
+
824
+ /** A table's per-row Function errors. */
825
+ export interface FunctionErrors {
826
+ /** The recorded rows, newest job first. */
827
+ records: Array<FunctionErrorRecord>
828
+ /** Fragments whose detail was capped. */
829
+ fragments: Array<FunctionErrorFragment>
830
+ /** Whether the listing stopped at its limit. */
831
+ truncated: boolean
832
+ }
833
+
834
+ /** Which per-row Function errors to list; every filter is optional. */
835
+ export interface FunctionErrorsOptions {
836
+ /** Only errors recorded by this job. */
837
+ jobId?: string
838
+ /** Only errors on this column. */
839
+ column?: string
840
+ /** At most this many records (server default 10000, cap 100000). */
841
+ limit?: number
842
+ }
843
+
776
844
  /** One flushed L0 generation. */
777
845
  export interface GenerationStats {
778
846
  /** The generation number. Increases as memtables are sealed into L0. */
@@ -1339,6 +1407,20 @@ export interface Version {
1339
1407
  metadata: Record<string, string>
1340
1408
  }
1341
1409
 
1410
+ /** What a database records about one view. */
1411
+ export interface ViewDescription {
1412
+ name: string
1413
+ namespacePath: Array<string>
1414
+ query: string
1415
+ defaultDatabase: string
1416
+ defaultNamespacePath: Array<string>
1417
+ /**
1418
+ * The view's schema as an empty Arrow IPC file, the way a table reports
1419
+ * its own.
1420
+ */
1421
+ schema: Buffer
1422
+ }
1423
+
1342
1424
  /**
1343
1425
  * Progress snapshot for a write operation, delivered to the JS callback
1344
1426
  * passed to `Table.add`.
package/dist/native.js CHANGED
@@ -76,8 +76,8 @@ function requireNative() {
76
76
  try {
77
77
  const binding = require('@lancedb/lancedb-android-arm64');
78
78
  const bindingPackageVersion = require('@lancedb/lancedb-android-arm64/package.json').version;
79
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
80
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
79
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
80
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
81
81
  }
82
82
  return binding;
83
83
  }
@@ -95,8 +95,8 @@ function requireNative() {
95
95
  try {
96
96
  const binding = require('@lancedb/lancedb-android-arm-eabi');
97
97
  const bindingPackageVersion = require('@lancedb/lancedb-android-arm-eabi/package.json').version;
98
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
99
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
98
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
99
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
100
100
  }
101
101
  return binding;
102
102
  }
@@ -120,8 +120,8 @@ function requireNative() {
120
120
  try {
121
121
  const binding = require('@lancedb/lancedb-win32-x64-gnu');
122
122
  const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-gnu/package.json').version;
123
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
124
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
123
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
124
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
125
125
  }
126
126
  return binding;
127
127
  }
@@ -139,8 +139,8 @@ function requireNative() {
139
139
  try {
140
140
  const binding = require('@lancedb/lancedb-win32-x64-msvc');
141
141
  const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-msvc/package.json').version;
142
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
143
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
142
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
143
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
144
144
  }
145
145
  return binding;
146
146
  }
@@ -159,8 +159,8 @@ function requireNative() {
159
159
  try {
160
160
  const binding = require('@lancedb/lancedb-win32-ia32-msvc');
161
161
  const bindingPackageVersion = require('@lancedb/lancedb-win32-ia32-msvc/package.json').version;
162
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
163
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
162
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
163
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
164
164
  }
165
165
  return binding;
166
166
  }
@@ -178,8 +178,8 @@ function requireNative() {
178
178
  try {
179
179
  const binding = require('@lancedb/lancedb-win32-arm64-msvc');
180
180
  const bindingPackageVersion = require('@lancedb/lancedb-win32-arm64-msvc/package.json').version;
181
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
182
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
181
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
182
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
183
183
  }
184
184
  return binding;
185
185
  }
@@ -201,8 +201,8 @@ function requireNative() {
201
201
  try {
202
202
  const binding = require('@lancedb/lancedb-darwin-universal');
203
203
  const bindingPackageVersion = require('@lancedb/lancedb-darwin-universal/package.json').version;
204
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
205
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
204
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
205
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
206
206
  }
207
207
  return binding;
208
208
  }
@@ -219,8 +219,8 @@ function requireNative() {
219
219
  try {
220
220
  const binding = require('@lancedb/lancedb-darwin-x64');
221
221
  const bindingPackageVersion = require('@lancedb/lancedb-darwin-x64/package.json').version;
222
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
222
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
224
224
  }
225
225
  return binding;
226
226
  }
@@ -238,8 +238,8 @@ function requireNative() {
238
238
  try {
239
239
  const binding = require('@lancedb/lancedb-darwin-arm64');
240
240
  const bindingPackageVersion = require('@lancedb/lancedb-darwin-arm64/package.json').version;
241
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
241
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
243
243
  }
244
244
  return binding;
245
245
  }
@@ -262,8 +262,8 @@ function requireNative() {
262
262
  try {
263
263
  const binding = require('@lancedb/lancedb-freebsd-x64');
264
264
  const bindingPackageVersion = require('@lancedb/lancedb-freebsd-x64/package.json').version;
265
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
266
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
265
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
266
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
267
267
  }
268
268
  return binding;
269
269
  }
@@ -281,8 +281,8 @@ function requireNative() {
281
281
  try {
282
282
  const binding = require('@lancedb/lancedb-freebsd-arm64');
283
283
  const bindingPackageVersion = require('@lancedb/lancedb-freebsd-arm64/package.json').version;
284
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
285
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
284
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
285
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
286
286
  }
287
287
  return binding;
288
288
  }
@@ -306,8 +306,8 @@ function requireNative() {
306
306
  try {
307
307
  const binding = require('@lancedb/lancedb-linux-x64-musl');
308
308
  const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-musl/package.json').version;
309
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
309
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
311
311
  }
312
312
  return binding;
313
313
  }
@@ -325,8 +325,8 @@ function requireNative() {
325
325
  try {
326
326
  const binding = require('@lancedb/lancedb-linux-x64-gnu');
327
327
  const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-gnu/package.json').version;
328
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
328
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
330
330
  }
331
331
  return binding;
332
332
  }
@@ -346,8 +346,8 @@ function requireNative() {
346
346
  try {
347
347
  const binding = require('@lancedb/lancedb-linux-arm64-musl');
348
348
  const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-musl/package.json').version;
349
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
350
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
349
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
350
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
351
351
  }
352
352
  return binding;
353
353
  }
@@ -365,8 +365,8 @@ function requireNative() {
365
365
  try {
366
366
  const binding = require('@lancedb/lancedb-linux-arm64-gnu');
367
367
  const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-gnu/package.json').version;
368
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
369
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
368
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
369
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
370
370
  }
371
371
  return binding;
372
372
  }
@@ -386,8 +386,8 @@ function requireNative() {
386
386
  try {
387
387
  const binding = require('@lancedb/lancedb-linux-arm-musleabihf');
388
388
  const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-musleabihf/package.json').version;
389
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
390
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
389
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
390
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
391
391
  }
392
392
  return binding;
393
393
  }
@@ -405,8 +405,8 @@ function requireNative() {
405
405
  try {
406
406
  const binding = require('@lancedb/lancedb-linux-arm-gnueabihf');
407
407
  const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-gnueabihf/package.json').version;
408
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
409
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
408
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
409
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
410
410
  }
411
411
  return binding;
412
412
  }
@@ -426,8 +426,8 @@ function requireNative() {
426
426
  try {
427
427
  const binding = require('@lancedb/lancedb-linux-loong64-musl');
428
428
  const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-musl/package.json').version;
429
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
430
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
429
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
430
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
431
431
  }
432
432
  return binding;
433
433
  }
@@ -445,8 +445,8 @@ function requireNative() {
445
445
  try {
446
446
  const binding = require('@lancedb/lancedb-linux-loong64-gnu');
447
447
  const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-gnu/package.json').version;
448
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
449
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
448
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
449
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
450
450
  }
451
451
  return binding;
452
452
  }
@@ -466,8 +466,8 @@ function requireNative() {
466
466
  try {
467
467
  const binding = require('@lancedb/lancedb-linux-riscv64-musl');
468
468
  const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-musl/package.json').version;
469
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
470
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
469
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
470
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
471
471
  }
472
472
  return binding;
473
473
  }
@@ -485,8 +485,8 @@ function requireNative() {
485
485
  try {
486
486
  const binding = require('@lancedb/lancedb-linux-riscv64-gnu');
487
487
  const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-gnu/package.json').version;
488
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
489
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
488
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
489
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
490
490
  }
491
491
  return binding;
492
492
  }
@@ -505,8 +505,8 @@ function requireNative() {
505
505
  try {
506
506
  const binding = require('@lancedb/lancedb-linux-ppc64-gnu');
507
507
  const bindingPackageVersion = require('@lancedb/lancedb-linux-ppc64-gnu/package.json').version;
508
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
509
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
508
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
509
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
510
510
  }
511
511
  return binding;
512
512
  }
@@ -524,8 +524,8 @@ function requireNative() {
524
524
  try {
525
525
  const binding = require('@lancedb/lancedb-linux-s390x-gnu');
526
526
  const bindingPackageVersion = require('@lancedb/lancedb-linux-s390x-gnu/package.json').version;
527
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
528
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
527
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
528
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
529
529
  }
530
530
  return binding;
531
531
  }
@@ -548,8 +548,8 @@ function requireNative() {
548
548
  try {
549
549
  const binding = require('@lancedb/lancedb-openharmony-arm64');
550
550
  const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm64/package.json').version;
551
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
552
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
551
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
552
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
553
553
  }
554
554
  return binding;
555
555
  }
@@ -567,8 +567,8 @@ function requireNative() {
567
567
  try {
568
568
  const binding = require('@lancedb/lancedb-openharmony-x64');
569
569
  const bindingPackageVersion = require('@lancedb/lancedb-openharmony-x64/package.json').version;
570
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
571
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
570
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
571
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
572
572
  }
573
573
  return binding;
574
574
  }
@@ -586,8 +586,8 @@ function requireNative() {
586
586
  try {
587
587
  const binding = require('@lancedb/lancedb-openharmony-arm');
588
588
  const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm/package.json').version;
589
- if (bindingPackageVersion !== '0.40.0-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
590
- throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
589
+ if (bindingPackageVersion !== '0.40.0-beta.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
590
+ throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
591
591
  }
592
592
  return binding;
593
593
  }
package/dist/schema.js CHANGED
@@ -35,6 +35,7 @@ class SchemaInferrer {
35
35
  : new apache_arrow_1.Schema(matchingFields(this.providedSchema.fields, this.fields));
36
36
  }
37
37
  observe(path, value, row) {
38
+ assertSupportedValue(value, path.join("."), row);
38
39
  const current = this.fields.get(path);
39
40
  if (current === undefined) {
40
41
  this.addField(path, value, row);
@@ -293,15 +294,43 @@ function* recordPathsAndValues(record, path = []) {
293
294
  }
294
295
  }
295
296
  function isRecord(value) {
296
- return (typeof value === "object" &&
297
- value !== null &&
298
- !Array.isArray(value) &&
299
- !(value instanceof RegExp) &&
300
- !(value instanceof Date) &&
301
- !(value instanceof Set) &&
302
- !(value instanceof Map) &&
303
- !(value instanceof Buffer) &&
304
- !ArrayBuffer.isView(value));
297
+ if (typeof value !== "object" || value === null) {
298
+ return false;
299
+ }
300
+ const prototype = Object.getPrototypeOf(value);
301
+ return ((prototype === Object.prototype || prototype === null) &&
302
+ Object.keys(value).length > 0);
303
+ }
304
+ function isUnsupportedObject(value) {
305
+ if (typeof value !== "object" ||
306
+ value === null ||
307
+ Array.isArray(value) ||
308
+ isRecord(value)) {
309
+ return false;
310
+ }
311
+ // Preserve the object types already passed through to Arrow. Other objects
312
+ // must not disappear while walking struct fields.
313
+ return !(value instanceof RegExp ||
314
+ value instanceof Date ||
315
+ value instanceof Set ||
316
+ value instanceof Map ||
317
+ Buffer.isBuffer(value) ||
318
+ ArrayBuffer.isView(value));
319
+ }
320
+ function assertSupportedValue(value, field, row) {
321
+ if (Array.isArray(value)) {
322
+ for (const [index, item] of value.entries()) {
323
+ assertSupportedValue(item, `${field}[${index}]`, row);
324
+ }
325
+ }
326
+ else if (isRecord(value)) {
327
+ for (const [name, child] of Object.entries(value)) {
328
+ assertSupportedValue(child, `${field}.${name}`, row);
329
+ }
330
+ }
331
+ else if (isUnsupportedObject(value)) {
332
+ throw new Error(`Unsupported object value for field ${field} at row ${row}.`);
333
+ }
305
334
  }
306
335
  function fieldAtPath(schema, path) {
307
336
  let fields = schema.fields;
package/dist/table.d.ts CHANGED
@@ -3,7 +3,7 @@ import { BlobFile } from "./blob";
3
3
  import { IndexOptions } from "./indices";
4
4
  import { Job } from "./job";
5
5
  import { MergeInsertBuilder } from "./merge";
6
- import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, IndexConfig, IndexStatistics, LsmStats, Branches as NativeBranches, OptimizeStats, RefreshColumnResult, RefreshMaterializedViewResult, TableStatistics, Tags, UpdateFieldMetadataResult, UpdateResult, Table as _NativeTable } from "./native";
6
+ import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, FunctionErrors, FunctionErrorsOptions, IndexConfig, IndexStatistics, LsmStats, Branches as NativeBranches, OptimizeStats, RefreshColumnResult, RefreshMaterializedViewResult, TableStatistics, Tags, UpdateFieldMetadataResult, UpdateResult, Table as _NativeTable } from "./native";
7
7
  import { AutoQuery, FullTextQuery, Query, TakeQuery, VectorQuery } from "./query";
8
8
  import { IntoSql } from "./util";
9
9
  export { IndexConfig } from "./native";
@@ -517,6 +517,24 @@ export declare abstract class Table {
517
517
  * ```
518
518
  */
519
519
  abstract refreshColumnAsync(column: string): Promise<Job>;
520
+ /**
521
+ * The per-row errors Function refreshes recorded on this table.
522
+ *
523
+ * A refresh running under a skip policy records each row it skipped with
524
+ * the input that failed and the error. This lists those records, newest
525
+ * job first, plus a summary for any fragment whose per-row detail was
526
+ * capped. LanceDB Cloud and Enterprise only; reading errors needs read
527
+ * access to the table, since a message carries the value that failed.
528
+ * @param {FunctionErrorsOptions} options Optional filters: `jobId`,
529
+ * `column`, and `limit` (server default 10000, cap 100000).
530
+ * @returns {Promise<FunctionErrors>} The records, the capped fragments,
531
+ * and whether the listing stopped at its limit.
532
+ * @example
533
+ * ```ts
534
+ * const { records, truncated } = await table.functionErrors({ column: "embedding" });
535
+ * ```
536
+ */
537
+ abstract functionErrors(options?: FunctionErrorsOptions): Promise<FunctionErrors>;
520
538
  /**
521
539
  * Recompute this table's contents from its materialized-view definition.
522
540
  *
@@ -896,6 +914,7 @@ export declare class LocalTable extends Table {
896
914
  }): Promise<AddColumnsResult>;
897
915
  refreshColumn(column: string): Promise<RefreshColumnResult>;
898
916
  refreshColumnAsync(column: string): Promise<Job>;
917
+ functionErrors(options?: FunctionErrorsOptions): Promise<FunctionErrors>;
899
918
  refreshMaterializedView(full?: boolean, sourceVersion?: number): Promise<RefreshMaterializedViewResult>;
900
919
  materializedViewDefinition(): Promise<string>;
901
920
  alterColumns(columnAlterations: ColumnAlteration[]): Promise<AlterColumnsResult>;
package/dist/table.js CHANGED
@@ -7,6 +7,7 @@ const arrow_1 = require("./arrow");
7
7
  const blob_1 = require("./blob");
8
8
  const registry_1 = require("./embedding/registry");
9
9
  const job_1 = require("./job");
10
+ const materialized_view_1 = require("./materialized_view");
10
11
  const merge_1 = require("./merge");
11
12
  const query_1 = require("./query");
12
13
  const sanitize_1 = require("./sanitize");
@@ -275,6 +276,10 @@ class LocalTable extends Table {
275
276
  async refreshColumnAsync(column) {
276
277
  return new job_1.Job(await this.inner.refreshColumnAsync(column));
277
278
  }
279
+ async functionErrors(options) {
280
+ (0, materialized_view_1.validateNonNegativeInteger)(options?.limit, "limit");
281
+ return await this.inner.functionErrors(options);
282
+ }
278
283
  async refreshMaterializedView(full, sourceVersion) {
279
284
  return await this.inner.refreshMaterializedView(full, sourceVersion);
280
285
  }
package/dist/view.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ import { Schema } from "apache-arrow";
2
+ import { ViewDescription as NativeViewDescription } from "./native";
3
+ /**
4
+ * What a database records about one view.
5
+ *
6
+ * A view holds no rows: it stores the statement that defines it and the
7
+ * schema that statement resolved to, so a reader sees its sources as they
8
+ * are at read time.
9
+ */
10
+ export interface ViewDescription {
11
+ /** The view's name within its namespace. */
12
+ name: string;
13
+ /** The namespace holding the view; empty is the root namespace. */
14
+ namespacePath: string[];
15
+ /** The defining query, as the database stores it. */
16
+ query: string;
17
+ /** The database that unqualified table names in {@link query} resolve against. */
18
+ defaultDatabase: string;
19
+ /**
20
+ * The namespace path those unqualified names resolve against; empty is the
21
+ * root namespace.
22
+ *
23
+ * Recorded with the view because it outlives the session that declared it:
24
+ * a reader resolving the query against its own default namespace could read
25
+ * a different table than the view was defined over.
26
+ */
27
+ defaultNamespacePath: string[];
28
+ /** The schema the defining query resolved to when the view was created. */
29
+ schema: Schema;
30
+ }
31
+ /** Decode the schema the binding hands over as an Arrow IPC file. */
32
+ export declare function viewDescriptionFromNative(view: NativeViewDescription): ViewDescription;
package/dist/view.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // SPDX-FileCopyrightText: Copyright The LanceDB Authors
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.viewDescriptionFromNative = viewDescriptionFromNative;
6
+ const apache_arrow_1 = require("apache-arrow");
7
+ /** Decode the schema the binding hands over as an Arrow IPC file. */
8
+ function viewDescriptionFromNative(view) {
9
+ return {
10
+ name: view.name,
11
+ namespacePath: view.namespacePath,
12
+ query: view.query,
13
+ defaultDatabase: view.defaultDatabase,
14
+ defaultNamespacePath: view.defaultNamespacePath,
15
+ schema: (0, apache_arrow_1.tableFromIPC)(view.schema).schema,
16
+ };
17
+ }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "ann"
12
12
  ],
13
13
  "private": false,
14
- "version": "0.40.0-beta.1",
14
+ "version": "0.40.0-beta.11",
15
15
  "main": "dist/index.js",
16
16
  "exports": {
17
17
  ".": "./dist/index.js",
@@ -106,13 +106,13 @@
106
106
  "optionalDependencies": {
107
107
  "@huggingface/transformers": "3.0.2",
108
108
  "openai": "4.29.2",
109
- "@lancedb/lancedb-darwin-arm64": "0.40.0-beta.1",
110
- "@lancedb/lancedb-linux-x64-gnu": "0.40.0-beta.1",
111
- "@lancedb/lancedb-linux-arm64-gnu": "0.40.0-beta.1",
112
- "@lancedb/lancedb-linux-x64-musl": "0.40.0-beta.1",
113
- "@lancedb/lancedb-linux-arm64-musl": "0.40.0-beta.1",
114
- "@lancedb/lancedb-win32-x64-msvc": "0.40.0-beta.1",
115
- "@lancedb/lancedb-win32-arm64-msvc": "0.40.0-beta.1"
109
+ "@lancedb/lancedb-darwin-arm64": "0.40.0-beta.11",
110
+ "@lancedb/lancedb-linux-x64-gnu": "0.40.0-beta.11",
111
+ "@lancedb/lancedb-linux-arm64-gnu": "0.40.0-beta.11",
112
+ "@lancedb/lancedb-linux-x64-musl": "0.40.0-beta.11",
113
+ "@lancedb/lancedb-linux-arm64-musl": "0.40.0-beta.11",
114
+ "@lancedb/lancedb-win32-x64-msvc": "0.40.0-beta.11",
115
+ "@lancedb/lancedb-win32-arm64-msvc": "0.40.0-beta.11"
116
116
  },
117
117
  "peerDependencies": {
118
118
  "@types/node": ">=22",