import { Database } from '@adonisjs/lucid/database';
Database.macro('distance', function (from, to, distance) {
    return this.knexRawQuery(`6371 * 2 * ASIN(SQRT(
        POWER(SIN((RADIANS(${from.latitude}) - RADIANS(${to.latitude})) / 2), 2) +
        COS(RADIANS(${from.latitude})) * COS(RADIANS(${to.latitude})) *
        POWER(SIN((RADIANS(${from.longitude}) - RADIANS(${to.longitude})) / 2), 2)
    )) <= ${distance / 1000}`);
});
//# sourceMappingURL=lucid_macros.js.map