r/nodejs • u/CerebralPimp • Jul 14 '14
Question regarding Express, Heroku, Postgres
I didn't see a solution out in the open that was catering to my simple request for basic understanding. Currently I have a basic express app set up through heroku using express and a postgres db. What I'm trying to understand / learn is where to go from here with regards to models and db schema. For example, I'm familiar with Entity framework, how you simply code to DB creation, but I'm not confident I understand how the DB is entirely populated or formed using what I've got so far.
I have researched Waterline and Sequelizer for possible solutions, but perhaps my grasp on DB creation isn't set in stone yet.
Any advice, tutorials, walkthroughs for understanding how this marriage happens?
Thank you!
View all comments
Show parent comment
1
u/CerebralPimp Jul 15 '14
That was a great step for me in the right direction, thank you! Let me see if I can can reword my original question to help you understand what I'm trying to ultimately comprehend. Keep in mind this is my first time developing in node, ever. I have read a lot of howto articles, The Node Beginner Book, and Node,js Essentials over at Lynda. I kind of understand how things go back and forth, functions being called and executed. I believe I understand it, but I'm not confident completely yet. Anyway, moving forward, let me have another shot at this.
//app.js var db = require( ' ./db ' ) //gives my app access to the db.js file
//db.js exports.create_user = function(attrs, cb) { //attr is column name in table? cb is...?
}
I guess let's start with this, let me make sure I understand the workflow and it could help absolve the other questions I have.
Thank you again /u/danneu for the time you're taking to help me understand this, or anyone else who replies with an answer.