Download the PHP package lipowei/db without Composer

On this page you can find all versions of the php package lipowei/db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db

php mysql 防SQL注入预处理封装库

版本支持

php5.6、7.*

安装

composer require tcwei/db

使用(支持分布式读写分离,可自动保存配置,无需初始化)

引入 vendor 目录下的 autoload.php

手册

::transaction($callback, $errorCallback = null)

::table($tableString, $transform = true)

JOIN表相关

->where($where, $conditionOrValue = null, $value = null)

->whereOr($where, $conditionOrValue = null, $value = null)

->likeConcat($field, $concat, $concatValue = [])

->limit($start = 1, $length = null)

order($field, $rank = 'ASC')

->group($group)

->hvaing($hvaing)

->noQuery()

->insert($array, $columns = [], $filter = false, $type = null)

->insertAll($array, $columns = [], $filter = false, $type = null)

::$insertId

->delete($all = false, $type = null)

->update($array, $columns = [], $filter = false, $all = false, $type = null)

->select($field = '*', $more = true)

->find($field = '*')

->value($field)

->column($field, $key=false)

->count()

->sum($field)

->avg($field)

->max($field)

->min($field)

::$sqlStr

多数据库分布式

如果都是可读可写的,将信息写在host系列里面去即可,如:

读写分离

某些环境需要直接从写库(主库)中读取数据,如刚进行写操作(插入或更新)时,读库(从库)数据还没同步完成,你可以使用->master(),如:

如果你嫌麻烦,可以配置一个参数:如果某表进行了写操作,本次请求的后续查询操作都会强制使用主库进行查询。

额外说明

该库使用的是 mysqli 模式;
这里说说 mysqliPDO 重要区别。
兼容:mysqli 仅支持 mysql 数据库,PDO 支持大部分数据库,PDO完胜;
性能:本人在 PHP7.3.5 + MYSQL5.7.25 环境测试下:
都是使用预处理模式操作最基本的insert和select,每次循环500次,运行10次计算数据平均值得出结果:
insert下,mysqli 仅比 PDO 快1.59%,基本可忽略。
select下,mysqli 比 PDO 快18.84%
由于PDO要兼容大部分数据库,所以性能上是不及mysqli的
若你的项目是仅使用 mysql 的同时追求毫秒级别的性能优化,那么 mysqli 模式或许更合适你


All versions of db with dependencies

PHP Build Version
Package Version
Requires tcwei/config Version ^2.0
php Version >=5.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lipowei/db contains the following files

Loading the files please wait ....