yiisoft/db has 215 GitHub stars and 49 forks. Star changes are not measured yet. Last checked 2026-11-14 02:18 UTC. Last push 2026-11-12.
Gemessener Sternzuwachs
- in 24h
- Verlauf wird gesammelt
- in 7 days
- Verlauf wird gesammelt
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
Über uns
Yii Database Library
DatenREADME.md
OriginalYii Database
Framework-agnostic database abstraction layer that provides a set of classes to connect and interact with various database management systems (DBMS) using a unified API, including a powerful query builder.
Available database drivers:
- Yii DB MSSQL
- Yii DB MySQL (also supports MariaDB)
- Yii DB Oracle
- Yii DB PostgreSQL
- Yii DB SQLite
Optional packages that provide additional functionality:
- Yii Active Record provides an object-oriented interface for working with database tables, similar to ORM frameworks such as Doctrine or Hibernate.
- Yii DB Migration allows you to manage database schema using migrations.
Requirements
- PHP 8.1 - 8.5.
pdoPHP extension.
Installation
To install yiisoft/db you must install at least one database driver:
[!TIP] To cache database schema information, install PSR-16 implementation. For example, yiisoft/cache or one of the other cache handlers. It's strongly recommended for production.
General Usage
To connect to a database, create an instance of the appropriate driver:
use Yiisoft\Db\Sqlite\Connection;
use Yiisoft\Db\Sqlite\Driver;
/**
* @var Psr\SimpleCache\CacheInterface $cache
*/
// Creating a database connection
$db = new Connection(
new Driver('sqlite:memory:'),
new SchemaCache($cache),
);
You can then use the $db object to execute SQL queries, manage transactions, and perform other database operations.
Here are some examples:
use Yiisoft\Db\Connection\ConnectionInterface;
/**
* @var ConnectionInterface $db
*/
// Query builder
$rows = $db
->select(['id', 'email'])
->from('{{%user}}')
->where(['last_name' => 'Smith'])
->limit(10)
->all();
// Insert
$db->createCommand()
->insert(
'{{%user}}',
[
'email' => '[email protected]',
'first_name' => 'Mike',
'last_name' => 'Smith',
],
)
->execute();
// Transaction
$db->transaction(
static function (ConnectionInterface $db) {
$db->createCommand()
->update('{{%user}}', ['status' => 'active'], ['id' => 1])
->execute();
$db->createCommand()
->update('{{%profile}}', ['visibility' => 'public'], ['user_id' => 1])
->execute();
}
)
Documentation
- 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.
License
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.
Support the project
Follow updates
Ähnliche Projekte entdecken
Asabeneh/30-Days-Of-Python
Die Programmier-Challenge 30 Days of Python ist eine Schritt-für-Schritt-Anleitung, um die Programmiersprache Python in 30 Tagen zu lernen. Diese Challenge kann mehr als 100 Tage dauern. Gehe in deinem eigenen Tempo vor. Diese Videos können ebenfalls helfen: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,710 Sternegrafana/grafana
Offene und kombinierbare Plattform für Observability und Datenvisualisierung. Visualisiert Metriken, Logs und Traces aus mehreren Quellen wie Prometheus, Loki, Elasticsearch, InfluxDB, Postgres und vielen weiteren.
77,892 Sterneredis/redis
Für Entwickler, die echtzeitfähige, datengesteuerte Anwendungen erstellen, ist Redis der bevorzugte, schnellste und funktionsreichste Cache, Datenstrukturserver und die entsprechende Abfrageengine für Dokumente und Vektoren.
77,490 Sterneapache/superset
Apache Superset ist eine Plattform für Datenvisualisierung und Datenexploration.
75,521 Sterne