Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Lite basic database file #26

Merged
merged 12 commits into from
Feb 8, 2024

Conversation

dominikpalatynski
Copy link
Contributor

Basinc operations on dataBase. Adding sqlite library to cmake and also crete couple method do mennage dataBase.
first table Users(User_Id, Username, Password)
second table Passwords(Password_Id, User_Id, Title, Category, UserName, Password, Url, Notes, Creation_Time, Modify_Time, Expiry_Time)

@ziobron ziobron added the Standard The user has Standard course option label Feb 4, 2024
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseHandler.hpp Outdated Show resolved Hide resolved
source/main.cpp Outdated Show resolved Hide resolved
source/CMakeLists.txt Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.cpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
@emttiew
Copy link
Contributor

emttiew commented Feb 5, 2024

Basinc operations on dataBase. Adding sqlite library to cmake and also crete couple method do mennage dataBase. first table Users(User_Id, Username, Password) second table Passwords(Password_Id, User_Id, Title, Category, UserName, Password, Url, Notes, Creation_Time, Modify_Time, Expiry_Time)

I think that Creation_Time, Modify_Time and Expiry_Time deserve their own table.
The same for Category - this way we can:

  • avoid insertion of invalid category values
  • if you need to update or modify a category name, you only need to do it in one place
  • we eliminate redundancy by referencing only a unique identifier of Category

So this would be a new schema

Table: Users
+---------+----------+----------+
| User_Id | Username | Password |
+---------+----------+----------+

Table: Categories
+------------+----------+
| Category_Id | Category |
+------------+----------+

Table: Passwords
+-------------+---------+-------+-------------+------------+
| Password_Id | User_Id | Title | Category_Id | Url | Notes
+-------------+---------+-------+-------------+------------+

Table: TimeInfo (or PasswordHistory)
+-------------+---------------+-------------+--------------+
| Password_Id | Creation_Time | Modify_Time | Expiry_Time  |
+-------------+---------------+-------------+--------------+

source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseCommon.hpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseHandler.cpp Outdated Show resolved Hide resolved
source/DataBase/DataBaseHandler.hpp Outdated Show resolved Hide resolved
@dominikpalatynski dominikpalatynski merged commit af2bba1 into coders-school:main Feb 8, 2024
1 check failed
@ziobron
Copy link
Contributor

ziobron commented Feb 9, 2024

Your PR was merged!
🏅 2 XP granted. Thanks @dominikpalatynski for making course materials better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Standard The user has Standard course option
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants