Skip to main content
Applies to: Embedded ✅, Enterprise ✅ Ingestion brings data into a LanceDB table. Start by choosing a schema and creating the table, then choose a write operation according to how incoming records relate to data already stored.

Choose a write operation

Appending the same input twice can create duplicate records. Use merge insert with a stable key when the incoming data should update existing records.

Connect and prepare the data

Use the connection guide to connect to Embedded or Enterprise. The SDK write operations in this section work with both. Enterprise also supports SQL write statements; an SDK filter expression does not require a separate SQL connection. Choose the column types, required fields and vector dimensions before a large load. SDKs support different input representations, including row objects and Arrow batches. The table creation guide covers those choices.

Try a complete write workflow

This example starts with Alice and Bob, appends Charlie, updates Bob’s name and login count, then merges a batch containing Charlie and Dana. Finally, it selects Dana’s row for inspection and deletes it.
Each program creates a temporary local database, performs the five operations, prints the result, and removes its temporary data when finished.
  • Python: install lancedb, save the code as ingestion.py, and run python ingestion.py.
  • TypeScript: install @lancedb/lancedb, save the code as ingestion.mts, and run node ingestion.mts with Node.js 22.18 or later.
  • Rust: download the complete Rust project, extract it, and run cargo run --locked. It includes src/main.rs, the Cargo manifest and a lockfile for the example’s dependencies. The code is shown below.
After the operations, Alice has 10 logins, Bobby has 21, and Charlie has 6. Dana is selected for deletion and is absent from the final result.

Verify the result

After a write completes, inspect the affected keys and fields and check the row count. SDK return values differ by operation and language; use the relevant API reference when relying on returned counts or version metadata. Readers with older snapshots may not see another handle’s writes immediately. See Consistency. A table checked out at a historical version must return to the latest version before it can be modified.

Load larger datasets

Use batches or file-backed input when the dataset is too large to hold in memory. The insert guide covers input formats, progress reporting and write parallelism. Keep retry behavior in mind: repeating an append is not the same as retrying a key-based upsert.