aareon-france/sql-attributes-parser 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aareon-france/sql-attributes-parser

最新稳定版本:1.0.1

Composer 安装命令:

composer require aareon-france/sql-attributes-parser

包简介

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

README 文档

README


Logo of the project SqlAttributeParser

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

Table of contents

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

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

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

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

composer require aareon-france/sql-attributes-parser

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-05-15