nette / database

💾 A database layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.
https://doc.nette.org/database
Other
512 stars 108 forks source link

Union Selections #300

Open MartinPetricko opened 1 year ago

MartinPetricko commented 1 year ago

Hey, recently I noticed that there is no option for union selections with nette database explorer. Only way to use unions that I found is to write raw queries which is not very convenient.

I would like to propose syntax that may look something like this:

$loremSelection = $explorer->table('lorem')->select('field')->where(...)->order(...)->limit(...);
$ipsumSelection = $explorer->table('ipsum')->select('another_field AS field')->where(...);

$result = $explorer->union($loremSelection, $ipsumSelection)->where(...)->order(...)->limit(...)->fetchAll();

Is there a possibility that this feature would be added to nettes database explorer?