定制 primal/query 二次开发

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

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

primal/query

最新稳定版本:v1.0.1

Composer 安装命令:

composer require primal/query

包简介

Chain-able asynchronous query builder for MySQL PDO

README 文档

README

#Primal.Query

Created and Copyright 2012-2013 by Jarvis Badgley, chiper at chipersoft dot com.

Primal.Query is a chain-able asynchronous query builder class which allows for easy construction and execution of complex queries with data escapement.

Primal PHP is a collection of independent PHP micro-libraries.

##Requirements

Primal.Query requires PHP 5.3 (tested under 5.3.10). Use of the built in execution methods (select(), insert(), delete(), etc) requires the PHP Data Objects (PDO) extension be installed and configured.

##Usage

A Query object can be initialized directly via the new operator, but the intended implementation is for initial properties to be chained off of a static initialization method. Example:

$q=Primal\Query\MySQL::Make($pdo) //$pdo contains your PDO link object
   ->from('users','u')
   ->leftJoin("user_billing b USING (user_id)")
   ->orderBy('u.name')
   ->returns('u.id', 'u.name', 'b.start_date')
   ->whereTrue('b.active')
   ->whereDateInRange('b.start_date', new DateTime('yesterday'));
$results = $q->select();

If you wish to run the query yourself instead of using the built in execution functions, the build* functions will return a tuple array containing the query text and an array of all named parameters.

##Documentation

Method documentation is still forthcoming. In the meantime please use the doc comments in the class itself.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-29