db
db copied to clipboard
Yii Database Library
There are two problems when update table using expressions: 1. `Expression::$params` are not passed in the query. 2. If `Expression::$params` have an `ExpressionInterface` inside, it is not processed ```php $values...
Unique indexes can be loaded in 3 different ways: * `Schema::loadTableConstraints(): Constraint[]`
Currently - data returned by ActiveQuery is typed if column name matches table column name. - data returned by Query is mostly untyped. ```sql CREATE TABLE test ( id INTEGER...
https://github.com/yiisoft/active-record/issues/74 `ActiveRecord::upsert()` requires retrieving the primary keys after the query is executed.
### Related PRs ### * yiisoft/db-mysql#303 * yiisoft/db-pgsql#315 * yiisoft/db-sqlite#273 * yiisoft/db-mssql#277 * yiisoft/db-oracle#236 | Q | A | ------------- | --- | Is bugfix? | ❌ | New feature?...
Object Form in `yii\db\Query` conditions introduced in Yii 2.0.14 is really great and timely enhancement! It would be nice although setting its `escapingReplacements` property in a more convenient way, than...
Protected `AbstractCommand::requireTransaction()` method should be `public` or removed. If it will be public possible usage ```php $command->requireTransaction()->execute(); ``` Or if not use `requireTransaction()` ```php $db->transaction(fn () => $command->execute()); ```
Add two options for dropping a table 1. `IF EXISTS` - drop table only if it exists 2. `CASCADE` - drop also dependencies cascade ### Suggestions for `QueryBuilderInterface::dropTable()` ### *...
Need to add a new method `Schema::hasTableName()` to check if the schema has the table name. Also `Schema::hasSchemaName()` and `Schema::hasViewName()`.
There was [a `build()` method defined in Yii2 in `ExpressionBuilderInterface`](https://github.com/yiisoft/yii2/blob/master/framework/db/ExpressionBuilderInterface.php#L27). We have [the interface empty now in yiisoft/db](https://github.com/yiisoft/db/blob/52a6e08fefbd18722efed6364cedc61e01b6e878/src/Expression/ExpressionBuilderInterface.php).