定制 davidlienhard/database-query-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

davidlienhard/database-query-validator

Composer 安装命令:

composer require davidlienhard/database-query-validator

包简介

🐘 php tool to validate database queries

README 文档

README

🐘 php tool to validate database queries written using davidlienhard/database

Latest Stable Version Source Code Software License Minimum PHP Version CI Status

Configuration

This tool requires a file named query-validator.json in your main project directory. CLI arguments are not supported at the moment. The following configuration options are possible:

  • paths (array): list of paths (folders or files) to scan.
  • exclusions (array): list of paths to exclude from the scans
  • dumpfile (string): path to a mysql dump file to use for type-checks
  • parameters (object):
    • ignoresyntax (bool): whether or not to ignore syntax-errors in the queries
    • strictinserts (bool): checks if inserts contains all text-colums of table that are set to not null
    • strictinsertsignoremissingtablenames (bool): whether to ignore queries where the tablename could not be extracted on strict imports

All paths are relative to the path of the configuration file. If no configuration file can be found all the files in your currect folder will be scanned.

Example Configuration-File

JSON

{
    "paths": [
        "src"
    ],
    "exclusions": [
        "**/exclude.php"
    ],
    "dumpfile": "dump.sql",
    "parameters": {
        "ignoresyntax": false,
        "strictinserts": false
    }
}

YAML

paths:
  - src
exclusions:
  - "**/exclude.php"
dumpfile: dump.sql
parameters:
  ignoresyntax: false
  strictinserts: false

Todo

This project is still work in progress and there is a lot of work todo.

  • improve validation of queries
  • improve documentation (of course)
  • add unit tests
  • improve recognition of database-queries
  • improve config
    • add support of CLI arguments

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 9.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固