Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions databases/clickhouse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,18 @@ Click the Explain dropdown in the query editor to choose:

Each request carries a query id and asks for progress in the HTTP headers, so a long query reports rows read as it goes. Cancelling sends `KILL QUERY` for that id, stopping the query on the server rather than only dropping the connection. The [query timeout](/customization/general-settings#query-timeout) bounds each request at the timeout plus 30 seconds.

Grid edits go out as INSERT, `ALTER TABLE … UPDATE`, and `ALTER TABLE … DELETE`.
Grid edits go out as INSERT, `ALTER TABLE … UPDATE`, and `ALTER TABLE … DELETE`, each with `SETTINGS mutations_sync = 1`, so a save returns once the rows have changed. A large table can take a long time.

Values too long for the URL travel inside the statement in the request body, so a long text value or a large import is not held to the server's URL limits. A statement longer than your user's `max_query_size` raises that setting for its own request, unless the user is read-only or a settings constraint caps it lower.
ClickHouse's primary key is its sorting key, and rows can share it. An edit or a delete finds its row by every value the row was loaded with: right before the statement runs, the row is looked up, and the statement is limited to the data part that holds it (`_part`), so a row inserted in the meantime is left alone.

- A row that another row matches in every column cannot be edited or deleted on its own. The save stops before anything is written. Deleting all of the identical rows at once works.
- When the row still holds its old values after the statement, because its part was merged away or another client inserted the same values, the save reports it. Refresh the table before saving again.
- A row holding an `AggregateFunction` column cannot be found by its values, so its edits are refused.
- A table with no data parts, such as `Memory`, cannot be edited from the grid. Use the SQL editor.

<Warning>
ClickHouse mutations run in the background, so the grid reports the statement as accepted rather than applied, and a large table can take a long time. Watch `SELECT * FROM system.mutations WHERE is_done = 0` for progress.
</Warning>
Where your settings profile does not let you change `mutations_sync`, the plain `UPDATE` and `DELETE` go out, limited to the row's part the same way.

Values too long for the URL travel inside the statement in the request body, so a long text value or a large import is not held to the server's URL limits. A statement longer than your user's `max_query_size` raises that setting for its own request, unless the user is read-only or a settings constraint caps it lower.

## Updating rows outside the grid

Expand Down
2 changes: 1 addition & 1 deletion databases/snowflake.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ No **SSL Mode**, and no plaintext option. Every request is HTTPS to the account
## Limitations

- No SSH tunnel. The form has no Network tab, and the endpoint is reached over HTTPS only.
- A grid edit keys on the declared primary key, or on every column when there is none, and a duplicate key value updates or deletes every row that matches it. Snowflake never enforces key constraints, so check a table for duplicates before editing it.
- A grid edit keys on the declared primary key, or on every column when there is none. Snowflake never enforces key constraints, so an edit or delete first looks its row up, and when another row matches too, the save stops before anything is written. Edit such rows with a query.
- `TIMESTAMP_LTZ` values read as the UTC instant, marked `Z`, rather than converted to the session's `TIMEZONE`.

## Troubleshooting
Expand Down
4 changes: 1 addition & 3 deletions databases/trino.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ Identifiers are quoted with double quotes. Results page with `OFFSET n ROWS FETC

Cell edits become `INSERT`, `UPDATE`, and `DELETE`. Values carry their Trino type, so a `varchar` holding digits stays quoted, and columns that cannot be compared with `=` (`array`, `map`, `row`) stay out of the `WHERE` clause.

<Danger>
Editing one of two identical rows changes both, and deleting one deletes both. With no primary keys reported, a row edit matches on every column of the row as it was read, and there is no transaction to roll it back. Check for duplicates before editing a table with no unique column.
</Danger>
An edit or a delete matches the row on its primary key, or on every column it was read with when none is reported, and first looks the row up. When another row matches too, the save stops before anything is written, since there is no transaction to roll it back. Edit such rows with a query.

The Structure tab creates tables and adds, drops, renames, and retypes columns, in autocommit. A type change is the operation fewest connectors accept.

Expand Down
2 changes: 2 additions & 0 deletions features/change-tracking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ Each generated SQL statement is held to the number of rows it was written for. O

Such a statement is held to the other end too. Finding fewer rows than it was written for means the row it meant to write is no longer there, so the save rolls back and keeps the edits rather than reporting a success that wrote nothing. Engines whose drivers report no real count, ClickHouse among them, are not held to it. Of the drivers that write their own statements, SQL Server and Oracle are held to it on a table without a primary key, and MongoDB and Redis are not. SQL Server bounds that match with `TOP (1)` and Oracle with `ROWNUM = 1`, so of two identical rows they write one.

Where a count cannot hold a statement to its row, the row is looked up right before the statement runs instead: on ClickHouse, Snowflake and Trino for every edit and delete, and on Dameng for a table without a primary key. Finding no row, or more than the change was made on, stops the save before anything is written and keeps the queue. A ClickHouse statement is also limited to the data part its row was found in, and the row is checked after it runs. See [ClickHouse](/databases/clickhouse#running-queries).

There is no discard button. Undo the edits, or take the **Discard Unsaved Changes?** prompt that appears when you refresh, sort, filter, change page, or close the tab with edits pending.

## Previewing the SQL
Expand Down
Loading