定制 siriusphp/sql 二次开发

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

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

siriusphp/sql

Composer 安装命令:

composer require siriusphp/sql

包简介

Flexible query building library for PDO connections with a small API surface and auto-complete support (low cognitive load). Requires an atlas/pdo connection.

README 文档

README

Source Code Latest Version Software License Build Status Coverage Status Quality Score

The siriusphp/sql library is designed to help you build and execute SQL simple and complex queries in a fast and safe way.

The vocabulary is as close to SQL as possible as you may see from the example below:

use Atlas\Pdo\Connection;
use Sirius\Sql\Select;
use Sirius\Sql\ConditionsEnum;

$connection = Connection::new('sqlite::memory:');
$select = new Select($connection);

// find the 10 "cool" posts that are published and also retrieve the comments count
$select->distinct()
    ->columns('posts.*', 'COUNT(comments.id) AS comments_count')
    ->from('posts')
    ->join('LEFT', 'comments', 'comments.commentable_id = posts.id AND comments.commentable_type = %s', 'posts')
    ->where('posts.published_at < NOW()')
    ->where('posts.title', 'cool', ConditionsEnum::CONTAINS)
    ->groupBy('posts.id')
    ->limit(10);

$posts = $select->fectchAll();

Links

Acknowledgements

This library is a derivative work of atlas/query. I made this library for 2 reasons:

  • to reduce cognitive load by removing some methods and implementing other ways to achieve the same goals (eg: nested conditions)
  • to optimize some operations for the most common scenarios (eg: where($column, $str, 'does_not_contain') vs where($column . ' LIKE ', '%' . $str . '%')

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固