10/16/2023 0 Comments Bluebird app not woking![]() a blog post, and returning a HttpNotFoundResult if the blog post was null. The first issue was that in a number of my action methods, I was checking for the existence of an object e.g. This was caused partly due to my misunderstanding of how custom errors are actually invoked and also the fact that (IMHO), the handling of errors in asp.net mvc is a bit messed up. Note that the only thing I changed: using library csv-parse instead of csv, as a better alternative.Īdded use of method stream.read from the spex library, which properly serves a Readable stream for use with promises. Return .call(t, rs.pipe(csv()), receiver) const fs = require('fs') Ĭonst pgp = require('pg-promise')() Ĭonst cn = rs = fs.createReadStream('primes.csv') Find below a complete application that correctly executes the same kind of task as you want: It reads a file as a stream, parses it as a CSV and inserts each row into the database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |