Elffuss BraidHub

kikocis/lancedb public

b63b31c3dce9 · 2.1 KiBRawPermalink
1// Copyright 2024 Lance Developers.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use std::collections::HashMap;
16
17use napi_derive::*;
18
19mod connection;
20mod error;
21mod index;
22mod iterator;
23pub mod merge;
24mod query;
25mod table;
26mod util;
27
28#[napi(object)]
29#[derive(Debug)]
30pub struct ConnectionOptions {
31 /// (For LanceDB OSS only): The interval, in seconds, at which to check for
32 /// updates to the table from other processes. If None, then consistency is not
33 /// checked. For performance reasons, this is the default. For strong
34 /// consistency, set this to zero seconds. Then every read will check for
35 /// updates from other processes. As a compromise, you can set this to a
36 /// non-zero value for eventual consistency. If more than that interval
37 /// has passed since the last check, then the table will be checked for updates.
38 /// Note: this consistency only applies to read operations. Write operations are
39 /// always consistent.
40 pub read_consistency_interval: Option<f64>,
41 /// (For LanceDB OSS only): configuration for object storage.
42 ///
43 /// The available options are described at https://lancedb.github.io/lancedb/guides/storage/
44 pub storage_options: Option<HashMap<String, String>>,
45}
46
47/// Write mode for writing a table.
48#[napi(string_enum)]
49pub enum WriteMode {
50 Create,
51 Append,
52 Overwrite,
53}
54
55/// Write options when creating a Table.
56#[napi(object)]
57pub struct WriteOptions {
58 /// Write mode for writing to a table.
59 pub mode: Option<WriteMode>,
60}
61
62#[napi(object)]
63pub struct OpenTableOptions {
64 pub storage_options: Option<HashMap<String, String>>,
65}