Yii Database is a framework-agnostic package to work with different types of databases, such as MariaDB, MySQL, MSSQL, Oracle, PostgreSQL and SQLite.
Using the package, you can perform common database tasks such as creating, reading, updating, and deleting records in a database table, as well as executing raw SQL queries.
$rows = (new Query($db))
->select(['id', 'email'])
->from('{{%user}}')
->where(['last_name' => 'Smith'])
->limit(10)
->all();
The package is designed to be flexible and can be extended to support extra database types or to customize the way it interacts with databases.
There is an ActiveRecord implementation built on top of it. It allows interacting with database tables using objects, similar to the way you would use ORM (Object-Relational Mapping) frameworks like Doctrine or Hibernate.
- PHP 8.1 or higher.
- Guide: English, Português - Brasil
- Internals
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
The Yii Database is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.