@lancedb/lancedb 0.41.0 → 0.42.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.d.ts CHANGED
@@ -135,17 +135,39 @@ export declare class DatabaseNames {
135
135
  next(): Promise<string | null>
136
136
  }
137
137
 
138
+ export declare class Expr {
139
+ eq(other: Expr): Expr
140
+ ne(other: Expr): Expr
141
+ lt(other: Expr): Expr
142
+ lte(other: Expr): Expr
143
+ gt(other: Expr): Expr
144
+ gte(other: Expr): Expr
145
+ and(other: Expr): Expr
146
+ or(other: Expr): Expr
147
+ not(): Expr
148
+ add(other: Expr): Expr
149
+ sub(other: Expr): Expr
150
+ mul(other: Expr): Expr
151
+ div(other: Expr): Expr
152
+ lower(): Expr
153
+ upper(): Expr
154
+ contains(substr: Expr): Expr
155
+ isIn(list: Array<Expr>): Expr
156
+ cast(dataType: string): Expr
157
+ toSql(): string
158
+ }
159
+
138
160
  export declare class Index {
139
- static ivfPq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numSubVectors?: number | undefined | null, numBits?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null): Index
140
- static ivfRq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numBits?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null): Index
141
- static ivfFlat(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null): Index
161
+ static ivfPq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numSubVectors?: number | undefined | null, numBits?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, targetPartitionSize?: number | undefined | null): Index
162
+ static ivfRq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numBits?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, targetPartitionSize?: number | undefined | null): Index
163
+ static ivfFlat(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, targetPartitionSize?: number | undefined | null): Index
142
164
  static btree(): Index
143
165
  static bitmap(): Index
144
166
  static labelList(): Index
145
167
  static fm(): Index
146
168
  static fts(withPosition?: boolean | undefined | null, baseTokenizer?: string | undefined | null, language?: string | undefined | null, maxTokenLength?: number | undefined | null, lowerCase?: boolean | undefined | null, stem?: boolean | undefined | null, removeStopWords?: boolean | undefined | null, customStopWords?: Array<string> | undefined | null, asciiFolding?: boolean | undefined | null, ngramMinLength?: number | undefined | null, ngramMaxLength?: number | undefined | null, prefixOnly?: boolean | undefined | null, blockSize?: number | undefined | null): Index
147
- static hnswPq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numSubVectors?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, m?: number | undefined | null, efConstruction?: number | undefined | null): Index
148
- static hnswSq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, m?: number | undefined | null, efConstruction?: number | undefined | null): Index
169
+ static hnswPq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numSubVectors?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, m?: number | undefined | null, efConstruction?: number | undefined | null, targetPartitionSize?: number | undefined | null): Index
170
+ static hnswSq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, m?: number | undefined | null, efConstruction?: number | undefined | null, targetPartitionSize?: number | undefined | null): Index
149
171
  }
150
172
 
151
173
  /** A handle to an operation that may still be running. */
@@ -582,7 +604,7 @@ export interface ClientConfig {
582
604
  /**
583
605
  * User identifier for tracking purposes.
584
606
  *
585
- * This is sent as the `x-lancedb-user-id` header in requests to LanceDB Cloud/Enterprise.
607
+ * This is sent as the `x-lancedb-user-id` header in requests to LanceDB Enterprise.
586
608
  * It can be set directly, or via the `LANCEDB_USER_ID` environment variable.
587
609
  * Alternatively, set `LANCEDB_USER_ID_ENV_KEY` to specify another environment
588
610
  * variable that contains the user ID value.
@@ -590,6 +612,14 @@ export interface ClientConfig {
590
612
  userId?: string
591
613
  }
592
614
 
615
+ /**
616
+ * Create a column reference expression.
617
+ *
618
+ * The column name is preserved exactly as given (case-sensitive), so
619
+ * `col("firstName")` correctly references a field named `firstName`.
620
+ */
621
+ export declare function col(name: string): Expr
622
+
593
623
  /**
594
624
  * A definition of a column alteration. The alteration changes the column at
595
625
  * `path` to have the new name `name`, to be nullable if `nullable` is true,
@@ -661,47 +691,47 @@ export interface ConnectionOptions {
661
691
  */
662
692
  readConsistencyInterval?: number
663
693
  /**
664
- * (For LanceDB OSS only): configuration for object storage.
694
+ * (For LanceDB Embedded only): configuration for object storage.
665
695
  *
666
696
  * The available options are described at https://docs.lancedb.com/storage/
667
697
  */
668
698
  storageOptions?: Record<string, string>
669
699
  /**
670
- * (For LanceDB OSS only): use directory namespace manifests as the source
700
+ * (For LanceDB Embedded only): use directory namespace manifests as the source
671
701
  * of truth for table metadata. Existing directory-listed root tables are
672
702
  * migrated into the manifest on access.
673
703
  */
674
704
  manifestEnabled?: boolean
675
705
  /**
676
- * (For LanceDB OSS only): extra properties for the backing namespace
706
+ * (For LanceDB Embedded only): extra properties for the backing namespace
677
707
  * client used by manifest-enabled native connections.
678
708
  */
679
709
  namespaceClientProperties?: Record<string, string>
680
710
  /**
681
- * (For LanceDB OSS only): the session to use for this connection. Holds
711
+ * (For LanceDB Embedded only): the session to use for this connection. Holds
682
712
  * shared caches and other session-specific state.
683
713
  */
684
714
  session?: Session
685
- /** (For LanceDB cloud only): configuration for the remote HTTP client. */
715
+ /** (For LanceDB Enterprise or LanceDB Cloud only): configuration for the HTTP client. */
686
716
  clientConfig?: ClientConfig
687
717
  /**
688
- * (For LanceDB cloud only): the API key to use with LanceDB Cloud.
718
+ * (For LanceDB Enterprise or LanceDB Cloud only): the API key to use.
689
719
  *
690
720
  * Can also be set via the environment variable `LANCEDB_API_KEY`.
691
721
  */
692
722
  apiKey?: string
693
723
  /**
694
- * (For LanceDB cloud only): the region to use for LanceDB cloud.
724
+ * (For LanceDB Cloud only): the region to use for LanceDB Cloud (legacy).
695
725
  * Defaults to 'us-east-1'.
696
726
  */
697
727
  region?: string
698
728
  /**
699
- * (For LanceDB cloud only): the host to use for LanceDB cloud. Used
700
- * for testing purposes.
729
+ * (For LanceDB Enterprise only): the host of the LanceDB Enterprise
730
+ * deployment to connect to.
701
731
  */
702
732
  hostOverride?: string
703
733
  /**
704
- * (For LanceDB cloud only): OAuth configuration for IdP-based
734
+ * (For LanceDB Enterprise only): OAuth configuration for IdP-based
705
735
  * authentication (e.g., Azure Entra ID). When set, token acquisition
706
736
  * and refresh are handled entirely in Rust. TypeScript users should pass
707
737
  * the public `OAuthConfig` type exported from `@lancedb/lancedb`.
@@ -807,6 +837,9 @@ export interface FtsToken {
807
837
  position: number
808
838
  }
809
839
 
840
+ /** Call an arbitrary registered SQL function by name. */
841
+ export declare function func(name: string, args: Array<Expr>): Expr
842
+
810
843
  /**
811
844
  * A fragment whose per-row error detail was capped: `rowsSkipped` rows
812
845
  * failed, of which only `rowsRecorded` have a record of their own.
@@ -872,56 +905,56 @@ export interface IndexConfig {
872
905
  /**
873
906
  * The UUID of the first segment of the index.
874
907
  *
875
- * `undefined` for remote tables, which do not yet surface this.
908
+ * `undefined` in LanceDB Distributed, which does not yet surface this.
876
909
  */
877
910
  indexUuid?: string
878
911
  /**
879
912
  * The protobuf type URL, a precise type identifier for the index.
880
913
  *
881
- * `undefined` for remote tables.
914
+ * `undefined` in LanceDB Distributed.
882
915
  */
883
916
  typeUrl?: string
884
917
  /**
885
918
  * When the index was created.
886
919
  *
887
- * `undefined` for remote tables or indices created before timestamps were tracked.
920
+ * `undefined` in LanceDB Distributed or indices created before timestamps were tracked.
888
921
  */
889
922
  createdAt?: Date
890
923
  /**
891
924
  * The number of rows indexed, across all segments.
892
925
  *
893
- * `undefined` for remote tables.
926
+ * May be `undefined` in LanceDB Distributed if the server does not report it.
894
927
  */
895
928
  numIndexedRows?: number
896
929
  /**
897
930
  * The number of rows not yet covered by this index.
898
931
  *
899
- * `undefined` for remote tables.
932
+ * May be `undefined` in LanceDB Distributed if the server does not report it.
900
933
  */
901
934
  numUnindexedRows?: number
902
935
  /**
903
936
  * The total size in bytes of all index files across all segments.
904
937
  *
905
- * `undefined` for remote tables or indices without size tracking.
938
+ * `undefined` in LanceDB Distributed or indices without size tracking.
906
939
  */
907
940
  sizeBytes?: number
908
941
  /**
909
942
  * The number of segments that make up the index.
910
943
  *
911
- * `undefined` for remote tables.
944
+ * `undefined` in LanceDB Distributed.
912
945
  */
913
946
  numSegments?: number
914
947
  /**
915
948
  * The on-disk index format version.
916
949
  *
917
- * `undefined` for remote tables.
950
+ * `undefined` in LanceDB Distributed.
918
951
  */
919
952
  indexVersion?: number
920
953
  /**
921
954
  * Index-type-specific details parsed as a JavaScript object.
922
955
  *
923
- * Falls back to a raw string if JSON parsing fails. `undefined` for
924
- * remote tables or when details are unavailable.
956
+ * Falls back to a raw string if JSON parsing fails. `undefined` in
957
+ * LanceDB Distributed or when details are unavailable.
925
958
  */
926
959
  indexDetails?: any
927
960
  }
@@ -969,6 +1002,15 @@ export interface JobInfo {
969
1002
  /** The catalog of described LanceDB metrics. Empty until the recorder is installed. */
970
1003
  export declare function lancedbMetricsCatalog(): Array<MetricDescription>
971
1004
 
1005
+ /** Create a literal (constant) value expression. */
1006
+ export declare function lit(value: string | number): Expr
1007
+
1008
+ /** Create a literal boolean value expression. */
1009
+ export declare function litBool(value: boolean): Expr
1010
+
1011
+ /** Create a literal integer value expression. */
1012
+ export declare function litInt(value: number): Expr
1013
+
972
1014
  /** One in-memory memtable. */
973
1015
  export interface MemtableStats {
974
1016
  /** The generation this memtable will become once frozen. */
@@ -1107,11 +1149,11 @@ export interface RefreshColumnResult {
1107
1149
  }
1108
1150
 
1109
1151
  export interface RefreshMaterializedViewResult {
1110
- /** How the view was brought up to date: "rebuild", or absent for remote SQL refreshes. */
1152
+ /** How the view was brought up to date: "rebuild", or absent for LanceDB Distributed SQL refreshes. */
1111
1153
  mode?: string
1112
- /** Rows written by this refresh, or absent for remote SQL refreshes. */
1154
+ /** Rows written by this refresh, or absent for LanceDB Distributed SQL refreshes. */
1113
1155
  rowsWritten?: number
1114
- /** Source version refreshed to, or absent for remote SQL refreshes. */
1156
+ /** Source version refreshed to, or absent for LanceDB Distributed SQL refreshes. */
1115
1157
  sourceVersion?: number
1116
1158
  version: number
1117
1159
  }
@@ -1180,7 +1222,7 @@ export interface RetryConfig {
1180
1222
  backoffJitter?: number
1181
1223
  /**
1182
1224
  * The HTTP status codes for which to retry the request. Default is
1183
- * [429, 500, 502, 503].
1225
+ * [409, 429, 500, 502, 503, 504].
1184
1226
  *
1185
1227
  * You can also set this via the environment variable
1186
1228
  * `LANCE_CLIENT_RETRY_STATUSES`. Use a comma-separated list of integers.
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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
79
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
98
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
123
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
142
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
162
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
181
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
204
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
222
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
241
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
265
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
284
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
309
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
328
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
349
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
368
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
389
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
408
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
429
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
448
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
469
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
488
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
508
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
527
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
551
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
570
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 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.41.0' && 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.41.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
589
+ if (bindingPackageVersion !== '0.42.0-beta.0' && 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.42.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
591
591
  }
592
592
  return binding;
593
593
  }
@@ -667,6 +667,7 @@ module.exports.Branches = nativeBinding.Branches;
667
667
  module.exports.Catalog = nativeBinding.Catalog;
668
668
  module.exports.Connection = nativeBinding.Connection;
669
669
  module.exports.DatabaseNames = nativeBinding.DatabaseNames;
670
+ module.exports.Expr = nativeBinding.Expr;
670
671
  module.exports.Index = nativeBinding.Index;
671
672
  module.exports.Job = nativeBinding.Job;
672
673
  module.exports.JobListing = nativeBinding.JobListing;
@@ -687,8 +688,13 @@ module.exports.TagContents = nativeBinding.TagContents;
687
688
  module.exports.Tags = nativeBinding.Tags;
688
689
  module.exports.TakeQuery = nativeBinding.TakeQuery;
689
690
  module.exports.VectorQuery = nativeBinding.VectorQuery;
691
+ module.exports.col = nativeBinding.col;
690
692
  module.exports.experimentalFunctionsEnabled = nativeBinding.experimentalFunctionsEnabled;
693
+ module.exports.func = nativeBinding.func;
691
694
  module.exports.lancedbMetricsCatalog = nativeBinding.lancedbMetricsCatalog;
695
+ module.exports.lit = nativeBinding.lit;
696
+ module.exports.litBool = nativeBinding.litBool;
697
+ module.exports.litInt = nativeBinding.litInt;
692
698
  module.exports.permutationBuilder = nativeBinding.permutationBuilder;
693
699
  module.exports.registerLancedbMetricsRecorder = nativeBinding.registerLancedbMetricsRecorder;
694
700
  module.exports.snapshotLancedbMetrics = nativeBinding.snapshotLancedbMetrics;
package/dist/query.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Table as ArrowTable, type IntoVector, RecordBatch } from "./arrow";
2
+ import { Expr } from "./expr";
2
3
  import { type IvfPqOptions } from "./indices";
3
4
  import { JsFullTextQuery, RecordBatchIterator as NativeBatchIterator, Query as NativeQuery, Table as NativeTable, TakeQuery as NativeTakeQuery, VectorQuery as NativeVectorQuery } from "./native";
4
5
  import { Reranker } from "./rerankers";
@@ -237,11 +238,16 @@ export declare class StandardQueryBase<NativeQueryType extends NativeQuery | Nat
237
238
  /**
238
239
  * A filter statement to be applied to this query.
239
240
  *
240
- * The filter should be supplied as an SQL query string. For example:
241
+ * The filter may be an SQL query string or an expression built with `col`,
242
+ * which preserves case-sensitive column names. For example:
241
243
  * @example
242
244
  * x > 10
243
245
  * y > 0 AND y < 100
244
246
  * x > 5 OR y = 'test'
247
+ * @example
248
+ * ```ts
249
+ * table.query().where(col("firstName").eq("Alice"));
250
+ * ```
245
251
  *
246
252
  * Filtering performance can often be improved by creating a scalar index
247
253
  * on the filter column(s).
@@ -249,7 +255,7 @@ export declare class StandardQueryBase<NativeQueryType extends NativeQuery | Nat
249
255
  * Calling this multiple times combines the filters with a logical AND rather
250
256
  * than replacing the previous filter.
251
257
  */
252
- where(predicate: string): this;
258
+ where(predicate: string | Expr): this;
253
259
  /**
254
260
  * A filter statement to be applied to this query.
255
261
  * @see where
package/dist/query.js CHANGED
@@ -7,6 +7,7 @@ exports.RecordBatchIterator = RecordBatchIterator;
7
7
  exports.createAutoQuery = createAutoQuery;
8
8
  exports.instanceOfFullTextQuery = instanceOfFullTextQuery;
9
9
  const arrow_1 = require("./arrow");
10
+ const expr_1 = require("./expr");
10
11
  const native_1 = require("./native");
11
12
  async function* RecordBatchIterator(promisedInner) {
12
13
  const inner = await promisedInner;
@@ -415,11 +416,16 @@ class StandardQueryBase extends QueryBase {
415
416
  /**
416
417
  * A filter statement to be applied to this query.
417
418
  *
418
- * The filter should be supplied as an SQL query string. For example:
419
+ * The filter may be an SQL query string or an expression built with `col`,
420
+ * which preserves case-sensitive column names. For example:
419
421
  * @example
420
422
  * x > 10
421
423
  * y > 0 AND y < 100
422
424
  * x > 5 OR y = 'test'
425
+ * @example
426
+ * ```ts
427
+ * table.query().where(col("firstName").eq("Alice"));
428
+ * ```
423
429
  *
424
430
  * Filtering performance can often be improved by creating a scalar index
425
431
  * on the filter column(s).
@@ -428,7 +434,14 @@ class StandardQueryBase extends QueryBase {
428
434
  * than replacing the previous filter.
429
435
  */
430
436
  where(predicate) {
431
- this.doCall((inner) => inner.onlyIf(predicate));
437
+ this.doCall((inner) => {
438
+ if (predicate instanceof expr_1.Expr) {
439
+ inner.onlyIf(predicate.toSql());
440
+ }
441
+ else {
442
+ inner.onlyIf(predicate);
443
+ }
444
+ });
432
445
  return this;
433
446
  }
434
447
  /**