denodb
denodb copied to clipboard
[Feature] Support SQL `SELECT DISTINCT`
Currently, there doesn't seem to be a way to select only distinct records from a database.
I believe this should be reasonably easy to implement by simply adding a distinct()
static method to Model
, which would lead to the following api:
const flightDestinations = Flight
.select('destination')
.distinct()
.get();
Which would generate the SQL query:
SELECT DISTINCT destination FROM flights;