Safe-write sandbox
Made-up dataA made-up table of tutors, a table of bookings that links to it, and a source to copy new rows from. Pick rows to put in a batch. Nothing is written until you approve it; then every written row is read back and the count is checked. Deleting is never allowed: try it.
Staging, approving and undoing need JavaScript. Without it, the sample batch reads below, staged but not written. A delete never runs: it is flagged, and the row gets a last seen date instead.
The table
| Name | Teaches | Sign-in | Status |
|---|---|---|---|
| Fenn | World history | fenn10 | In the source |
| Ada | French | ada79 | In the source |
| Bram | World history | bram31 | In the source |
| Dara | French | dara81 | In the source |
| Hollis | Geometry | hollis59 | In the source |
| Cleo | Spanish | cleo52 | In the source |
Bookings that link to it
- Tuesday 5 pmwith Hollis
- Thursday 4 pmwith Cleo
- Wednesday 3 pmwith Fenn
- Friday 2 pmwith Hollis
The source
The full download says it holds 9 rows, and 9 arrived. 4 of them are not in the table as written:
"Esme"Physicstabesme10"Kit"Geometrykit71"Noor"Frenchnoor83"bram "World historybram31
Mark rows gone that a download no longer holds
Batch 1
Staged, nothing written- New row: Kit, Geometry, sign-in kit71
- New row: Noor, French, sign-in noor83
- Last seen 12 May: Fenn. Asked to delete. Kept, with a last seen date.
Held or flagged
- Held:
"Esme". Sign-in"tabesme10". The sign-in name starts with an invisible tab character, shown here in words. It would never match the same sign-in name typed by hand. - Held:
"bram ". Already in the table as Bram. Only case and spaces differ. - Delete Fenn. Not deleted. The booking on Wednesday 3 pm links to this row and would break. Staged as last seen 12 May instead.
- Incomplete download. The download says it holds 9 rows, and 7 arrived. Nothing is marked gone until the source is complete. Had it run, it would have marked 2 rows gone, 1 of them still in the source.
The checks, one per rule
- Look. Flagged. Counted 6 rows. Checked 4 new rows against the table. Saved a copy of the 1 row that will change. Held 2 rows back.
- Never delete. Flagged. 1 delete asked for. No row was removed.
- Source complete. Flagged. The download is incomplete, so nothing is marked gone.
- Stage. Passed. Batch 1: 2 new rows, 1 change. Nothing written yet.
- Approve. Waiting. Waits for a person who has seen every change.
- Write. Waiting. Nothing written yet.
- Read back. Waiting. Each written row will be read back.
- Count. Waiting. The count before plus the new rows must equal the count after.
On record
No batch written yet.