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(7mo ago)09.2k[1 PRs](https://github.com/davidlienhard/database-query-validator/pulls)MITPHPPHP ^8.4CI passing

Since Apr 6Pushed 2w 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 yesterday

READMEChangelog (10)Dependencies (11)Versions (37)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

50

—

FairBetter than 95% of packages

Maintenance83

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 52.3% 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

217d 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 (124 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (113 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

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2603.2M435](/packages/ssch-typo3-rector)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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