CSV Import
Import CSV files into database tables with column mapping, type inference, and conflict handling
CSV Import
Import data from CSV files directly into your database tables — no COPY command, no scripting, no leaving the app.
CSV import is the fastest way to get a spreadsheet, an export from another tool, or a colleague’s data dump into a real table you can query. It’s handy for seeding a dev database, loading a lookup table, or reconciling an external file against data you already have.
Starting an Import
- Open the CSV Import dialog from the sidebar or command palette
- Drag and drop a
.csvfile, or click to browse
Configuration
Column Mapping
data-peek reads the CSV header row, infers a type for each column, and attempts to match each one to a column in your target table. From there you can:
- Map CSV columns to differently-named table columns
- Skip columns you don’t want to import
- Create a brand-new table from the CSV structure (types are inferred from the data)
Import Options
| Option | Description |
|---|---|
| Target table | Existing table or create new |
| Batch size | Rows per INSERT batch (100, 500, 1000, 5000) |
| Null handling | How to treat empty values |
| Conflict handling | Skip or update on primary key conflict |
Import Progress
A progress bar shows the import status. Large files are streamed and inserted in batches, so a single huge transaction never blocks the connection or times out.
Example: loading a users file into a new table
Say you have users.csv:
email,full_name,plan
ada@acme.test,Ada Lovelace,pro
grace@acme.test,Grace Hopper,freeDrop it in, choose Create new table named users_import, keep the inferred types, and import. You now have a queryable table:
SELECT plan, count(*) FROM users_import GROUP BY plan;Re-running the same file with Conflict handling → Update on primary key lets you use the CSV as a repeatable upsert source instead of creating duplicates.
Supported Databases
CSV import works with PostgreSQL and MySQL connections.
Type inference is a best guess from the sampled rows — a column of 007 or
leading-zero IDs may come in as an integer. If exact types matter, create the
table first in the Table Designer, then import
into it.
Related
- SQL Dump Import — for
.sqldump files rather than CSV - Data Generator — synthesize test data instead of importing it
- Inline Editing — fix up individual rows after an import