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(1y ago)09PHPPHP &gt;=8.3

Since May 15Pushed 1y 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 1mo ago

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

28

—

LowBetter than 54% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

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

723d 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

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M343](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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