PHPackages                             corncodecreators/sql-normalizer - 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. corncodecreators/sql-normalizer

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

corncodecreators/sql-normalizer
===============================

Adapting SQL-strings to the best feasible standard.

v1.1.4(8mo ago)06MITPHPPHP &gt;=8.0

Since Aug 2Pushed 8mo agoCompare

[ Source](https://github.com/CornCodeCreators/SqlNormalizer)[ Packagist](https://packagist.org/packages/corncodecreators/sql-normalizer)[ RSS](/packages/corncodecreators-sql-normalizer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

SqlNormalizer
=============

[](#sqlnormalizer)

> A tool to standardize and improve your SQL strings.

Background
----------

[](#background)

SQL files are often created under time constraints, leading to inconsistencies and errors in their structure. Over time, these issues can become problematic, especially when stricter syntax is required due to changes in database management systems or as part of optimizing your codebase.

Having consistently well-structured SQL is important for maintaining a reliable and maintainable codebase. `SqlNormalizer` aims to address this by providing a way to adapt and standardize SQL strings effectively.

Solution
--------

[](#solution)

`SqlNormalizer` works by analyzing the SQL strings you provide and automatically adjusting them to meet modern SQL standards. The tool corrects syntax issues, applies consistent formatting, and ensures that your SQL code follows best practices.

This can be particularly useful when dealing with legacy SQL files or when ensuring that new queries are up to standard.

### Features

[](#features)

- **Syntax Correction:** Fixes common syntax errors to ensure compatibility with modern SQL.
- **Consistent Formatting:** Applies a uniform format to your SQL files, making them easier to read and maintain.
- **Best Practices:** Implements recommended practices to improve the performance and reliability of your SQL code.
- **Custom Rules:** Allows customization of formatting and syntax rules to fit your specific project needs.

Installation
------------

[](#installation)

```
$ composer require corncodecreators/sql-normalizer
```

Usage
-----

[](#usage)

`SqlNormalizer` provides static functions that is transforming the SQL string and returns a sanitized and normalized SQL string.

Example:

```
use CornCodeCreators\SqlNormalizer\Statement\AlterTable;

$sql           = "...";
$sqlNormalized =  AlterTable::addPrimaryKey_sanitizeColumnName($sql);
```

Contribution
------------

[](#contribution)

`SqlNormalizer` is an open-source project in its early stages. Updates and improvements will be made as needed. As the tool develops, contributions from the community are welcome. Whether you have ideas for new features, improvements, or bug fixes, your help is appreciated.

### How to Contribute

[](#how-to-contribute)

- **Report Issues:** If you encounter any bugs or have suggestions, you can open an issue on our GitHub repository.
- **Submit Pull Requests:** If you have code changes or new features to contribute, feel free to submit a pull request.
- **Provide Feedback:** Any feedback on usability, functionality, or any other aspect of the tool is welcome.

We encourage collaboration and look forward to building a useful tool with the community's help.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance61

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~81 days

Recently: every ~101 days

Total

6

Last Release

248d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

v1.1.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e01bad6c4c81d29bb9909f13aeefe042a5253b5f9c3a0f1f6b1029721332b427?d=identicon)[DigitalTimK](/maintainers/DigitalTimK)

---

Top Contributors

[![DigitalTimK](https://avatars.githubusercontent.com/u/45600940?v=4)](https://github.com/DigitalTimK "DigitalTimK (19 commits)")

---

Tags

mariadbmysqlnormalizephpsanitizesqlphpnormalizermysqlmariadbsqlsanitizerstandard

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/corncodecreators-sql-normalizer/health.svg)

```
[![Health](https://phpackages.com/badges/corncodecreators-sql-normalizer/health.svg)](https://phpackages.com/packages/corncodecreators-sql-normalizer)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[druidfi/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

35489.8k6](/packages/druidfi-mysqldump-php)

PHPackages © 2026

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