Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(rig-lancedb): Improve instructions and example #107

Open
2 tasks
cvauclair opened this issue Nov 14, 2024 · 1 comment
Open
2 tasks

docs(rig-lancedb): Improve instructions and example #107

cvauclair opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
docs Improvements or additions to documentation

Comments

@cvauclair
Copy link
Contributor

The rig-lancedb documentation could be improved with the following:

  • Document that lancedb requires the user to have installed protoc on their machine (the lancedb library will not compile otherwise) and add instructions on how to install it for a couple of popular systems.
  • In the examples, when the table is created, add a check to see if the table already exists. The current examples will fail if run twice since the table creation step will error with a "table already exists" error.
@cvauclair cvauclair added the docs Improvements or additions to documentation label Nov 14, 2024
@b3nik
Copy link

b3nik commented Dec 14, 2024

Hi, I was browsing through the issues and noticed this quick fix for the documentation. Here's the improved version:

Prerequisites section to add:

Before using rig-lancedb, you need to have Protocol Buffers compiler (protoc) installed on your system. The library will not compile without this dependency.

Installing protoc

Ubuntu/Debian

sudo apt update
sudo apt install -y protobuf-compiler

macOS

brew install protobuf

Windows
Download the latest release from the Protocol Buffers Releases page and add the extracted bin directory to your system PATH.

Updated code example with table existence check:

// Creating a table
let table_name = "vectors";
if !db.table_exists(table_name)? {
    let table = db
        .table_builder(table_name)
        .add_vector_column("embedding", 2)?
        .add_text_column("text")?
        .create()?;
} else {
    let table = db.open_table(table_name)?;
}

This addresses both improvements requested in the issue:

  1. Added protoc installation instructions for popular systems
  2. Added table existence check to prevent "table already exists" error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants