Function not_exists

Create NOT EXISTS condition expression.

import { createBuilder, not_exists } from 'coral-sql'

const [sql, bindings] = createBuilder()
.from('users')
.where('id', not_exists(
createBuilder()
.from('orders')
.where('orders.user_id', 'users.id')
))
.toSQL()
// sql: SELECT * FROM `users` WHERE `id` NOT EXISTS (SELECT * FROM `orders` WHERE `orders.user_id` = `users.id`)