--- title: "Ingesting data" sidebarTitle: "Overview" description: "Choose how to create a table, append records or change existing data." icon: inbox keywords: ["ingest", "create table", "add", "insert", "arrow", "pandas", "polars", "pydantic"] availability: embedded: available enterprise: available --- import { PyWriteWorkflow, TsWriteWorkflowBody, TsWriteWorkflowTail, RsWriteWorkflow } from '/snippets/ingestion_examples.mdx'; 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 {#choose-a-write-method} | Task | Operation | What happens | | --- | --- | --- | | [Create a table](/ingestion/create-table) | `create_table` / `createTable` | Create a table from data or an explicit schema. | | [Append records](/ingestion/insert) | `add` | Add rows without matching existing keys. | | [Upsert by key](/ingestion/merge-insert) | `merge_insert` / `mergeInsert` | Choose whether matching rows are updated and new keys inserted. | | [Update selected rows](/ingestion/update) | `update` | Change values in rows selected by a predicate. | | [Delete selected rows](/ingestion/delete) | `delete` | Remove matching rows from the current table contents. | 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 {#connect-to-lancedb} Use the [connection guide](/basics/catalog) to connect to Embedded or Enterprise. The SDK write operations in this section work with both. Enterprise also supports [SQL write statements](/sql#dml); 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](/ingestion/create-table) covers those choices. ## Try a complete write workflow {#create-the-example-table} 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](https://raw.githubusercontent.com/lancedb/lancedb/2af85bea8999c8cd23ec01ff62ba110c54652c10/docs/web/static/code/ingestion-rust.zip), 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. {PyWriteWorkflow} {TsWriteWorkflowBody} {TsWriteWorkflowTail} {RsWriteWorkflow} 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 {#verify} 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](/tables/consistency). A table checked out at a historical version must return to the latest version before it can be modified. ## Load larger datasets {#large-loads} Use batches or file-backed input when the dataset is too large to hold in memory. The [insert guide](/ingestion/insert#large-datasets) 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.