Page 1 of 1

Looking for server code example for db query to csv file saved and uploaded back to db.

Posted: Thu Jun 12, 2014 12:22 am
by Chris McKenna6917608

Does anyone have an example that would help me create server code that create a csv file from database query, and store the file back into the database.

In a second step, i also want to email either a link or the actual file using SendGrid.


Looking for server code example for db query to csv file saved and uploaded back to db.

Posted: Thu Jun 12, 2014 2:06 am
by Illya Stepanov

Hi Chris,

Please clarify you want to upload back using the Appery.io Database?


Looking for server code example for db query to csv file saved and uploaded back to db.

Posted: Thu Jun 12, 2014 10:08 am
by Chris McKenna6917608

I have a form that collects data and stores in the db. I want to run some server code once a day that runs a query to pull only the new entries for the past 24 hours and creates a CSV file.

Saving the CSV file into the DB is really not necessary thinking about it more.


Looking for server code example for db query to csv file saved and uploaded back to db.

Posted: Thu Jun 12, 2014 3:43 pm
by Evgene Karachevtsev

Hello Chris,

We have some tutorials with using server code: http://devcenter.appery.io/tutorials/...
And comprehensive documentation about server code: http://devcenter.appery.io/documentat...


Looking for server code example for db query to csv file saved and uploaded back to db.

Posted: Thu Jun 12, 2014 3:59 pm
by Chris McKenna6917608

I have been through those..while they are very helpful, they don't answer the questions i have.

I am trying to query the db for records enter on a given date and then format the results in to a CSV file and email those ..

I have examples of:

Doing the query I want
Emailing text to someone using sendgrid

I am missing:
Saving the content from the query to a file in csv format
then Emailing that file.

After typing this.. I realized something. To do the emailing, have to use something like sendgrid, so for the file save part do i need a 3rd party as well ? Like box or Dropbox to store the data as a file to them package up into a email. At that point. I can just share the link of the dropbox file in a email i guess and not worry about actually shipping the file.

Or is there some way in js to create the CSV file and attach it to an email with out ever actually creating the file to disk?

I found a entry on stackoverflow that shows how to do it in python.. so I assume there is some why i could do similar in js.

Thanks in advance for any additional help.


Looking for server code example for db query to csv file saved and uploaded back to db.

Posted: Fri Jun 13, 2014 7:55 am
by Kateryna Grynko

HI Chris,

You can try creating a CSV file this way:
http://www.raymondcamden.com/index.cf...
Then attach it to your email:
https://getsatisfaction.com/apperyio/...
https://sendgrid.com/docs/API_Referen...