Files
MyGoNavi/internal/app/sql_audit_atomic_replace_other.go
Syngnat 7c8e8d8dd3 feat(sql-audit): 新增 SQL 审计中心并完善事务追踪
- 新增脱敏审计存储、筛选、保留策略、完整性校验与 JSON/CSV 导出
- 覆盖查询编辑器、事务、导入同步、对象操作、AI/MCP 与 Web 运行时入口
- 完善事务完整语句日志、Windows 快捷键映射及 SQL 分析布局
- 补充多语言、健康状态、数据目录迁移和回归测试
2026-07-12 15:24:27 +08:00

21 lines
349 B
Go

//go:build !windows
package app
import (
"errors"
"os"
"path/filepath"
)
func atomicReplaceSQLAuditFile(source, target string) error {
if err := os.Rename(source, target); err != nil {
return err
}
directory, err := os.Open(filepath.Dir(target))
if err != nil {
return err
}
return errors.Join(directory.Sync(), directory.Close())
}