Download the PHP package myqee/database without Composer

On this page you can find all versions of the php package myqee/database. 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 database

迈启数据库类库

迈启数据库类库是一个功能强大的数据库类库,可以独立使用,支持自动主从读写分离、支持 MySQL、MongoDB 等常用数据库,除了可以避免数据注入,还可以让你几乎不用写SQL语句就可以实现对数据库的查询、操作等,而且做到了兼容大部分数据库语法的功能,这样你即便需要把MySQL换成MongoDB都不需要改动什么代码,大大增加代码的可移植性。DB 类继承了 QueryBuilder 类,可以实现大部分语句的跨数据库类型的解析。

一个简单的例子:

这个在 MySQL 的驱动里会自动生成这样的SQL语句:

如果是 MongoDB 的话,则会使用 MongoDB 的语法进行查询,类似:

DB::instance($configName = 'default')

获取一个静态已实例化的对象,Database::instance()new Database() 都会返回一个实例化好的Database对象,不同的是,前者不会重复构造,而后者每次都会实例化,推荐使用Database::instance()

$db->get($asObject = false, $useMaster = null)

构造SQL并进行查询,它首先执行compile()方法获得SQL语句,然后用此SQL语句执行query(),是数据库对象中比较常用的一个方法

$db->query($sql, $asObject = false, $useMaster = null)

执行SQL,由于自行拼写的SQL语句会存在一定的安全隐患,所以推荐尽量少用此方法直接执行SQL语句

$db->lastQuery()

返回此数据库对象最后一次执行的SQL语句

$db->update($table = null, $value = null, $where = null)

更新数据

$db->insert($table = null, $value = null)

插入数据,用法基本和update()一样,只是没有where条件

$db->delete($table = null, $where = null)

删除指定条件下的数据

$db->countRecords($table = null, $where = null)

统计指定条件下数目

$db->replace($table = null, $value = null, $where = null)

替换数据,即MySQL的REPLACE INTO,用法同update(),返回作用行数

merge()

replace() 方法的别名

$db->tablePrefix()

返回当前数据库配置表前缀,注意,只有在使用自己定义的$sql时需要注意需要自行加上表前缀,否则使用QueryBuilder构造出的SQL时系统会自动加上表前缀

$db->compile($type = 'select')

构造生成SQL语句并返回

$db->driver()

返回当前驱动对象。目前支持MySQL和MySQLI两种类型

$db->autoUseMaster($autoUseMaster = true)

设置是否一直在主数据库上查询 这样设置后,select会一直停留在主数据库上,直到$this->auto_use_master(false)后才会自动判断

$db->isAutoUseMaster()

返回当前是否一直使用主数据库

DB::parseDsn($dsn)

解析一个类似 mysql://root:123456@localhost:3306/mydb/ 为一个数组配置格式

$db->transaction()

返回一个数据库事务对象,若当前驱动不支持事务则返回一个 false


All versions of database with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 myqee/database contains the following files

Loading the files please wait ....