Yii Database

Fund package maintenance!
Open Collective

Installs: 239 639

Dependents: 22

Suggesters: 1

Security: 0

Stars: 123

Watchers: 27

Forks: 34

Open Issues: 54

1.2.0 2023-11-12 15:51 UTC



Yii Database

Yii Database is a framework-agnostic package to work with different types of databases, such as MariaDB, MSSQL, MySQL, 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'])  
    ->where(['last_name' => 'Smith'])  

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.

Latest Stable Version Total Downloads Build status codecov static analysis type-coverage


Check the documentation to learn about usage.


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.


Check the testing instructions to learn about testing.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack


The Yii DataBase Library is free software. It's released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.