-
Notifications
You must be signed in to change notification settings - Fork 0
Database handler #34
base: master
Are you sure you want to change the base?
Database handler #34
Conversation
This commit closes in parts the issue #31 Implemented a Database handler and wrote a test, wich should fail untill database is created with a test subject with id = 1. The Database handler uses preparedstatments. Database.js exports a number of suggested skeleton functions to be implemented if @Admin agrees with its usefullness. The query function in the Database.js is a bit complicated and could use a bit of improvment, but I have faild in finding a more suitable option.
Cool, looks like a good start! Though, maybe we should just make some tests that actually work, just as a principle before we merge? |
Database.js
Outdated
}, | ||
|
||
getUser : function (params,callback) { | ||
var sql = "select * from user where id = ?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tables should have plural names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
closes #31 Going to write an issue where I state that we need a setup.md file which describes what needs to be done for a user to be able to start developing code on the backend. |
Nu ser det bättre ut @Mattemagikern! Databas-setup borde dock också vara implementerat av repot. Det är delvis detta migrations är till för. Finns att läsa hur man gör här. Med migrations ska utvecklare kunna sätta up databas-miljön genom att bara ha tillgång till en databas, och sedan köra Jag misstänker att |
Kommentar på @joelklint , vi hitta inte hur man skapa en database i sequelize! Vi titta på samma länk som du visa, men deras api verkar inte ha en createdatabase funktion |
@Oscar-Rydh stöds tydligen inte än, se sequelize/cli#70. Öppen sedan 2014 (: |
Sails skapar väl databaser åt en? Kanske finns nåt att plocka därifrån |
Kan man inte bara köra https://github.com/Dsek-LTH/dAPI/blob/master/database/create_database.sql (eller delar av det) vid initialisering? |
Did a quick skim, looks like a decent start. Travis fails though, you should probably try to fix that. |
This commit closes in parts the issue #31
Implemented a Database handler and wrote a test, which should fail until
database is created with a test subject with id = 1.
The Database handler uses preparedstatments.
Database.js exports a number of suggested skeleton functions to be
implemented if @Admin agrees with its usefulness.
The query function in the Database.js is a bit complicated and could use
a bit of improvement, but I have failed in finding a more suitable option.