Go 错误聚合实战指南:深入 go.uber.org/multierr 的 Combine、Append 与 defer 安全合并
2026/9/24 23:58:57
RTA API 中只有六个子程序,它们的返回值通常为以下几种:
/* successfully executed request or command */ #define RTA_SUCCESS (0) /* input did not have a full command */ #define RTA_NOCMD (1) /* encountered an internal error */ #define RTA_ERROR (2) /* DB client requests a session close */ #define RTA_CLOSE (3) /* Insufficient output buffer space */ #define RTA_NOBUF (4)各子程序的功能总结如下表:
| 子程序 | 描述 |
| ---- | ---- |
| dbcommand() | 提供与 PostgreSQL 客户端的接口 |
| rta_add_table() | 向 RTA 数据库添加表及其列 |
| SQL_string() | 在 RTA 数据库中执行 SQL 语句 |
| rta_config_dir() | 设置保存文件目录的默认路径 |
| rta_save() | 将表保存到文件 |
| rta_load() | 从文件加载表 |