PHPackages                             aareon-france/sql-attributes-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. aareon-france/sql-attributes-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

aareon-france/sql-attributes-parser
===================================

Parser of SQL attributes, which offers the ability to add metadata on SQL queries.

1.0.1(2y ago)09PHPPHP &gt;=8.3

Since May 15Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Aareon-France/sql-attributes-parser)[ Packagist](https://packagist.org/packages/aareon-france/sql-attributes-parser)[ RSS](/packages/aareon-france-sql-attributes-parser/feed)WikiDiscussions develop Synced today

READMEChangelog (2)Dependencies (10)Versions (4)Used By (0)

 [![Logo of the project SqlAttributeParser](assets/logo.png)](assets/logo.png)

==================================================================================

[](#--------)

 This repository provides a way to parse **SQL attributes**, which offers the ability to add metadata on SQL queries.

---

Table of contents
-----------------

[](#table-of-contents)

- [SQL attributes syntax](#sql-attributes-syntax)
- [Installation](#installation)

SQL attributes syntax
---------------------

[](#sql-attributes-syntax)

This parser will allow you to parse SQL attributes that are attached to any SQL statement or expression into an SQL query. SQL attributes are unofficial ways to add some metadata on SQL statements and expressions in order to apply specific behaviors or automated processes regarding the SQL query the attributes are attached on. In this way, they acts like PHP Attributes.

### Examples

[](#examples)

Attributes are applicable on statements:

```
#[StatementAttribute]
CREATE TABLE `myTable`…
```

They are also applicable on expressions:

```
SELECT
    #[ExprAttribute]
    `myField`
FROM `myTable`;
```

Attributes can own arguments to vary the specific behaviors the processors of those attributes may have:

```
#[Since(version: 8.0.5, dbms_list: 'mysql,pgsql,oracle')]
```

The arguments are mandatory to be named, and their values are always interpreted as strings. To allow characters separators like `:` or `,` in your values, you must wrap the value of your argument with simple quotes (`'`) or double quotes (`"`).

### SQL Attribute definition

[](#sql-attribute-definition)

The EBNF for the syntax of attributes is:

```
attribute           = "#[", attribute-name, [ attribute-arguments ], "]";
attribute-name      = uppercase-letter, { letter / digit };
attribute-arguments = "(", { attribute-argument, ",{[ ]}" }, ")";
attribute-argument  = {letter / digit / "_" / "-"}, ":{[ ]}", ["'" / '"'], STRING, ["'" / '"'];
uppercase-letter    = "A" .. "Z";
lowercase-letter    = "a" .. "z";
letter              = [uppercase-letter / lowercase-letter]
digit               = "0" .. "9";
```

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

[](#installation)

Via composer, you can add the repository in your composer.json by doing:

```
composer require aareon-france/sql-attributes-parser
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.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 ~0 days

Total

2

Last Release

777d ago

### Community

Maintainers

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

---

Top Contributors

[![niconoe-](https://avatars.githubusercontent.com/u/9560327?v=4)](https://github.com/niconoe- "niconoe- (5 commits)")[![Tithugues](https://avatars.githubusercontent.com/u/1165150?v=4)](https://github.com/Tithugues "Tithugues (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aareon-france-sql-attributes-parser/health.svg)

```
[![Health](https://phpackages.com/badges/aareon-france-sql-attributes-parser/health.svg)](https://phpackages.com/packages/aareon-france-sql-attributes-parser)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M45](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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