Gaudit

gAudit是一个SQL语法审核工具,支持MySQL/TiDB,通过解析SQL语法树实现自定义规则审
Alternatives To Gaudit
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Tidb33,7216810115 hours ago1,289April 07, 20223,877apache-2.0Go
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial
Xorm6,5785903073 years ago51October 02, 2019308bsd-3-clauseGo
Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
Bytebase5,171
19 hours ago5June 09, 202220otherGo
Database CI/CD for DevOps teams. https://www.bytebase.com
Screw3,0501a month ago6August 18, 202058lgpl-3.0Java
简洁好用的数据库表结构文档生成器
Gaea2,394
2 months ago16April 06, 202259apache-2.0Go
Gaea is a mysql proxy, it's developed by xiaomi b2c-dev team.
Mydumper1,932
a day ago28gpl-3.0C
Official MyDumper project
Xorm1,4515392 years ago1October 31, 201828bsd-3-clauseGo
xorm是一个简单而强大的Go语言ORM库,通过它可以使数据库操作非常简便。本库是基于原版xorm的定制增强版本,为xorm提供类似ibatis的配置文件及动态SQL支持,支持AcitveRecord操作
Goinception1,397
11 days ago11June 12, 202223gpl-3.0Go
一个集审核、执行、备份及生成回滚语句于一身的MySQL运维工具
Waline1,3811a day ago148June 18, 202235gpl-2.0JavaScript
💬 A Simple, Safe Comment System
Sqlancer1,192
a day ago4January 12, 202255mitJava
Automated testing to find logic bugs in database systems
Alternatives To Gaudit
Select To Compare


Alternative Project Comparisons
Readme

gAudit

GO Download License

gAuditgolangSQLMySQL/TiDBSQL

8081

API
http://127.0.0.1:8081/api/v1/audit POST DDL/DMLSQL
http://127.0.0.1:8081/api/v1/extract-tables POST DDL/DMLSQL

POST

curl --request POST '127.0.0.1:8081/api/v1/audit' \
--header 'Content-Type: application/json' \
--data '{
    "db_user": "gaudit_rw",
    "db_password": "1234.com",
    "db_host": "127.0.0.1",
    "db_port": 3306,
    "db": "dbms_monitor",
    "timeout": 3000,
    "custom_audit_parameters": {"MAX_VARCHAR_LENGTH": 2000},
    "sqltext": "alter table slamonitor modify `address` varchar(16554) NOT NULL DEFAULT '\'''\'' COMMENT '\'''\''"
}
' | jq
  • db_user:
  • db_password:
  • db_host:
  • db_port:
  • db: db
  • timeout: ms
  • custom_audit_parameters: : `` > template/config.json > `config/config.go`
  • sqltext: SQLSQLSQL;

{
    "request_id": "0a2392e4-ee3f-4f9c-9da1-3906ae4521c9",
    "code": "0000",
    "data": [
        {
            "summary": [
                "`host`varchar2000,varchar16554[`slamonitor`]"
            ],
            "level": "WARN",
            "affected_rows": 0,
            "type": "DDL",
            "finger_id": "4B3E7A0DCAE81036",
            "query": "alter table slamonitor modify `host` varchar(16554) NOT NULL DEFAULT '' COMMENT ''"
        }
    ],
    "message": "success"
}

DML/DDLunion

POST

curl --location --request POST '127.0.0.1:8081/api/v1/extract-tables' \
--header 'Content-Type: application/json' \
--data '{
    "sqltext": "alter table t1 add name varchar(100);select * from (select id,name from tt1 join tt2 on tt1.id=tt2.id where tt1.id > 100) as xx;UPDATE product p, product_price pp SET pp.price = p.price * 0.8 WHERE p.productid= pp.productId;"
}' | jq .

{
  "request_id": "cb9e5249-c77c-4320-bbfb-9fe0a9391da7",
  "code": "0000",
  "data": [
    {
      "tables": [
        "t1"
      ],
      "type": "ALTER TABLE",
      "query": "alter table t1 add name varchar(100);"
    },
    {
      "tables": [
        "tt1",
        "tt2"
      ],
      "type": "SELECT",
      "query": "select * from (select id,name from tt1 join tt2 on tt1.id=tt2.id where tt1.id > 100) as xx;"
    },
    {
      "tables": [
        "product",
        "product_price"
      ],
      "type": "UPDATE",
      "query": "UPDATE product p, product_price pp SET pp.price = p.price * 0.8 WHERE p.productid= pp.productId;"
    }
  ],
  "message": "success"
}

Python

template/python_api.py

Popular Mysql Projects
Popular Tidb Projects
Popular Data Storage Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Golang
Go
Mysql
Tidb