examples

command
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package main 演示如何在外部程序中使用 advisorTool/services 包 这个示例展示了 services 包现在可以被任何外部程序引用,不会再出现 "use of internal package not allowed" 错误

Package main demonstrates using advisorTool as a Go library with all rules supported by the engine. This example shows how to load all rules for a specific database engine (common + engine-specific rules).

使用方式:

  1. 不连接数据库(只测试不需要元数据的规则): go run library_usage_all_rules.go -engine mysql

  2. 连接数据库(测试所有规则,包括需要元数据的规则): go run library_usage_all_rules.go -engine mysql -host 127.0.0.1 -port 3306 -user root -password root -dbname mydata go run library_usage_all_rules.go -engine postgres -host 127.0.0.1 -port 5432 -user postgres -password secret -dbname mydb

Package main demonstrates basic usage of advisorTool as a Go library.

Package main demonstrates using advisorTool rules with payload configuration.

Package main 演示如何在外部程序中使用 advisorTool/services 包进行 PostgreSQL SQL 审核 本示例连接到真实的 PostgreSQL 数据库,获取元数据进行全面审核

简化的测试程序,用于验证库的外部使用

Package main 演示影响行数计算功能的测试

Package main 演示 PostgreSQL schema search_path 功能

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL