Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: knex
node v12.22.12
endpoint
share
tweet
const Knex = require('knex'); const knex = Knex({ client: 'pg', }); knex.table('rides').whereRaw('user_id = ? AND completed = ? AND YEAR(created_at) >= ? AND YEAR(created_at) <= ? AND total_cost <=> deposit', ["30fb73d0-9e3d-11e9-bd80-3741ce1df8fb", 1, 2018, 2019]).select('id', 'total_cost', 'driver_id').toSQL();
Created from: https://npm.runkit.com/knex
Loading…
Clone and edit this document