Repository navigation
feat(access, backup): one Grants view showing everything held; routine grants; run and list backups - #484
Merged
Conversation
…tine grants; run and list backups From the 2026-10-04 UX review's open recommendations. Access: - One Grants view instead of "Desired matrix" / "Live catalog". The grid, then "also holds, outside this grid" (database, schema and server-wide grants, DENY, grants on objects that are not rows), then the database- and schema-wide section to edit those (DbAccessPermissionSections generalOnly). splitHeldPrivileges / describeHeldPrivilege in @foxschema/sql. - Routine grants are read: Postgres role_routine_grants, MySQL/MariaDB mysql.procs_priv, Db2 SYSCAT.ROUTINEAUTH, so a procedure or function row opens ticked when EXECUTE is held. New object types PROCEDURE / FUNCTION / ROUTINE; revokes use each engine's routine syntax. - Oracle object grants no longer say ON TABLE, which Oracle rejects. Backup & Restore: - Run the backup from the panel where it is SQL the database server runs, after a confirmation that names the file and the connection; needs editor.ddl (the server classifies BACKUP as a schema change). - List the backups the server recorded (SQL Server msdb, Db2 DB_HISTORY, ClickHouse system.backups) and restore one: its key reaches the restore command checked and re-quoted, never pasted. Restores still only open in the SQL editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Test IDsRemoved (2) · a test or recorded flow outside this repo may still use these
Added (15)
|
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: af571612-65fc-4bfa-828a-b0d08069751a) |
Brings in main, with source-map-js 1.2.2 (#482). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PyNv48vpYUw2HhpjYFNUi
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 056fd4fa-716e-4dd7-bc69-9317be756606) |
huyplb
pushed a commit
that referenced
this pull request
Oct 6, 2026
…d ones (#484) The pass predates #484, which added "Run backup now" (server-side SQL, after confirmation, needs editor.ddl), the history listing for SQL Server, Db2 and ClickHouse, and the one Grants view with routine grants and the also-holds line. "Fox Schema never runs them" is no longer true of backups; it is still true of restores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PyNv48vpYUw2HhpjYFNUi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The five recommendations left open in the 2026-10-04 UX review of Database Access and backups. Stacked on tedious-code/foxSchema#483; retargets to
mainwhen that merges.Access
1. One Grants view. "Desired matrix" and "Live catalog" answered the same question two ways once the matrix opened on what is held. The view is now:
DbAccessPermissionSectionswith a newgeneralOnly).The Utilities Database Access modal, the component's other user, is unchanged.
2. What the grid can't draw, listed under it.
splitHeldPrivileges()returns{ held, elsewhere };heldGridPermissions()now delegates to it.elsewhereis everything the grid doesn't show: database, schema and server-wide grants, DENY rows, grants on objects that aren't rows, and privileges no column shows.describeHeldPrivilege()words each one, e.g. "CONNECT on database shop".3. Routine privileges are read.
information_schema.role_routine_grants, MySQL and MariaDBmysql.procs_priv(only on the query variant that may readmysql.*), and Db2SYSCAT.ROUTINEAUTHjoined toSYSCAT.ROUTINESfor the routine's name.PROCEDURE,FUNCTIONandROUTINE(Postgres doesn't say which). Revokes use each engine's syntax:ON ROUTINE/ON FUNCTION/ON PROCEDURE, andON OBJECT::on SQL Server. MySQL and Db2 refuse an unknown kind rather than guess.ON TABLE, which Oracle rejects. It'sGRANT … ON schema.object.Backup & Restore
4. Run the backup from the panel.
/sql/executelike the editor does. The server classifiesBACKUPas a schema change, so it needseditor.ddl, and the button is disabled without it.5. List existing backups and restore one.
history(conn)on the engines that record them: SQL Server (msdbbackupset/mediafamily), Db2 (SYSIBMADM.DB_HISTORY) and ClickHouse (system.backups).restoreFrom, and the restore command reads that backup.N'…';TAKEN ATtimestamp only;Disk('…','…'), parsed and rebuilt.Verification
splitHeldPrivilegesagrees withheldGridPermissions;editor.ddl.🤖 Generated with Claude Code
Note
Medium Risk
Changes GRANT/REVOKE generation and catalog reads across engines, and introduces server-executed
BACKUPSQL with permission checks—important for auth and data safety but guarded by confirmation and DDL capability.Overview
Access Grants drops the “Desired matrix” / “Live catalog” toggle in favor of one flow: permission matrix (still seeded from current holds), a new also holds outside this grid line via
splitHeldPrivileges/describeHeldPrivilege, and database/schema-wide grants below viaDbAccessPermissionSectionswithgeneralOnly.Privilege SQL layer adds routine object types (
PROCEDURE,FUNCTION,ROUTINE), reads EXECUTE from Postgres/MySQL/Db2 catalogs, maps EXECUTE onto grid rows, and emits dialect-correct revokes; Oracle object grants no longer use invalidON TABLEsyntax.Backup & Restore for server-side SQL backups adds
BackupServerActions: confirm-then-run backup throughexecuteSql(gated oneditor.ddland connection password), optional backup history for SQL Server/Db2/ClickHouse with pick →restoreFromon generated restore SQL (validated/re-quoted per engine). Client-side tools (e.g. Postgres) still only show commands; restores are never auto-run.Reviewed by Cursor Bugbot for commit e2feb10. Bugbot is set up for automated code reviews on this repo. Configure here.