PHPackages                             davidlienhard/database-query-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. davidlienhard/database-query-validator

ActiveLibrary[Database &amp; ORM](/categories/database)

davidlienhard/database-query-validator
======================================

🐘 php tool to validate database queries

0.4.10(5mo ago)08.8k[2 PRs](https://github.com/davidlienhard/database-query-validator/pulls)MITPHPPHP ^8.4

Since Apr 6Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/davidlienhard/database-query-validator)[ Packagist](https://packagist.org/packages/davidlienhard/database-query-validator)[ Docs](https://github.com/davidlienhard/database-query-validator/)[ RSS](/packages/davidlienhard-database-query-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (31)Used By (0)

davidlienhard/database-query-validator
======================================

[](#davidlienharddatabase-query-validator)

🐘 php tool to validate database queries written using [`davidlienhard/database`](https://github.com/davidlienhard/database)

[![Latest Stable Version](https://camo.githubusercontent.com/da0c44fe820d9f5d846bdad91bcb72b252529b140ad70a2824069e1329af4231/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64617669646c69656e686172642f64617461626173652d71756572792d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/davidlienhard/database-query-validator)[![Source Code](https://camo.githubusercontent.com/4bfc71ba32f5bfc645b4e6e0bc67147e67e7eaa2815c42ce79e7af964c8c7fa2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d64617669646c69656e686172642f64617461626173652d2d71756572792d2d76616c696461746f722d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/davidlienhard/database-query-validator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/davidlienhard/database-query-validator/blob/master/LICENSE)[![Minimum PHP Version](https://camo.githubusercontent.com/7f91fd16f805b376c8b9137ddc479aabdc9f79d19807832f85606cb3b74409c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![CI Status](https://github.com/davidlienhard/database-query-validator/actions/workflows/check.yml/badge.svg)](https://github.com/davidlienhard/database-query-validator/actions/workflows/check.yml)

Configuration
-------------

[](#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

[](#example-configuration-file)

#### JSON

[](#json)

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

#### YAML

[](#yaml)

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

Todo
----

[](#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
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](https://github.com/davidlienhard/httpclient/blob/master/LICENSE) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance71

Regular maintenance activity

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 51.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~283 days

Total

28

Last Release

171d ago

PHP version history (2 changes)0.0.1PHP ^8.0

0.4.10PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43143441?v=4)[David Lienhard](/maintainers/davidlienhard)[@davidlienhard](https://github.com/davidlienhard)

---

Top Contributors

[![davidlienhard](https://avatars.githubusercontent.com/u/43143441?v=4)](https://github.com/davidlienhard "davidlienhard (121 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (112 commits)")

---

Tags

databaselibrarymysqlphpphpdatabaselibrarymysql

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/davidlienhard-database-query-validator/health.svg)

```
[![Health](https://phpackages.com/badges/davidlienhard-database-query-validator/health.svg)](https://phpackages.com/packages/davidlienhard-database-query-validator)
```

###  Alternatives

[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[codezero/laravel-unique-translation

Check if a translated value in a JSON column is unique in the database.

186965.1k7](/packages/codezero-laravel-unique-translation)[stefangabos/zebra_database

An advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

11812.0k](/packages/stefangabos-zebra-database)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
