定制 elshafey/doctrine-window-functions 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

elshafey/doctrine-window-functions

最新稳定版本:0.0.2

Composer 安装命令:

composer require elshafey/doctrine-window-functions

包简介

PHP Doctrine Extension that add window functions functionality

README 文档

README

Window functions extension is an extension that enable you to use SQL window functions easily inside doctrine.

Installation

composer require elshafey/doctrine-window-functions

How To Use

// configure the extension first
$entityManager->getConfiguration()->addCustomStringFunction(
    'WINDOW',
    \Elshafey\DoctrineExtensions\WindowFunctions\Query\Mysql\Window::class
);

// use your window function formula
$q=$entityManager->createQueryBuilder()
->select('p')
->addSelect('WINDOW(ROW_NUMBER()) OVER(PARTITION BY p.name) as rowNumber')
->from('\Entities\Product','p')->getQuery();

Important Hint

Take care while using this extension and don't miss to wrap your window function by WINDOW(). Examples:

  • WINDOW(COUNT(*)) OVER(PARTITION BY e.columnNamw)
  • WINDOW(ROW_NUMBER()) OVER(PARTITION BY e.columnNamw)

Extension Compatibility

Currently this extension is tested and works fine with MYSQL8. Other platforms like Oracle, or MS-SQL Server is not tested.

Missed Functionalities

The extension doesn't support yet [frame_clause]

TODO

Add the capability of [frame_clause]

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-09-19