Commit Graph

95 Commits

Author SHA1 Message Date
Carsten Brandt
8680f0f1d8 BC way of merging expression params of orderBy and groupBy
this logic should be moved to the sub methods in 2.1
2016-01-28 17:01:16 +01:00
Carsten Brandt
f0a62cdbd3 allow expressions in GROUP BY 2016-01-27 16:53:20 +01:00
Carsten Brandt
468886a77b small refactoring for #9452 2015-12-06 06:04:46 +01:00
Klimov Paul
bea90e1228 Fixed yii\db\Query::where() does not add params from directly passed yii\db\Expression 2015-12-05 12:28:43 +02:00
SilverFire - Dmitry Naumenko
cd87d67f34 Global DOCS update: ~~~ replaced with ``` 2015-12-02 23:15:28 +02:00
Alexander Makarov
1b3770fd21 Use === instead of == where possible 2015-10-10 01:04:35 +03:00
Alexander Makarov
5ab4f0f090 Better quotes usage in strings
- Use single quote where interpolation isn't necessary
- Use interpolation when it's better than concatenation
2015-10-10 00:23:52 +03:00
Carsten Brandt
681db52ba6 refactored SchemaBuilder
- rename class to ColumnSchemaBuilder as this is more appropriate
- changed internal organisation to match how the rest of schema related classes work
  - the ColumnSchemaBuilder is now created the same way as QueryBuilder is
- removed static call magic and method annotations, now real methods are called as they are
- the whole code works on objects in a db context now instead of setting database connection in global state
- trait is now used by Migration by default but can be used in other contexts as well

Migration usage is now as follows:

```php
$this->createTable('example_table', [
  'id' => $this->primaryKey(),
  'name' => $this->string(64)->notNull(),
  'type' => $this->integer()->notNull()->defaultValue(10),
  'description' => $this->text(),
  'rule_name' => $this->string(64),
  'data' => $this->text(),
  'created_at' => $this->datetime()->notNull(),
  'updated_at' => $this->datetime(),
]);
```
2015-08-03 23:25:50 +02:00
Matvey Vasenin
b456f699cc Implemented SchemaBuilder 2015-07-08 15:38:21 +03:00
Alexander Mohorev
ae42a054bb PSR-2 spaces, commas, etc 2015-06-09 00:05:06 +03:00
John Was
57db031d1c Merge branch 'master' into 7374-inserting-ar-without-values 2015-05-24 23:29:40 +02:00
Qiang Xue
5d4780da21 Fixes #8268: Allow QueryBuilder to recognize more variations of limit and offset values 2015-05-05 22:28:50 -04:00
Carsten Brandt
21f51400ef added information about quoting to batch insert 2015-04-27 10:22:56 +02:00
Jan Was
5f099b3f8d Merge branch 'master' into 7374-inserting-ar-without-values 2015-04-21 09:49:46 +02:00
Carsten Brandt
1cfc40d6e5 link to the guide on quoting from query phpdoc
fixes #8141
2015-04-20 23:24:01 +02:00
Carsten Brandt
5306cac4b9 added support for subqueries to simple conditions
fixes #8027
2015-04-12 01:45:21 +02:00
Jan Waś
edf400df96 add missing space 2015-04-11 02:25:26 +02:00
Jan Waś
6e48ed05c7 allow calling Command::insert() without any columns 2015-04-11 02:20:13 +02:00
Qiang Xue
d9117a67b1 Fixes #7227: Query builder should respect column alias setting when yii\db\Expression is being selected 2015-02-14 10:36:19 -05:00
Alexander Makarov
6481d13494 Optimized checks order in conditions 2015-02-08 17:56:36 +03:00
Qiang Xue
84b20d57e4 Fixes #7055: composite IN condition was not generated correctly for certain DBMS 2015-01-31 22:26:51 -05:00
Jan Waś
1e5f159f78 override only mssql and sqlite QueryBuilder; throw an exception for composite in condition with a subquery 2015-01-31 22:20:41 -05:00
Jan Waś
f58d096920 fixes #6792, use a simpler composite in condition implementation on dbs other than pgsql 2015-01-31 22:20:41 -05:00
Carsten Brandt
cc8ffe364e added support for yii\db\Expression to querybuilder BETWEEN and LIKE
fixes #6164
2014-11-23 01:41:15 +01:00
Qiang Xue
5bdf36d9c8 Fixes #5780: QueryBuilder::batchInsert() may cause "undefined index" error 2014-10-26 21:03:03 -04:00
Alexander Mohorev
bb8550886e PHP type casting 2014-10-25 15:30:03 +03:00
Qiang Xue
5829020eff Fixes #5223: Query builder now supports selecting sub-queries as columns 2014-10-19 10:58:49 -04:00
Carsten Brandt
292a9ff55b Add support for yii\db\Expression to QueryBuiler simple conditions
fixes #5601
2014-10-17 13:32:54 +02:00
Qiang Xue
566ed3c594 Fixes #5147: null is not handled correctly for arbitrary operator in SQL. 2014-09-24 08:48:44 -04:00
Qiang Xue
b9c97ff2aa Fixes #4938: When yii\db\ActiveQuery is used to build sub-queries, its WHERE clause is not correctly generated 2014-09-12 16:46:12 -04:00
Qiang Xue
212c5ee3ef Fixes #4254: SqlDataProvider does not work with Oracle and SQL Server 2014-09-03 14:42:09 -04:00
Arthur Khachaturov
7deb26f6c8 Fix PHPDoc 2014-08-24 23:25:08 +04:00
Carsten Brandt
25bf486b7f save some function calls on AR insert 2014-08-12 18:13:49 +02:00
Alexander Makarov
2a8ca600c5 Simplified parameter check for buildSimpleCondition() 2014-08-01 21:21:01 +04:00
Alexander Makarov
b656137541 Added support for arbitrary operators to Query::filterWhere, added support for arbitrary operators to Sphinx extension 2014-08-01 21:11:24 +04:00
Alexander Makarov
c1cf48cf5b Fixes #2315: Any operator now could be used with yii\db\Query::->where() operand format 2014-08-01 11:37:05 +04:00
Carsten Brandt
3a1e0f3a5c property codestyle framework 2014-07-30 00:21:31 +02:00
Alexander Makarov
0edd8bc65a Fixed missing and incorrect phpdoc 2014-07-25 17:26:35 +04:00
Carsten Brandt
8a70d9fbd1 rename column schema typecast method 2014-06-26 00:11:04 +02:00
Carsten Brandt
6a48f68955 split typecast method into two
one method for fetching data and one for sending to db.

fixes #2287
2014-06-26 00:00:37 +02:00
Qiang Xue
ce49416e32 Fixes #3752: QueryBuilder::batchInsert() does not typecast input values 2014-06-09 08:12:08 -04:00
Carsten Brandt
d622442acf improved debugger on handling unreadable files
issue #3494
2014-05-17 14:43:47 +02:00
Qiang Xue
f648d0b1ac Revert "Fixes #3469: Fixed the bug that QueryBuilder::getColumnType() may drop the provided column precision in certain cases"
This reverts commit a46efe79c6.
2014-05-14 11:40:58 -04:00
Qiang Xue
3411504508 Revert "Fixed test break."
This reverts commit 70b57766b1.
2014-05-14 11:40:46 -04:00
Qiang Xue
70b57766b1 Fixed test break. 2014-05-14 11:29:48 -04:00
Qiang Xue
a46efe79c6 Fixes #3469: Fixed the bug that QueryBuilder::getColumnType() may drop the provided column precision in certain cases 2014-05-14 10:28:41 -04:00
Carsten Brandt
5c748ddb42 added case insensitve LIKE to PostgresQueryBuilder
fixes #3252

also improved unit tests for querybuilder buildLikeCondition
2014-04-29 12:04:10 +02:00
Carsten Brandt
91965fd391 phpdoc formatting issues 2014-04-23 02:55:17 +02:00
Qiang Xue
a60d295253 Added support for using sub-queries when building a DB query with IN condition 2014-04-15 20:20:18 -04:00
Qiang Xue
0b29c9607d fixed broken API links [skip ci] 2014-04-09 22:22:49 -04:00