Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!is_object(where))
{
where = { [this.id]: where }
}
if (!where)
{
throw new Error(`No argument supplied for SQL .delete()`)
}
return knex(this.table).where(where).del()
}
}
const knex = Knex(knexfile)
const knex_postgis = knex_postgis_plugin(knex)
knex.postgisDefineExtras(function(knex, formatter)
{
const extras =
{
longitude_latitude(longitude, latitude)
{
return knex.raw('ST_SetSRID(ST_MakePoint(?, ?), 4326)', [longitude, latitude])
}
}
return extras
})
Sql.knex_postgis = () => knex_postgis