Download the PHP package lite-view/sql without Composer
On this page you can find all versions of the php package lite-view/sql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package sql
LiteView SQL
轻量级 PHP SQL 查询构建器和 CRUD 库,支持参数化查询防止 SQL 注入。
安装
配置
方式一:静态配置
方式二:常量配置
基本用法
插入数据
查询数据
更新数据
删除数据
更新或插入
高级用法
分页查询
JOIN 查询
排序与分组
事务
原生 SQL
调试 SQL
API 参考
Crud 类
| 方法 | 说明 |
|---|---|
db($key = 'mysql') |
获取 CRUD 实例 |
insert($table, $data, $ignore = false) |
插入数据,返回最后插入 ID |
insertAll($table, $data, $needLastInsertId = true) |
批量插入 |
select($table, $condition, $field = '*', $prep = []) |
查询,返回 Fetch 实例 |
update($table, $data, $condition, $prep = []) |
更新,返回影响行数 |
delete($table, $condition, $prep = []) |
删除,返回影响行数 |
updateOrInsert($table, $index, $values = []) |
更新或插入 |
Fetch 类
| 方法 | 说明 |
|---|---|
one() |
获取单条记录 |
all($limit = null) |
获取列表 |
column($column = 0) |
获取单个值 |
paginate($limit, $pageName, $page) |
分页查询 |
join($tables) |
JOIN 查询 |
order($field, $way) |
排序 |
group($field) |
分组 |
having($condition) |
HAVING 条件 |
for_update() |
悲观锁 |
getRawStatement($format) |
获取原始 SQL |
License
MIT
All versions of sql with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.2
ext-pdo Version *
ext-pdo Version *
The package lite-view/sql contains the following files
Loading the files please wait ...