Skip to content

Instantly share code, notes, and snippets.

@dbauszus-glx
Last active November 30, 2018 15:05
Show Gist options
  • Save dbauszus-glx/8f64d67ba45684e239dc6d6e5ed964b9 to your computer and use it in GitHub Desktop.
Save dbauszus-glx/8f64d67ba45684e239dc6d6e5ed964b9 to your computer and use it in GitHub Desktop.
module.exports = async (layer, table, id) => {
const q = `
DELETE FROM ${table}__mvts
WHERE
ST_Intersects(
tile,
(SELECT ${layer.geom_3857} FROM ${table} WHERE ${layer.qID} = $1)
);`;
await global.pg.dbs[layer.dbs](q, [id]);
return;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment