Skip to content

Commit da0ca40

Browse files
authored
feat(XS-54): Adds CSV and SQL Import (#66)
Adds CSV/delimited and .sql script import, reachable from the Schema Explorer toolbar or a table's right-click menu. CSV import sniffs the delimiter, previews the file, maps source columns onto a target - an existing table or a new one whose types are inferred from the data - and skips bad rows rather than failing the load. A .sql file runs statement by statement on one connection with a progress count instead of a result tab per statement.
1 parent e505585 commit da0ca40

70 files changed

Lines changed: 5543 additions & 60 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/TESTING.md‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,25 @@ npm run e2e
183183
```
184184
e2e/
185185
playwright.config.ts config; starts the app via `npm run e2e:server`
186+
playwright.screenshots.config.ts
187+
the README gallery run (see README screenshots below)
186188
global-setup.ts brings the database stack up if it isn't already
187189
e2e-server.mjs builds the frontend, then runs `go run -tags server ./cmd/e2e-server`
188190
pages/ page objects, one per app surface
189-
support/
191+
support/ shared by both suites
190192
fixtures.ts the `test` every spec imports: page-object fixtures + `seed`
191193
databases.ts the driver matrix (POSTGRES / MYSQL / MARIADB / SQLITE)
192194
seed.ts Seeder: create + populate a uniquely-named table through the UI
195+
ports.ts port probe/wait helpers both global setups use
193196
specs/ grouped by surface: editor/, results/, sidebar/, table-view/,
194197
plus app-shell and connections at the root
198+
screenshots/ everything only the gallery run needs
199+
readme.spec.ts one serial test that captures 1.png - 12.png
200+
global-setup.ts recreates the `forum` database from the dump
201+
screenshot-db.ts the demo connections (Forum / Postgres) and the 2048x1152 viewport
202+
fixtures/
203+
forum.dump.sql the demo dataset restored before every run
204+
users.csv 20 rows matching `public.users`, loaded by the import shot
195205
```
196206

197207
Specs import shared code via the `@support/*` alias (see `tsconfig.json`), so nesting
@@ -234,6 +244,30 @@ the matrix suites replay it on all four drivers.
234244
results grid, table view, tabs, etc.) or when touching `e2e/`, `cmd/e2e-server/`, or
235245
server-mode event handling in `internal/app/`.
236246

247+
### README screenshots
248+
249+
A second Playwright run captures the whole README gallery - `1.png` - `12.png` under
250+
[`.github/screenshots/`](screenshots/) - from one serial test, so every shot shares the
251+
same workspace, theme and panel sizes:
252+
253+
```bash
254+
task screenshots # or: cd e2e && npm run screenshots
255+
```
256+
257+
`screenshots/global-setup.ts` recreates the `forum` database from
258+
`screenshots/fixtures/forum.dump.sql` first, so the data in the gallery is reproducible.
259+
Overrides: `XENSQL_SCREENSHOT_PG_*` (server), `XENSQL_SCREENSHOT_CSV` (the CSV in the
260+
import shot - its path is visible in the dialog), `XENSQL_SCREENSHOT_PG_CONTAINER`
261+
(restore via `docker exec` instead of `docker compose exec`).
262+
263+
Unlike the functional suite it runs at 2048x1152 and builds the frontend with
264+
`XENSQL_FORCE_WINDOW_CHROME=1` so server mode still draws the window controls. The native
265+
file picker can't open there, so the import shot answers the `PickImportFile` binding over
266+
`POST /wails/runtime` with a fixture path.
267+
268+
**Not in CI**, and it rewrites the committed PNGs - regenerate deliberately, then review
269+
the diff.
270+
237271
---
238272

239273
## Continuous integration

‎.github/screenshots/1.png‎

-379 KB
Loading

‎.github/screenshots/10.png‎

211 KB
Loading

‎.github/screenshots/11.png‎

438 KB
Loading

‎.github/screenshots/12.png‎

503 KB
Loading

‎.github/screenshots/2.png‎

-169 KB
Loading

‎.github/screenshots/3.png‎

-632 KB
Loading

‎.github/screenshots/4.png‎

-197 KB
Loading

‎.github/screenshots/5.png‎

-713 KB
Loading

‎.github/screenshots/6.png‎

-449 KB
Loading

0 commit comments

Comments
 (0)