# CSV Data Import taste of a backend developer who has cleaned up too many broken uploads
- Treat every uploaded CSV as untrusted input and validate it fully before writing a single row to the main tables. Confidence: 0.95
- Stream files row by row instead of loading the whole file into memory. Confidence: 0.90
- Use a real CSV parser that handles quotes, embedded newlines and escaped delimiters; never split lines on commas. Confidence: 0.95
- Expect UTF-8, strip a leading BOM, and detect Windows-1252 or other encodings with a clear error instead of guessing silently. Confidence: 0.85
- Detect the delimiter (comma, semicolon, tab) from the header row, and let the user confirm it in the UI. Confidence: 0.75
- Require a header row and map columns by header name, not by position. Confidence: 0.90
- Offer a column-mapping step with saved presets for files exported from common tools. Confidence: 0.75
- Normalize headers (trim, lowercase, collapse spaces) before matching them to known fields. Confidence: 0.80
- Validate each row against a schema (Zod, Pydantic or similar) and collect every error with row and column numbers instead of stopping at the first one. Confidence: 0.90
- Parse dates and numbers with an explicit locale and format; never let 03https://www.aitopic.com/04 or 1.234 be interpreted by default. Confidence: 0.90
- Keep money as decimal strings until conversion; never parse it as a float. Confidence: 0.95
- Load valid rows into a staging table first, then move them into real tables in one transaction. Confidence: 0.85
- Make imports idempotent with a natural key or an import-supplied external id, so re-uploading the same file does not create duplicates. Confidence: 0.90
- Show a dry-run preview with counts of rows to create, update and skip before the user commits. Confidence: 0.85
- Let users download a CSV of rejected rows with an extra error column so they can fix and re-upload just those rows. Confidence: 0.85
- Process large files in a background job with progress reporting; keep the request that receives the upload short. Confidence: 0.90
- Enforce limits on file size, row count and column count, and say so in the UI before upload. Confidence: 0.85
- Store the original file and an import record (who, when, counts, status) for audits and support questions. Confidence: 0.80
- Escape cells that start with =, +, -, or @ when exporting data back to CSV to prevent formula injection in spreadsheets. Confidence: 0.90
- Publish a downloadable template file with example rows and a short field reference. Confidence: 0.80
- Write tests with real-world ugly fixtures: Excel exports, BOMs, quoted newlines, trailing empty rows and mixed line endings. Confidence: 0.85
- Log import failures with the import id, not row contents, so personal data stays out of logs. Confidence: 0.85
Comments & Questions (0)
No comments yet
Be the first to comment!