Expand description
Parser 模块 - 解析 DM 数据库 SQL 日志
此模块提供了完整的日志解析功能,包括:
- Record 结构和解析
- 流式读取和解析
- 便捷 API 函数
Structs§
- Record
- 表示一条完整的日志记录(可能包含多行)
- Record
Parser - 从 Reader 中按行读取并解析成 Record 的迭代器
- Sqllog
Parser - 将 RecordParser 转换为 Sqllog 迭代器的适配器
Functions§
- for_
each_ sqllog - 流式解析 Sqllog,对每个解析后的记录调用回调函数
- for_
each_ sqllog_ from_ file - 从文件路径流式解析 Sqllog
- for_
each_ sqllog_ in_ string - 从字符串流式解析 Sqllog,对每个解析后的记录调用回调函数
- iter_
records_ from_ file - 从文件读取并返回 Record 迭代器(流式处理)
- iter_
sqllogs_ from_ file - 从文件读取并返回 Sqllog 迭代器(流式处理)
- parse_
record - 从行数组解析成 Sqllog 结构
- parse_
records_ from_ file - 从文件读取并收集所有 Records 和错误(内存模式)
- parse_
records_ from_ string - 从字符串解析记录
- parse_
sqllogs_ from_ file - 从文件读取并收集所有 Sqllogs 和错误(内存模式)
- parse_
sqllogs_ from_ string - 从字符串直接解析为 Sqllog 列表
- records_
from_ file Deprecated - 已废弃:请使用
iter_records_from_file代替 - sqllogs_
from_ file Deprecated - 已废弃:请使用
iter_sqllogs_from_file代替