承接 davidlienhard/database-query-validator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

davidlienhard/database-query-validator

最新稳定版本:0.4.10

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.

统计信息

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

GitHub 信息

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

其他信息

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