Plain SQL support/hack for SELECT and DISTINCT (waterline + sails-mysql)

Entity.find(null, {
    distinct: true,
    select_sql: [{ key: 'names.id IS NOT NULL', as: 'has_name', raw: true }, { key: 'names.firstname', as: 'name' }],
    join_sql: [ 'LEFT JOIN names ON names.id = entity.name_id' ]
 })