feat: add per-connection read-only mode
Connections default to read-only. SQL editor wraps queries in a read-only transaction so PostgreSQL rejects mutations. Data mutation commands (update_row, insert_row, delete_rows) are blocked at the Rust layer. Toolbar toggle with confirmation dialog lets users switch to read-write. Badges shown in workspace, table viewer, and status bar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,13 @@ export const disconnectDb = (id: string) =>
|
||||
export const switchDatabase = (config: ConnectionConfig, database: string) =>
|
||||
invoke<void>("switch_database", { config, database });
|
||||
|
||||
// Read-Only
|
||||
export const setReadOnly = (connectionId: string, readOnly: boolean) =>
|
||||
invoke<void>("set_read_only", { connectionId, readOnly });
|
||||
|
||||
export const getReadOnly = (connectionId: string) =>
|
||||
invoke<boolean>("get_read_only", { connectionId });
|
||||
|
||||
// Queries
|
||||
export const executeQuery = (connectionId: string, sql: string) =>
|
||||
invoke<QueryResult>("execute_query", { connectionId, sql });
|
||||
|
||||
Reference in New Issue
Block a user