db icon indicating copy to clipboard operation
db copied to clipboard

Allow scalars `int|float|bool` in `Query::select()`

Open Tigrov opened this issue 1 year ago • 1 comments

For some cases a query like SELECT 1 FROM ... required. If allow scalars int|float|bool for columns in Query::select() method, the result could be $query->select(1) => SELECT 1 FROM ... or with alias $query->select(['a' => 1]) => SELECT 1 AS "a" FROM ...

Currently using Query instance it could be done like $query->select(new Expression('1')) or $query->select('(1)')

Tigrov avatar Oct 09 '23 06:10 Tigrov