VFS PRAGMA
SQLite 扩展属于数据面。生产环境中的 PRAGMA 只负责控制或检查当前
vfs=graft 数据库背后的 Graft Volume。
repository 操作不再通过 SQLite 暴露。status、stage、commit、branch、merge、 remote 和 JSON 输出都使用 CLI:
graft status --jsongraft add data.sqlitegraft commit -m "save checkpoint"graft diff --json --rows HEAD~1 HEAD data.sqlite调用已经移除的 repository PRAGMA,例如 PRAGMA graft_status,会返回错误并提示
使用 Graft CLI。
Version
Section titled “Version”PRAGMA graft_version;返回 extension version;构建信息可用时也会一并返回。
Volume Inspection
Section titled “Volume Inspection”下面的命令检查当前 VFS database 绑定的 Volume:
PRAGMA graft_debug_volume_info;PRAGMA graft_debug_volume_json_info;PRAGMA graft_debug_volume_status;PRAGMA graft_debug_volume_list;PRAGMA graft_debug_volume_json_list;PRAGMA graft_debug_volume_tags;PRAGMA graft_debug_volume_snapshot;PRAGMA graft_debug_volume_dump_header;PRAGMA graft_debug_log_lsn;PRAGMA graft_debug_volume_table_log = 'users';PRAGMA graft_debug_volume_json_table_log = 'users';Volume Selection And History
Section titled “Volume Selection And History”这些低层控制会创建、选择、fork 或移动当前打开的 Volume:
PRAGMA graft_debug_volume_new;PRAGMA graft_debug_volume_switch = '<volume>[:<local-log>[:<remote-log>]]';PRAGMA graft_debug_volume_clone = '<remote-log>';PRAGMA graft_debug_volume_fork;PRAGMA graft_debug_volume_checkout_lsn = '12';PRAGMA graft_debug_volume_reset_to = '12';PRAGMA graft_debug_volume_set_message = 'storage commit message';它们操作 storage history,不操作 repository commit 或 branch。
Storage Sync And Audit
Section titled “Storage Sync And Audit”PRAGMA graft_debug_volume_fetch;PRAGMA graft_debug_volume_pull;PRAGMA graft_debug_volume_push;PRAGMA graft_debug_volume_audit;PRAGMA graft_debug_volume_json_audit;PRAGMA graft_debug_volume_hydrate;PRAGMA graft_debug_volume_export = '/tmp/snapshot.sqlite';graft_debug_volume_import 只保留为 deprecated error,并提示改用 SQLite
VACUUM INTO;它不是受支持的 import workflow。
Storage Diff
Section titled “Storage Diff”PRAGMA graft_debug_show_lsn = '<log-ref>';PRAGMA graft_debug_diff_lsn = '<from-log-ref>,<to-log-ref>';PRAGMA graft_debug_volume_dump_commit = '<log-ref>';PRAGMA graft_debug_volume_diff = '2,4';PRAGMA graft_debug_volume_diff = '2,4,rows';PRAGMA graft_debug_volume_json_diff = '2,4,rows';Repository Command Replacement
Section titled “Repository Command Replacement”| 已移除的 SQLite 表面 | 替代方式 |
|---|---|
PRAGMA graft_status | graft status 或 graft status --json |
PRAGMA graft_add | graft add <path> 或 graft add --all |
PRAGMA graft_commit | graft commit -m <message> |
PRAGMA graft_diff | graft diff,可加 --rows 和 --json |
| branch、merge、conflict PRAGMA | graft branch、switch、merge、conflicts、resolve |
| remote 和 sync PRAGMA | graft remote、fetch、pull、push |
这层分离让 SQLite 负责数据库事务,让 Graft repository service 负责版本控制操作。