Skip to content

Dagim H. - #4

Closed
Unlock7 wants to merge 2 commits into
HackYourAssignment:mainfrom
Unlock7:main
Closed

Unlock7 wants to merge 2 commits into
HackYourAssignment:mainfrom
Unlock7:main

Conversation

@Unlock7

@Unlock7 Unlock7 commented Apr 1, 2026

Copy link
Copy Markdown

complete: Task1 & 2.

Copilot AI review requested due to automatic review settings April 1, 2026 15:28
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the Week 12 assignment tasks: SQL queries for the books database (task-1) and refactoring the flashcard app’s storage layer from JSON to SQLite (task-2).

Changes:

  • Implemented the SQLite-backed storage functions in task-2/src/database.js.
  • Added initial DB schema (task-2/setup.sql) and a JSON→SQLite migration script (task-2/migrate.js).
  • Added task deliverables/assets (SQL queries, lockfile, SQLite DB files, root package.json).

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
task-2/src/database.js Implements deck/card CRUD using better-sqlite3 queries.
task-2/setup.sql Adds SQLite DDL for decks and cards tables.
task-2/migrate.js Adds a script to migrate data/data.json into SQLite tables.
task-2/package-lock.json Locks better-sqlite3 dependency versions for task-2.
task-2/data/flashcards.db Adds a generated SQLite DB file containing migrated flashcard data.
task-1/queries.sql Adds answers for the required SQL queries.
task-1/books_library.db Adds/updates the SQLite database used by task-1.
package.json Adds a root-level Node package manifest.
Files not reviewed (1)
  • task-2/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread task-2/src/database.js
Comment thread task-2/src/database.js
Comment thread task-2/src/database.js
Comment thread task-2/src/database.js
Comment thread task-2/setup.sql
Comment thread task-2/migrate.js
Comment thread task-1/queries.sql
-- **Question 6** — Add one book for the author you just inserted. It can be a real book or a made-up one.
INSERT INTO books(
title, published_year, genre, author_id)
VALUES('Fikir Eske Mekabir', 1968, 'Tragedy/Romance', 25);

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question 6 hard-codes author_id = 25, which will only work if the newly inserted author happens to get id 25. To reliably link the new book to the author inserted in Question 5, derive the id via a subquery (e.g., lookup by the inserted author’s name) instead of relying on a fixed id.

Suggested change
VALUES('Fikir Eske Mekabir', 1968, 'Tragedy/Romance', 25);
VALUES(
'Fikir Eske Mekabir',
1968,
'Tragedy/Romance',
(SELECT id FROM authors WHERE first_name = 'Haddis' AND last_name = 'Alemayehu')
);

Copilot uses AI. Check for mistakes.
Comment thread task-1/queries.sql Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@Unlock7 Unlock7 closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants