diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 428bef69..e628c79d 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -9,4 +9,4 @@ tag_name = v{new_version} [bumpversion:file:rust/ffi/node/Cargo.toml] -[bumpversion:file:rust/vectordb/Cargo.toml] +[bumpversion:file:rust/lancedb/Cargo.toml] diff --git a/.github/workflows/cargo-publish.yml b/.github/workflows/cargo-publish.yml index 6bbcdd57..9e4dfd35 100644 --- a/.github/workflows/cargo-publish.yml +++ b/.github/workflows/cargo-publish.yml @@ -26,4 +26,4 @@ jobs: sudo apt install -y protobuf-compiler libssl-dev - name: Publish the package run: | - cargo publish -p vectordb --all-features --token ${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish -p lancedb --all-features --token ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 90f00896..d7a8d686 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["rust/ffi/node", "rust/vectordb", "nodejs"] +members = ["rust/ffi/node", "rust/lancedb", "nodejs"] # Python package needs to be built by maturin. exclude = ["python"] resolver = "2" diff --git a/node/package.json b/node/package.json index d5dcb744..0749e7a4 100644 --- a/node/package.json +++ b/node/package.json @@ -6,7 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "tsc": "tsc -b", - "build": "npm run tsc && cargo-cp-artifact --artifact cdylib vectordb-node index.node -- cargo build --message-format=json", + "build": "npm run tsc && cargo-cp-artifact --artifact cdylib lancedb-node index.node -- cargo build --message-format=json", "build-release": "npm run build -- --release", "test": "npm run tsc && mocha -recursive dist/test", "integration-test": "npm run tsc && mocha -recursive dist/integration_test", @@ -91,4 +91,4 @@ "@lancedb/vectordb-linux-x64-gnu": "0.4.10", "@lancedb/vectordb-win32-x64-msvc": "0.4.10" } -} +} \ No newline at end of file diff --git a/nodejs/.eslintrc.js b/nodejs/.eslintrc.js index ecf09807..cb47e56f 100644 --- a/nodejs/.eslintrc.js +++ b/nodejs/.eslintrc.js @@ -18,5 +18,5 @@ module.exports = { "@typescript-eslint/method-signature-style": "off", "@typescript-eslint/no-explicit-any": "off", }, - ignorePatterns: ["node_modules/", "dist/", "build/", "vectordb/native.*"], + ignorePatterns: ["node_modules/", "dist/", "build/", "lancedb/native.*"], }; diff --git a/nodejs/Cargo.toml b/nodejs/Cargo.toml index 740e34ef..0d734209 100644 --- a/nodejs/Cargo.toml +++ b/nodejs/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vectordb-nodejs" +name = "lancedb-nodejs" edition.workspace = true version = "0.0.0" license.workspace = true @@ -16,7 +16,7 @@ arrow-ipc.workspace = true futures.workspace = true lance-linalg.workspace = true lance.workspace = true -vectordb = { path = "../rust/vectordb" } +lancedb = { path = "../rust/lancedb" } napi = { version = "2.15", default-features = false, features = [ "napi7", "async" diff --git a/nodejs/__test__/arrow.test.ts b/nodejs/__test__/arrow.test.ts index 907e25b1..cb4a300f 100644 --- a/nodejs/__test__/arrow.test.ts +++ b/nodejs/__test__/arrow.test.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { makeArrowTable, toBuffer } from "../vectordb/arrow"; +import { makeArrowTable, toBuffer } from "../lancedb/arrow"; import { Int64, Field, diff --git a/nodejs/vectordb/arrow.ts b/nodejs/lancedb/arrow.ts similarity index 100% rename from nodejs/vectordb/arrow.ts rename to nodejs/lancedb/arrow.ts diff --git a/nodejs/vectordb/connection.ts b/nodejs/lancedb/connection.ts similarity index 100% rename from nodejs/vectordb/connection.ts rename to nodejs/lancedb/connection.ts diff --git a/nodejs/vectordb/index.ts b/nodejs/lancedb/index.ts similarity index 100% rename from nodejs/vectordb/index.ts rename to nodejs/lancedb/index.ts diff --git a/nodejs/vectordb/indexer.ts b/nodejs/lancedb/indexer.ts similarity index 100% rename from nodejs/vectordb/indexer.ts rename to nodejs/lancedb/indexer.ts diff --git a/nodejs/vectordb/native.d.ts b/nodejs/lancedb/native.d.ts similarity index 100% rename from nodejs/vectordb/native.d.ts rename to nodejs/lancedb/native.d.ts diff --git a/nodejs/vectordb/native.js b/nodejs/lancedb/native.js similarity index 60% rename from nodejs/vectordb/native.js rename to nodejs/lancedb/native.js index 4abf5eb5..a4dedff7 100644 --- a/nodejs/vectordb/native.js +++ b/nodejs/lancedb/native.js @@ -32,24 +32,24 @@ switch (platform) { case 'android': switch (arch) { case 'arm64': - localFileExisted = existsSync(join(__dirname, 'vectordb-nodejs.android-arm64.node')) + localFileExisted = existsSync(join(__dirname, 'lancedb-nodejs.android-arm64.node')) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.android-arm64.node') + nativeBinding = require('./lancedb-nodejs.android-arm64.node') } else { - nativeBinding = require('vectordb-android-arm64') + nativeBinding = require('lancedb-android-arm64') } } catch (e) { loadError = e } break case 'arm': - localFileExisted = existsSync(join(__dirname, 'vectordb-nodejs.android-arm-eabi.node')) + localFileExisted = existsSync(join(__dirname, 'lancedb-nodejs.android-arm-eabi.node')) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.android-arm-eabi.node') + nativeBinding = require('./lancedb-nodejs.android-arm-eabi.node') } else { - nativeBinding = require('vectordb-android-arm-eabi') + nativeBinding = require('lancedb-android-arm-eabi') } } catch (e) { loadError = e @@ -63,13 +63,13 @@ switch (platform) { switch (arch) { case 'x64': localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.win32-x64-msvc.node') + join(__dirname, 'lancedb-nodejs.win32-x64-msvc.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.win32-x64-msvc.node') + nativeBinding = require('./lancedb-nodejs.win32-x64-msvc.node') } else { - nativeBinding = require('vectordb-win32-x64-msvc') + nativeBinding = require('lancedb-win32-x64-msvc') } } catch (e) { loadError = e @@ -77,13 +77,13 @@ switch (platform) { break case 'ia32': localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.win32-ia32-msvc.node') + join(__dirname, 'lancedb-nodejs.win32-ia32-msvc.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.win32-ia32-msvc.node') + nativeBinding = require('./lancedb-nodejs.win32-ia32-msvc.node') } else { - nativeBinding = require('vectordb-win32-ia32-msvc') + nativeBinding = require('lancedb-win32-ia32-msvc') } } catch (e) { loadError = e @@ -91,13 +91,13 @@ switch (platform) { break case 'arm64': localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.win32-arm64-msvc.node') + join(__dirname, 'lancedb-nodejs.win32-arm64-msvc.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.win32-arm64-msvc.node') + nativeBinding = require('./lancedb-nodejs.win32-arm64-msvc.node') } else { - nativeBinding = require('vectordb-win32-arm64-msvc') + nativeBinding = require('lancedb-win32-arm64-msvc') } } catch (e) { loadError = e @@ -108,23 +108,23 @@ switch (platform) { } break case 'darwin': - localFileExisted = existsSync(join(__dirname, 'vectordb-nodejs.darwin-universal.node')) + localFileExisted = existsSync(join(__dirname, 'lancedb-nodejs.darwin-universal.node')) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.darwin-universal.node') + nativeBinding = require('./lancedb-nodejs.darwin-universal.node') } else { - nativeBinding = require('vectordb-darwin-universal') + nativeBinding = require('lancedb-darwin-universal') } break } catch {} switch (arch) { case 'x64': - localFileExisted = existsSync(join(__dirname, 'vectordb-nodejs.darwin-x64.node')) + localFileExisted = existsSync(join(__dirname, 'lancedb-nodejs.darwin-x64.node')) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.darwin-x64.node') + nativeBinding = require('./lancedb-nodejs.darwin-x64.node') } else { - nativeBinding = require('vectordb-darwin-x64') + nativeBinding = require('lancedb-darwin-x64') } } catch (e) { loadError = e @@ -132,13 +132,13 @@ switch (platform) { break case 'arm64': localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.darwin-arm64.node') + join(__dirname, 'lancedb-nodejs.darwin-arm64.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.darwin-arm64.node') + nativeBinding = require('./lancedb-nodejs.darwin-arm64.node') } else { - nativeBinding = require('vectordb-darwin-arm64') + nativeBinding = require('lancedb-darwin-arm64') } } catch (e) { loadError = e @@ -152,12 +152,12 @@ switch (platform) { if (arch !== 'x64') { throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) } - localFileExisted = existsSync(join(__dirname, 'vectordb-nodejs.freebsd-x64.node')) + localFileExisted = existsSync(join(__dirname, 'lancedb-nodejs.freebsd-x64.node')) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.freebsd-x64.node') + nativeBinding = require('./lancedb-nodejs.freebsd-x64.node') } else { - nativeBinding = require('vectordb-freebsd-x64') + nativeBinding = require('lancedb-freebsd-x64') } } catch (e) { loadError = e @@ -168,26 +168,26 @@ switch (platform) { case 'x64': if (isMusl()) { localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-x64-musl.node') + join(__dirname, 'lancedb-nodejs.linux-x64-musl.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-x64-musl.node') + nativeBinding = require('./lancedb-nodejs.linux-x64-musl.node') } else { - nativeBinding = require('vectordb-linux-x64-musl') + nativeBinding = require('lancedb-linux-x64-musl') } } catch (e) { loadError = e } } else { localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-x64-gnu.node') + join(__dirname, 'lancedb-nodejs.linux-x64-gnu.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-x64-gnu.node') + nativeBinding = require('./lancedb-nodejs.linux-x64-gnu.node') } else { - nativeBinding = require('vectordb-linux-x64-gnu') + nativeBinding = require('lancedb-linux-x64-gnu') } } catch (e) { loadError = e @@ -197,26 +197,26 @@ switch (platform) { case 'arm64': if (isMusl()) { localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-arm64-musl.node') + join(__dirname, 'lancedb-nodejs.linux-arm64-musl.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-arm64-musl.node') + nativeBinding = require('./lancedb-nodejs.linux-arm64-musl.node') } else { - nativeBinding = require('vectordb-linux-arm64-musl') + nativeBinding = require('lancedb-linux-arm64-musl') } } catch (e) { loadError = e } } else { localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-arm64-gnu.node') + join(__dirname, 'lancedb-nodejs.linux-arm64-gnu.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-arm64-gnu.node') + nativeBinding = require('./lancedb-nodejs.linux-arm64-gnu.node') } else { - nativeBinding = require('vectordb-linux-arm64-gnu') + nativeBinding = require('lancedb-linux-arm64-gnu') } } catch (e) { loadError = e @@ -225,13 +225,13 @@ switch (platform) { break case 'arm': localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-arm-gnueabihf.node') + join(__dirname, 'lancedb-nodejs.linux-arm-gnueabihf.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-arm-gnueabihf.node') + nativeBinding = require('./lancedb-nodejs.linux-arm-gnueabihf.node') } else { - nativeBinding = require('vectordb-linux-arm-gnueabihf') + nativeBinding = require('lancedb-linux-arm-gnueabihf') } } catch (e) { loadError = e @@ -240,26 +240,26 @@ switch (platform) { case 'riscv64': if (isMusl()) { localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-riscv64-musl.node') + join(__dirname, 'lancedb-nodejs.linux-riscv64-musl.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-riscv64-musl.node') + nativeBinding = require('./lancedb-nodejs.linux-riscv64-musl.node') } else { - nativeBinding = require('vectordb-linux-riscv64-musl') + nativeBinding = require('lancedb-linux-riscv64-musl') } } catch (e) { loadError = e } } else { localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-riscv64-gnu.node') + join(__dirname, 'lancedb-nodejs.linux-riscv64-gnu.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-riscv64-gnu.node') + nativeBinding = require('./lancedb-nodejs.linux-riscv64-gnu.node') } else { - nativeBinding = require('vectordb-linux-riscv64-gnu') + nativeBinding = require('lancedb-linux-riscv64-gnu') } } catch (e) { loadError = e @@ -268,13 +268,13 @@ switch (platform) { break case 's390x': localFileExisted = existsSync( - join(__dirname, 'vectordb-nodejs.linux-s390x-gnu.node') + join(__dirname, 'lancedb-nodejs.linux-s390x-gnu.node') ) try { if (localFileExisted) { - nativeBinding = require('./vectordb-nodejs.linux-s390x-gnu.node') + nativeBinding = require('./lancedb-nodejs.linux-s390x-gnu.node') } else { - nativeBinding = require('vectordb-linux-s390x-gnu') + nativeBinding = require('lancedb-linux-s390x-gnu') } } catch (e) { loadError = e diff --git a/nodejs/vectordb/query.ts b/nodejs/lancedb/query.ts similarity index 100% rename from nodejs/vectordb/query.ts rename to nodejs/lancedb/query.ts diff --git a/nodejs/vectordb/table.ts b/nodejs/lancedb/table.ts similarity index 100% rename from nodejs/vectordb/table.ts rename to nodejs/lancedb/table.ts diff --git a/nodejs/npm/darwin-arm64/README.md b/nodejs/npm/darwin-arm64/README.md index ead551dc..b324e37b 100644 --- a/nodejs/npm/darwin-arm64/README.md +++ b/nodejs/npm/darwin-arm64/README.md @@ -1,3 +1,3 @@ -# `vectordb-darwin-arm64` +# `lancedb-darwin-arm64` -This is the **aarch64-apple-darwin** binary for `vectordb` +This is the **aarch64-apple-darwin** binary for `lancedb` diff --git a/nodejs/npm/darwin-arm64/package.json b/nodejs/npm/darwin-arm64/package.json index 546eacea..afae035a 100644 --- a/nodejs/npm/darwin-arm64/package.json +++ b/nodejs/npm/darwin-arm64/package.json @@ -1,5 +1,5 @@ { - "name": "vectordb-darwin-arm64", + "name": "lancedb-darwin-arm64", "version": "0.4.3", "os": [ "darwin" @@ -7,9 +7,9 @@ "cpu": [ "arm64" ], - "main": "vectordb.darwin-arm64.node", + "main": "lancedb.darwin-arm64.node", "files": [ - "vectordb.darwin-arm64.node" + "lancedb.darwin-arm64.node" ], "license": "MIT", "engines": { diff --git a/nodejs/npm/darwin-x64/README.md b/nodejs/npm/darwin-x64/README.md index 3fb8cc8f..dee23695 100644 --- a/nodejs/npm/darwin-x64/README.md +++ b/nodejs/npm/darwin-x64/README.md @@ -1,3 +1,3 @@ -# `vectordb-darwin-x64` +# `lancedb-darwin-x64` -This is the **x86_64-apple-darwin** binary for `vectordb` +This is the **x86_64-apple-darwin** binary for `lancedb` diff --git a/nodejs/npm/darwin-x64/package.json b/nodejs/npm/darwin-x64/package.json index 7617bd05..95353cec 100644 --- a/nodejs/npm/darwin-x64/package.json +++ b/nodejs/npm/darwin-x64/package.json @@ -1,5 +1,5 @@ { - "name": "vectordb-darwin-x64", + "name": "lancedb-darwin-x64", "version": "0.4.3", "os": [ "darwin" @@ -7,9 +7,9 @@ "cpu": [ "x64" ], - "main": "vectordb.darwin-x64.node", + "main": "lancedb.darwin-x64.node", "files": [ - "vectordb.darwin-x64.node" + "lancedb.darwin-x64.node" ], "license": "MIT", "engines": { diff --git a/nodejs/npm/linux-arm64-gnu/README.md b/nodejs/npm/linux-arm64-gnu/README.md index 04c0e44d..b2fda68d 100644 --- a/nodejs/npm/linux-arm64-gnu/README.md +++ b/nodejs/npm/linux-arm64-gnu/README.md @@ -1,3 +1,3 @@ -# `vectordb-linux-arm64-gnu` +# `lancedb-linux-arm64-gnu` -This is the **aarch64-unknown-linux-gnu** binary for `vectordb` +This is the **aarch64-unknown-linux-gnu** binary for `lancedb` diff --git a/nodejs/npm/linux-arm64-gnu/package.json b/nodejs/npm/linux-arm64-gnu/package.json index 0d6f6840..ec668413 100644 --- a/nodejs/npm/linux-arm64-gnu/package.json +++ b/nodejs/npm/linux-arm64-gnu/package.json @@ -1,5 +1,5 @@ { - "name": "vectordb-linux-arm64-gnu", + "name": "lancedb-linux-arm64-gnu", "version": "0.4.3", "os": [ "linux" @@ -7,9 +7,9 @@ "cpu": [ "arm64" ], - "main": "vectordb.linux-arm64-gnu.node", + "main": "lancedb.linux-arm64-gnu.node", "files": [ - "vectordb.linux-arm64-gnu.node" + "lancedb.linux-arm64-gnu.node" ], "license": "MIT", "engines": { diff --git a/nodejs/npm/linux-x64-gnu/README.md b/nodejs/npm/linux-x64-gnu/README.md index 63d5f7be..e4a94cdd 100644 --- a/nodejs/npm/linux-x64-gnu/README.md +++ b/nodejs/npm/linux-x64-gnu/README.md @@ -1,3 +1,3 @@ -# `vectordb-linux-x64-gnu` +# `lancedb-linux-x64-gnu` -This is the **x86_64-unknown-linux-gnu** binary for `vectordb` +This is the **x86_64-unknown-linux-gnu** binary for `lancedb` diff --git a/nodejs/npm/linux-x64-gnu/package.json b/nodejs/npm/linux-x64-gnu/package.json index 0991cde7..7fcfdf1b 100644 --- a/nodejs/npm/linux-x64-gnu/package.json +++ b/nodejs/npm/linux-x64-gnu/package.json @@ -1,5 +1,5 @@ { - "name": "vectordb-linux-x64-gnu", + "name": "lancedb-linux-x64-gnu", "version": "0.4.3", "os": [ "linux" @@ -7,9 +7,9 @@ "cpu": [ "x64" ], - "main": "vectordb.linux-x64-gnu.node", + "main": "lancedb.linux-x64-gnu.node", "files": [ - "vectordb.linux-x64-gnu.node" + "lancedb.linux-x64-gnu.node" ], "license": "MIT", "engines": { diff --git a/nodejs/package.json b/nodejs/package.json index d073b763..67510d38 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -1,10 +1,10 @@ { - "name": "vectordb", + "name": "lancedb", "version": "0.4.3", "main": "./dist/index.js", "types": "./dist/index.d.ts", "napi": { - "name": "vectordb-nodejs", + "name": "lancedb-nodejs", "triples": { "defaults": false, "additional": [ @@ -45,11 +45,11 @@ ], "scripts": { "artifacts": "napi artifacts", - "build:native": "napi build --platform --release --js vectordb/native.js --dts vectordb/native.d.ts dist/", - "build:debug": "napi build --platform --dts ../vectordb/native.d.ts --js ../vectordb/native.js dist/", + "build:native": "napi build --platform --release --js lancedb/native.js --dts lancedb/native.d.ts dist/", + "build:debug": "napi build --platform --dts ../lancedb/native.d.ts --js ../lancedb/native.js dist/", "build": "npm run build:debug && tsc -b", - "docs": "typedoc --plugin typedoc-plugin-markdown vectordb/index.ts", - "lint": "eslint vectordb --ext .js,.ts", + "docs": "typedoc --plugin typedoc-plugin-markdown lancedb/index.ts", + "lint": "eslint lancedb --ext .js,.ts", "prepublishOnly": "napi prepublish -t npm", "//": "maxWorkers=1 is workaround for bigint issue in jest: https://github.com/jestjs/jest/issues/11617#issuecomment-1068732414", "test": "npm run build && jest --maxWorkers=1", @@ -57,10 +57,10 @@ "version": "napi version" }, "optionalDependencies": { - "vectordb-darwin-arm64": "0.4.3", - "vectordb-darwin-x64": "0.4.3", - "vectordb-linux-arm64-gnu": "0.4.3", - "vectordb-linux-x64-gnu": "0.4.3" + "lancedb-darwin-arm64": "0.4.3", + "lancedb-darwin-x64": "0.4.3", + "lancedb-linux-arm64-gnu": "0.4.3", + "lancedb-linux-x64-gnu": "0.4.3" }, "dependencies": { "apache-arrow": "^15.0.0" diff --git a/nodejs/src/connection.rs b/nodejs/src/connection.rs index e292b071..1942d701 100644 --- a/nodejs/src/connection.rs +++ b/nodejs/src/connection.rs @@ -17,8 +17,8 @@ use napi_derive::*; use crate::table::Table; use crate::ConnectionOptions; -use vectordb::connection::{ConnectBuilder, Connection as LanceDBConnection}; -use vectordb::ipc::ipc_file_to_batches; +use lancedb::connection::{ConnectBuilder, Connection as LanceDBConnection}; +use lancedb::ipc::ipc_file_to_batches; #[napi] pub struct Connection { diff --git a/nodejs/src/index.rs b/nodejs/src/index.rs index c8b06257..91d3a7d6 100644 --- a/nodejs/src/index.rs +++ b/nodejs/src/index.rs @@ -40,12 +40,12 @@ impl From for LanceMetricType { #[napi] pub struct IndexBuilder { - inner: vectordb::index::IndexBuilder, + inner: lancedb::index::IndexBuilder, } #[napi] impl IndexBuilder { - pub fn new(tbl: &dyn vectordb::Table) -> Self { + pub fn new(tbl: &dyn lancedb::Table) -> Self { let inner = tbl.create_index(&[]); Self { inner } } diff --git a/nodejs/src/iterator.rs b/nodejs/src/iterator.rs index 50b3b110..55ee0dca 100644 --- a/nodejs/src/iterator.rs +++ b/nodejs/src/iterator.rs @@ -14,9 +14,9 @@ use futures::StreamExt; use lance::io::RecordBatchStream; +use lancedb::ipc::batches_to_ipc_file; use napi::bindgen_prelude::*; use napi_derive::napi; -use vectordb::ipc::batches_to_ipc_file; /** Typescript-style Async Iterator over RecordBatches */ #[napi] diff --git a/nodejs/src/query.rs b/nodejs/src/query.rs index 5bea8714..891a6454 100644 --- a/nodejs/src/query.rs +++ b/nodejs/src/query.rs @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +use lancedb::query::Query as LanceDBQuery; use napi::bindgen_prelude::*; use napi_derive::napi; -use vectordb::query::Query as LanceDBQuery; use crate::{iterator::RecordBatchIterator, table::Table}; diff --git a/nodejs/src/table.rs b/nodejs/src/table.rs index 4a069631..c1882c29 100644 --- a/nodejs/src/table.rs +++ b/nodejs/src/table.rs @@ -13,10 +13,10 @@ // limitations under the License. use arrow_ipc::writer::FileWriter; +use lancedb::table::AddDataOptions; +use lancedb::{ipc::ipc_file_to_batches, table::TableRef}; use napi::bindgen_prelude::*; use napi_derive::napi; -use vectordb::table::AddDataOptions; -use vectordb::{ipc::ipc_file_to_batches, table::TableRef}; use crate::index::IndexBuilder; use crate::query::Query; diff --git a/nodejs/tsconfig.json b/nodejs/tsconfig.json index 08943b38..ba4e4a37 100644 --- a/nodejs/tsconfig.json +++ b/nodejs/tsconfig.json @@ -1,8 +1,8 @@ { "include": [ - "vectordb/*.ts", - "vectordb/**/*.ts", - "vectordb/*.js", + "lancedb/*.ts", + "lancedb/**/*.ts", + "lancedb/*.js", ], "compilerOptions": { "target": "es2022", @@ -18,7 +18,7 @@ ], "typedocOptions": { "entryPoints": [ - "vectordb/index.ts" + "lancedb/index.ts" ], "out": "../docs/src/javascript/", "visibilityFilters": { diff --git a/rust/ffi/node/Cargo.toml b/rust/ffi/node/Cargo.toml index 51bb639d..cede1b60 100644 --- a/rust/ffi/node/Cargo.toml +++ b/rust/ffi/node/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vectordb-node" +name = "lancedb-node" version = "0.4.10" description = "Serverless, low-latency vector database for AI applications" license.workspace = true @@ -24,9 +24,14 @@ half = { workspace = true } lance = { workspace = true } lance-index = { workspace = true } lance-linalg = { workspace = true } -vectordb = { path = "../../vectordb" } +lancedb = { path = "../../lancedb" } tokio = { version = "1.23", features = ["rt-multi-thread"] } -neon = {version = "0.10.1", default-features = false, features = ["channel-api", "napi-6", "promise-api", "task-api"] } +neon = { version = "0.10.1", default-features = false, features = [ + "channel-api", + "napi-6", + "promise-api", + "task-api", +] } object_store = { workspace = true, features = ["aws"] } snafu = { workspace = true } async-trait = "0" diff --git a/rust/ffi/node/README.md b/rust/ffi/node/README.md index 6cccc952..0b9493d6 100644 --- a/rust/ffi/node/README.md +++ b/rust/ffi/node/README.md @@ -1,3 +1,3 @@ -The LanceDB node bridge (vectordb-node) allows javascript applications to access LanceDB datasets. +The LanceDB node bridge (lancedb-node) allows javascript applications to access LanceDB datasets. It is build using [Neon](https://neon-bindings.com). See the node project for an example of how it is used / tests diff --git a/rust/ffi/node/src/error.rs b/rust/ffi/node/src/error.rs index ce447f02..ae165c12 100644 --- a/rust/ffi/node/src/error.rs +++ b/rust/ffi/node/src/error.rs @@ -34,8 +34,8 @@ pub enum Error { pub type Result = std::result::Result; -impl From for Error { - fn from(e: vectordb::error::Error) -> Self { +impl From for Error { + fn from(e: lancedb::error::Error) -> Self { Self::LanceDB { message: e.to_string(), } diff --git a/rust/ffi/node/src/index/scalar.rs b/rust/ffi/node/src/index/scalar.rs index c9c743fe..6605364c 100644 --- a/rust/ffi/node/src/index/scalar.rs +++ b/rust/ffi/node/src/index/scalar.rs @@ -19,7 +19,7 @@ use neon::{ }; use crate::{error::ResultExt, runtime, table::JsTable}; -use vectordb::Table; +use lancedb::Table; pub fn table_create_scalar_index(mut cx: FunctionContext) -> JsResult { let js_table = cx.this().downcast_or_throw::, _>(&mut cx)?; diff --git a/rust/ffi/node/src/index/vector.rs b/rust/ffi/node/src/index/vector.rs index 7185c892..4fb559dd 100644 --- a/rust/ffi/node/src/index/vector.rs +++ b/rust/ffi/node/src/index/vector.rs @@ -13,10 +13,10 @@ // limitations under the License. use lance_linalg::distance::MetricType; +use lancedb::index::IndexBuilder; use neon::context::FunctionContext; use neon::prelude::*; use std::convert::TryFrom; -use vectordb::index::IndexBuilder; use crate::error::Error::InvalidIndexType; use crate::error::ResultExt; diff --git a/rust/ffi/node/src/lib.rs b/rust/ffi/node/src/lib.rs index d445b9a1..33c8e457 100644 --- a/rust/ffi/node/src/lib.rs +++ b/rust/ffi/node/src/lib.rs @@ -22,9 +22,9 @@ use object_store::CredentialProvider; use once_cell::sync::OnceCell; use tokio::runtime::Runtime; -use vectordb::connect; -use vectordb::connection::Connection; -use vectordb::table::ReadParams; +use lancedb::connect; +use lancedb::connection::Connection; +use lancedb::table::ReadParams; use crate::error::ResultExt; use crate::query::JsQuery; diff --git a/rust/ffi/node/src/query.rs b/rust/ffi/node/src/query.rs index c9ba7b8b..6b63593f 100644 --- a/rust/ffi/node/src/query.rs +++ b/rust/ffi/node/src/query.rs @@ -93,7 +93,7 @@ impl JsQuery { .and_then(|stream| { stream .try_collect::>() - .map_err(vectordb::error::Error::from) + .map_err(lancedb::error::Error::from) }) .await; diff --git a/rust/ffi/node/src/table.rs b/rust/ffi/node/src/table.rs index ae861362..cbc6fc3e 100644 --- a/rust/ffi/node/src/table.rs +++ b/rust/ffi/node/src/table.rs @@ -18,12 +18,12 @@ use arrow_array::{RecordBatch, RecordBatchIterator}; use lance::dataset::optimize::CompactionOptions; use lance::dataset::{WriteMode, WriteParams}; use lance::io::ObjectStoreParams; -use vectordb::table::{AddDataOptions, OptimizeAction, WriteOptions}; +use lancedb::table::{AddDataOptions, OptimizeAction, WriteOptions}; use crate::arrow::{arrow_buffer_to_record_batch, record_batch_to_buffer}; +use lancedb::TableRef; use neon::prelude::*; use neon::types::buffer::TypedArray; -use vectordb::TableRef; use crate::error::ResultExt; use crate::{convert, get_aws_credential_provider, get_aws_region, runtime, JsDatabase}; diff --git a/rust/vectordb/Cargo.toml b/rust/lancedb/Cargo.toml similarity index 98% rename from rust/vectordb/Cargo.toml rename to rust/lancedb/Cargo.toml index f5c57f9e..8df2d51b 100644 --- a/rust/vectordb/Cargo.toml +++ b/rust/lancedb/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vectordb" +name = "lancedb" version = "0.4.10" edition.workspace = true description = "LanceDB: A serverless, low-latency vector database for AI applications" diff --git a/rust/vectordb/README.md b/rust/lancedb/README.md similarity index 100% rename from rust/vectordb/README.md rename to rust/lancedb/README.md diff --git a/rust/vectordb/examples/simple.rs b/rust/lancedb/examples/simple.rs similarity index 97% rename from rust/vectordb/examples/simple.rs rename to rust/lancedb/examples/simple.rs index c315ac00..a09eca97 100644 --- a/rust/vectordb/examples/simple.rs +++ b/rust/lancedb/examples/simple.rs @@ -19,9 +19,9 @@ use arrow_array::{FixedSizeListArray, Int32Array, RecordBatch, RecordBatchIterat use arrow_schema::{DataType, Field, Schema}; use futures::TryStreamExt; -use vectordb::connection::Connection; -use vectordb::table::AddDataOptions; -use vectordb::{connect, Result, Table, TableRef}; +use lancedb::connection::Connection; +use lancedb::table::AddDataOptions; +use lancedb::{connect, Result, Table, TableRef}; #[tokio::main] async fn main() -> Result<()> { diff --git a/rust/vectordb/src/arrow.rs b/rust/lancedb/src/arrow.rs similarity index 100% rename from rust/vectordb/src/arrow.rs rename to rust/lancedb/src/arrow.rs diff --git a/rust/vectordb/src/connection.rs b/rust/lancedb/src/connection.rs similarity index 100% rename from rust/vectordb/src/connection.rs rename to rust/lancedb/src/connection.rs diff --git a/rust/vectordb/src/data.rs b/rust/lancedb/src/data.rs similarity index 100% rename from rust/vectordb/src/data.rs rename to rust/lancedb/src/data.rs diff --git a/rust/vectordb/src/data/inspect.rs b/rust/lancedb/src/data/inspect.rs similarity index 100% rename from rust/vectordb/src/data/inspect.rs rename to rust/lancedb/src/data/inspect.rs diff --git a/rust/vectordb/src/data/sanitize.rs b/rust/lancedb/src/data/sanitize.rs similarity index 100% rename from rust/vectordb/src/data/sanitize.rs rename to rust/lancedb/src/data/sanitize.rs diff --git a/rust/vectordb/src/error.rs b/rust/lancedb/src/error.rs similarity index 100% rename from rust/vectordb/src/error.rs rename to rust/lancedb/src/error.rs diff --git a/rust/vectordb/src/index.rs b/rust/lancedb/src/index.rs similarity index 100% rename from rust/vectordb/src/index.rs rename to rust/lancedb/src/index.rs diff --git a/rust/vectordb/src/index/vector.rs b/rust/lancedb/src/index/vector.rs similarity index 100% rename from rust/vectordb/src/index/vector.rs rename to rust/lancedb/src/index/vector.rs diff --git a/rust/vectordb/src/io.rs b/rust/lancedb/src/io.rs similarity index 100% rename from rust/vectordb/src/io.rs rename to rust/lancedb/src/io.rs diff --git a/rust/vectordb/src/io/object_store.rs b/rust/lancedb/src/io/object_store.rs similarity index 100% rename from rust/vectordb/src/io/object_store.rs rename to rust/lancedb/src/io/object_store.rs diff --git a/rust/vectordb/src/ipc.rs b/rust/lancedb/src/ipc.rs similarity index 100% rename from rust/vectordb/src/ipc.rs rename to rust/lancedb/src/ipc.rs diff --git a/rust/vectordb/src/lib.rs b/rust/lancedb/src/lib.rs similarity index 92% rename from rust/vectordb/src/lib.rs rename to rust/lancedb/src/lib.rs index c2ed48bc..ac086ef6 100644 --- a/rust/vectordb/src/lib.rs +++ b/rust/lancedb/src/lib.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # VectorDB ([LanceDB](https://github.com/lancedb/lancedb)) -- Developer-friendly, serverless vector database for AI applications -//! //! [LanceDB](https://github.com/lancedb/lancedb) is an open-source database for vector-search built with persistent storage, //! which greatly simplifies retrevial, filtering and management of embeddings. //! @@ -33,7 +31,7 @@ //! LanceDB runs in process, to use it in your Rust project, put the following in your `Cargo.toml`: //! //! ```ignore -//! cargo install vectordb +//! cargo install lancedb //! ``` //! //! ### Quick Start @@ -45,7 +43,7 @@ //! ```rust //! # use arrow_schema::{Field, Schema}; //! # tokio::runtime::Runtime::new().unwrap().block_on(async { -//! let db = vectordb::connect("data/sample-lancedb").execute().await.unwrap(); +//! let db = lancedb::connect("data/sample-lancedb").execute().await.unwrap(); //! # }); //! ``` //! @@ -60,7 +58,7 @@ //! ```rust //! use object_store::aws::AwsCredential; //! # tokio::runtime::Runtime::new().unwrap().block_on(async { -//! let db = vectordb::connect("data/sample-lancedb") +//! let db = lancedb::connect("data/sample-lancedb") //! .aws_creds(AwsCredential { //! key_id: "some_key".to_string(), //! secret_key: "some_secret".to_string(), @@ -90,7 +88,7 @@ //! //! # tokio::runtime::Runtime::new().unwrap().block_on(async { //! # let tmpdir = tempfile::tempdir().unwrap(); -//! # let db = vectordb::connect(tmpdir.path().to_str().unwrap()).execute().await.unwrap(); +//! # let db = lancedb::connect(tmpdir.path().to_str().unwrap()).execute().await.unwrap(); //! let schema = Arc::new(Schema::new(vec![ //! Field::new("id", DataType::Int32, false), //! Field::new( @@ -134,7 +132,7 @@ //! # use arrow_schema::{Schema, Field, DataType}; //! # tokio::runtime::Runtime::new().unwrap().block_on(async { //! # let tmpdir = tempfile::tempdir().unwrap(); -//! # let db = vectordb::connect(tmpdir.path().to_str().unwrap()).execute().await.unwrap(); +//! # let db = lancedb::connect(tmpdir.path().to_str().unwrap()).execute().await.unwrap(); //! # let tbl = db.open_table("idx_test").execute().await.unwrap(); //! tbl.create_index(&["vector"]) //! .ivf_pq() @@ -155,7 +153,7 @@ //! # use arrow_array::{FixedSizeListArray, Float32Array, Int32Array, types::Float32Type}; //! # tokio::runtime::Runtime::new().unwrap().block_on(async { //! # let tmpdir = tempfile::tempdir().unwrap(); -//! # let db = vectordb::connect(tmpdir.path().to_str().unwrap()).execute().await.unwrap(); +//! # let db = lancedb::connect(tmpdir.path().to_str().unwrap()).execute().await.unwrap(); //! # let schema = Arc::new(Schema::new(vec![ //! # Field::new("id", DataType::Int32, false), //! # Field::new("vector", DataType::FixedSizeList( diff --git a/rust/vectordb/src/query.rs b/rust/lancedb/src/query.rs similarity index 100% rename from rust/vectordb/src/query.rs rename to rust/lancedb/src/query.rs diff --git a/rust/vectordb/src/table.rs b/rust/lancedb/src/table.rs similarity index 98% rename from rust/vectordb/src/table.rs rename to rust/lancedb/src/table.rs index e784532d..1646af8a 100644 --- a/rust/vectordb/src/table.rs +++ b/rust/lancedb/src/table.rs @@ -164,7 +164,7 @@ pub trait Table: std::fmt::Display + Send + Sync { /// # use arrow_schema::{Schema, Field, DataType}; /// # tokio::runtime::Runtime::new().unwrap().block_on(async { /// let tmpdir = tempfile::tempdir().unwrap(); - /// let db = vectordb::connect(tmpdir.path().to_str().unwrap()) + /// let db = lancedb::connect(tmpdir.path().to_str().unwrap()) /// .execute() /// .await /// .unwrap(); @@ -212,7 +212,7 @@ pub trait Table: std::fmt::Display + Send + Sync { /// # use arrow_schema::{Schema, Field, DataType}; /// # tokio::runtime::Runtime::new().unwrap().block_on(async { /// let tmpdir = tempfile::tempdir().unwrap(); - /// let db = vectordb::connect(tmpdir.path().to_str().unwrap()) + /// let db = lancedb::connect(tmpdir.path().to_str().unwrap()) /// .execute() /// .await /// .unwrap(); @@ -266,7 +266,7 @@ pub trait Table: std::fmt::Display + Send + Sync { /// # use arrow_schema::{Schema, Field, DataType}; /// # tokio::runtime::Runtime::new().unwrap().block_on(async { /// let tmpdir = tempfile::tempdir().unwrap(); - /// let db = vectordb::connect(tmpdir.path().to_str().unwrap()) + /// let db = lancedb::connect(tmpdir.path().to_str().unwrap()) /// .execute() /// .await /// .unwrap(); @@ -324,8 +324,8 @@ pub trait Table: std::fmt::Display + Send + Sync { /// # use arrow_array::RecordBatch; /// # use futures::TryStreamExt; /// # tokio::runtime::Runtime::new().unwrap().block_on(async { - /// # let tbl = vectordb::table::NativeTable::open("/tmp/tbl").await.unwrap(); - /// use crate::vectordb::Table; + /// # let tbl = lancedb::table::NativeTable::open("/tmp/tbl").await.unwrap(); + /// use crate::lancedb::Table; /// let stream = tbl /// .query() /// .nearest_to(&[1.0, 2.0, 3.0]) @@ -343,8 +343,8 @@ pub trait Table: std::fmt::Display + Send + Sync { /// # use arrow_array::RecordBatch; /// # use futures::TryStreamExt; /// # tokio::runtime::Runtime::new().unwrap().block_on(async { - /// # let tbl = vectordb::table::NativeTable::open("/tmp/tbl").await.unwrap(); - /// use crate::vectordb::Table; + /// # let tbl = lancedb::table::NativeTable::open("/tmp/tbl").await.unwrap(); + /// use crate::lancedb::Table; /// let stream = tbl /// .query() /// .filter("id > 5") @@ -361,8 +361,8 @@ pub trait Table: std::fmt::Display + Send + Sync { /// # use arrow_array::RecordBatch; /// # use futures::TryStreamExt; /// # tokio::runtime::Runtime::new().unwrap().block_on(async { - /// # let tbl = vectordb::table::NativeTable::open("/tmp/tbl").await.unwrap(); - /// use crate::vectordb::Table; + /// # let tbl = lancedb::table::NativeTable::open("/tmp/tbl").await.unwrap(); + /// use crate::lancedb::Table; /// let stream = tbl.query().execute_stream().await.unwrap(); /// let batches: Vec = stream.try_collect().await.unwrap(); /// # }); diff --git a/rust/vectordb/src/table/dataset.rs b/rust/lancedb/src/table/dataset.rs similarity index 100% rename from rust/vectordb/src/table/dataset.rs rename to rust/lancedb/src/table/dataset.rs diff --git a/rust/vectordb/src/table/merge.rs b/rust/lancedb/src/table/merge.rs similarity index 100% rename from rust/vectordb/src/table/merge.rs rename to rust/lancedb/src/table/merge.rs diff --git a/rust/vectordb/src/utils.rs b/rust/lancedb/src/utils.rs similarity index 100% rename from rust/vectordb/src/utils.rs rename to rust/lancedb/src/utils.rs