- Used Figma to produce the following:
Team | Pairs | Solo | |
---|---|---|---|
Wednesday | 100% | 0% | 0% |
Thursday | 40% | 60% | 0% |
- Spent whole first day as a 4 as setting up was basically half of the project. -- Initialising all the files, kanban, sql, express, dotenv, requiring, exporting and modularising everything required our combined brainpower
We didn't even know what our project would be until the end of the day
- Our experience from previous projects meant that our velocity was super accurate - this meant that when choosing what tasks to tackle and how long we should spend in pairs had us consistently coming back together at the same time. -- This also meant that when we explained what we had done with each other the code was fresh in our mind and we weren't encumbered by the problems we were still trying to solve.
Thanks Rihards
<iframe src="https://giphy.com/embed/l2JeblbdfRL0i2qOI" width="480" height="364" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
<iframe src="https://giphy.com/embed/ekje2HEQqJW7cE9SIJ" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
Oli's workshop:
- 1 db.query; 1 table, using..
- an array (called values), created by passing request.body in to Object.values():
function post(request, response) {
const data = request.body;
const values = Object.values(data);
db.query(
"INSERT INTO users(username, age, location) VALUES($1, $2, $3)",
values
).then(() => {
response.redirect("/");
});
}
FACBook effort 1:
- 1 DB query (as per oli's), BUT..
- with 2 SQL lines(1 for each table), using..
- array of values created/used (as per Oli's)
function post(request, response) {
const data = request.body;
const values = Object.values(data);
db.query(
`INSERT INTO people(name, github_username, pronoun, cohort, location) VALUES($1, $2, $3, $5, $6)
INSERT INTO interests(username, activity) VALUES($2, $4);`,
values
)
.then(() => {
response.redirect("/");
});
}
error: syntax error at or near "INSERT"
FACBook effort 2:
- 2 DB queries (1 for each table), using..
- Array of values created the same way as Oli's
function post(request, response) {
const data = request.body;
const values = Object.values(data);
db.query(
`INSERT INTO people(name, github_username, pronoun, cohort, location) VALUES($1, $2, $3, $5, $6);`,
values
)
.then(() => {
db.query(
"INSERT INTO interests(username, activity) VALUES($2, $4); ",
values
);
})
.then(() => {
response.redirect("/");
});
}
error: could not determine data type of parameter $4
FACBook effort 3:
- 2 DB queries (1 for each table), BUT..
- we created two arrays containing the data that we wanted from request.body:
function post(request, response) {
const data = request.body;
const justPeopleValues = [data.name, data.github_username, data.pronoun, data.cohort, data.location,
];
const hobbyValues = [data.github_username, data.interest];
db.query(
`INSERT INTO people(name, github_username, pronoun, cohort, location) VALUES($1, $2, $3, $4, $5);`,
justPeopleValues
)
.then(() => {
db.query(
"INSERT INTO interests(username, activity) VALUES($1, $2); ",
hobbyValues
);
})
.then(() => {
response.redirect("/");
});
}
"relation 'interests' does not exist" - this error was coming up at on the 'before each' test, to reset the db
DROP TABLE IF *** EXISTS CASCADE;
SSL
When we first tried to delpoy on Heroku we kept getting an error message and not being able to access the page. We eventually worked out that our error was here:
UnhandledPromiseRejectionWarning: error: no pg_hba.conf entry for host "3.238.31.155", user "glikkvufsehtps", database "d7uv40jch5kjln", SSL off
ssl: {
rejectUnauthorized: false
}
};
However, this caused an issue for our local server and testing, so we ended up commenting and uncommenting this code. This felt like a very hacky solution and not the best one!
- Stop using
git add .
- Improve on commit messages
- Being too serious :face_with_raised_eyebrow:
- Database design, understanding FK/PK
- Working as a group to get the core files( Express/Database servers) set up
- Co-authoring:
Co-authored-by: Rosie O'Donnell <[email protected]>