CSNW / sql-bricks

Transparent, Schemaless SQL Generation
http://csnw.github.io/sql-bricks
MIT License
203 stars 25 forks source link

how can i use `delete` with 'join' #117

Open BugKun opened 4 years ago

BugKun commented 4 years ago

it like this

console.log(
    squel.delete()
    .from('a')
    .target('a')
    .join("b", null, 'a.test_id=b.test_id')
    .where(`b.user_id='1'`)
    .toString()
)
// DELETE a FROM a INNER JOIN b ON (a.test_id=b.test_id) WHERE (b.user_id='1')