Download the PHP package montyhusor/pqbuilder without Composer
On this page you can find all versions of the php package montyhusor/pqbuilder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download montyhusor/pqbuilder
More information about montyhusor/pqbuilder
Files in montyhusor/pqbuilder
Download montyhusor/pqbuilder
More information about montyhusor/pqbuilder
Files in montyhusor/pqbuilder
Vendor montyhusor
Package pqbuilder
Short Description A simple PHP query builder for MySQL, aimed at simplifying database interactions in web development
License MIT
Package pqbuilder
Short Description A simple PHP query builder for MySQL, aimed at simplifying database interactions in web development
License MIT
Please rate this library. Is it a good library?
Informations about the package pqbuilder
PQbuilder
PQbuilder 是一个为MySQL设计的PHP查询构建库,使开发者能够以链式调用的方式构建SQL查询。 PQbuilder is a PHP query builder library designed for MySQL, enabling developers to construct the SQL queries through chainable method calls.
主要特性
- 基础CRUD操作 - Basic CRUD Operations:支持SELECT、INSERT、UPDATE、DELETE查询。- Supports SELECT, INSERT, UPDATE and DELETE queries.
- 链式调用 - Chainable Calls:支持链式调用。- Supports chainable calls.
- 自动参数绑定 - Automatic Parameter Binding:减少SQL注入的风险。- Reduces the risk of SQL injection.
- 条件构建 - Condition Building:支持
IN
语句、嵌套逻辑和复杂条件构建。- SupportsIN
statements, nested logic, and the construction of complex conditions. - 事务处理 - Transaction Management:有事务开始、提交和回滚的方法。- Includes methods for starting transactions, committing, and rolling back.
- 数据抓取方法 - Data Fetching Methods:提供
qfetchAll
、qfetchF
、qfetchColumn
、qfetchObject
方法。- ProvidesqfetchAll
,qfetchF
,qfetchColumn
andqfetchObject
. methods.
安装 - Installation
通过Composer进行安装:
示例 - Examples
插入 - INSERT
更新 - UPDATE
删除 - DELETE
查询 - SELECT
使用pa()
和endPa()
进行嵌套逻辑的查询 - Using pa()
and endPa()
for Nested Logic Queries
使用qfetchObject
获取记录作为对象 - Using qfetchObject to Fetch Records as Objects
定义Book类:
获取Book对象:
使用groupBy()
, orderBy()
, having()
, limit()
- Using groupBy()
, orderBy()
, having()
, limit()
注意事项 - Considerations
- 在构建DELETE和UPDATE查询时,请确保不在没有明确条件的情况下直接使用
pa()
和endPa()
,以防止执行无条件的全表操作并导致数据丢失。 - 当开始一个新的逻辑组合时,使用的第一个
where()
和orWhere()
方法都会产生相同的效果。因此,在开始新的逻辑组合时直接使用where就行。 - 类似地,对于
pa()
方法,当你开始一个新的条件组合时,无论是pa()
还是pa("OR")
,如果它是第一个使用的,那么效果是相同的,因为它标志着一个新的逻辑分支的开始。 - 请注意,虽然
PQbuilder
旨在简化SQL查询构建过程,并提供了基础的CRUD操作及一些高级功能,但它并不覆盖所有的SQL查询操作以及一些更复杂的数据库操作,PQbuilder
还有待完善。
- When building DELETE and UPDATE queries, please ensure not to directly use
pa()
andendPa()
without specific conditions, to prevent executing unconditional full-table operations and causing data loss.- When initiating a new logical grouping, the first use of
where()
andorWhere()
methods will produce the same effect. Therefore, it is sufficient to directly usewhere
when starting a new logical combination.- Please note that while
PQbuilder
is designed to simplify the SQL query building process, offering basic CRUD operations and some advanced features, it does not cover all SQL query operations or some of the more complex database interactions.PQbuilder
is still a work in progress.
All versions of pqbuilder with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2.4
The package montyhusor/pqbuilder contains the following files
Loading the files please wait ....