Skip to content

Instantly share code, notes, and snippets.

@nomoney4me
Created November 2, 2018 19:10
Show Gist options
  • Select an option

  • Save nomoney4me/dbbd5f00275ece2463625615b4ac4a4b to your computer and use it in GitHub Desktop.

Select an option

Save nomoney4me/dbbd5f00275ece2463625615b4ac4a4b to your computer and use it in GitHub Desktop.
let populateTables = () => {
// return knex('plans').insert({state:'testing'})
return knex.transaction(trx => {
fs.createReadStream('./plans.csv')
.pipe(csv())
.on('data', data => {
return trx.insert(data).into('plans')
})
.on('end', data => {
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment