====== CSV & TSV Viewer ====== CodeDB includes a built-in CSV and TSV viewer that renders tabular data as an interactive table with virtual scrolling for large datasets. ===== Opening CSV/TSV Files ===== When you open a ''.csv'' or ''.tsv'' file, CodeDB automatically shows it in **Table** view instead of the raw text editor. The viewer detects the delimiter based on file extension: * ''.csv'' files use comma ('','') as delimiter * ''.tsv'' files use tab as delimiter ===== View Modes ===== Three view modes are available via the toolbar at the top of the editor: ^ Mode ^ Description ^ | **Table** | Renders data as a formatted, scrollable table with headers | | **Raw** | Shows the raw text in the Monaco code editor | | **Edit** | Opens the text in Monaco for editing; switching back to Table re-parses the content | === Default View Mode === You can set the default view mode in Settings (⌘,). Options: * **Table** (default) — opens CSV/TSV files in table view * **Raw** — opens in the text editor * **Edit** — opens in editable text mode ===== Column Coloring ===== CodeDB can color-code table columns for easier reading. Configure this in Settings: ^ Setting ^ Effect ^ | **Off** | No column coloring | | **Headers Only** (default) | Column headers get distinct background colors | | **Full Columns** | Both headers and data cells get subtle alternating color tints | Eight distinct color hues cycle across columns for visual differentiation. ===== Virtual Scrolling ===== The CSV viewer uses virtual scrolling to handle large datasets efficiently. Files with 100,000+ rows render smoothly because only visible rows are added to the DOM. * Scroll normally — rows render on demand * The info bar shows total row and column counts * Import supports files up to 50 MB ===== Editing CSV Data ===== - Switch to **Edit** mode using the toolbar - Modify the raw text in the Monaco editor - Switch back to **Table** mode to see the updated table - Changes are automatically saved to the database **Tip:** The file content is the single source of truth. Edits in Raw or Edit mode are reflected when you switch back to Table view.