This is the solution for the Databases with Node drills
Install the node dependencies npm install
Start the application npm start
Start nodemon for the application npm run dev
Run the tests npm test
-
Get all items that contain text. A function that takes one parameter for
searchTerm
which will be any string. The function will query theshopping_list
table using Knex methods and select the rows which have aname
that contains thesearchTerm
using a case insensitive match. -
Get all items paginated. A function that takes one parameter for
pageNumber
which will be a number. The function will query theshopping_list
table using Knex methods and select thepageNumber
page of rows paginated to 6 items per page. -
Get all items added after date. A function that takes one paramet for
daysAgo
which will be a number representing a number of days. This function will query theshopping_list
table using Knex methods and select the rows which have adate_added
that is greater than thedaysAgo
. -
Get the total cost for each category. A function that takes no parameters. The function will query the
shopping_list
table using Knex methods and select the rows grouped by their category and showing the total price for each category.