Skip to content

Create DataBase#1

Open
Spelaya-melon-X wants to merge 49 commits intomainfrom
dev/kalashnikov
Open

Create DataBase#1
Spelaya-melon-X wants to merge 49 commits intomainfrom
dev/kalashnikov

Conversation

@Spelaya-melon-X
Copy link
Contributor

No description provided.

@Meytardzhevtd Meytardzhevtd force-pushed the main branch 5 times, most recently from 45801ad to 2194859 Compare February 24, 2025 17:43
Copy link
Collaborator

@Vdaleke Vdaleke left a comment

Choose a reason for hiding this comment

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

Я что-то накидал, что быстро увидел. Но это не полное ревью

CMakeLists.txt Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Комментарии на русском языке, заменить на английский

CMakeLists.txt Outdated
cmake_minimum_required(VERSION 3.10)

# Название проекта (можете изменить)
project(CreateAllTables)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Когда отребейзишься на новый main, заменить

program_id SERIAL PRIMARY KEY,
program_name VARCHAR(50) UNIQUE NOT NULL
);
INSERT INTO Programs (program_name) VALUES
Copy link
Collaborator

Choose a reason for hiding this comment

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

Это не то должно быть заинлайнено, а должно настраиваться.

role_id SERIAL PRIMARY KEY,
role_name VARCHAR(255) UNIQUE NOT NULL
);
INSERT INTO Roles (role_name) VALUES
Copy link
Collaborator

Choose a reason for hiding this comment

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

оставить TODO, что потом добавим разные роли.


CREATE TABLE Students (
student_id SERIAL PRIMARY KEY,
person_id INT UNIQUE REFERENCES People(person_id) ON DELETE CASCADE,
Copy link
Collaborator

Choose a reason for hiding this comment

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

почему нет NOT NULL?


class Categories {
public:
static void Create(pqxx::connection &conn, const std::string category_name , const int filter_id , bool required);
Copy link
Collaborator

Choose a reason for hiding this comment

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

тут явно не проходился clang-format. пройтись.

Copy link
Collaborator

Choose a reason for hiding this comment

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

под такое отдельный хедер сомнительный. вынести все такие функции в какие-нибудь utils.cpp или tools.cpp

inc/Feedback.hpp Outdated
public:
static void Create(pqxx::connection &conn, const int teacher_id , const int subject_id , std::string feedback_name);

static std::string ReadFeedbackName(pqxx::connection &conn, const int feedback_id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не надо делать различные read функции под каждое поле. сделай чтобы возвращался целиком класс

public:
static void Create(pqxx::connection &conn, int student_id , int feedback_id , std::string student_feedback);

static std::string ReadFeedback(pqxx::connection &conn, const int student_id ,const int feedback_id );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Аналогично целиком возвращать класс. и так везде.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ты задолбаешься std::cout чистить. Добавьте нормальную библиотеку для логирования. Например https://github.com/gabime/spdlog

@Vdaleke
Copy link
Collaborator

Vdaleke commented Mar 3, 2025

Сделать нормальное название пул реквеста, написать нормальное description. Почистить историю коммитов. Сделать логическое разделение коммитов по смыслу.

@Spelaya-melon-X Spelaya-melon-X changed the title I am doing some functions and write some sql requests (if build dir ) dev/kalashnikov Mar 5, 2025
@Spelaya-melon-X Spelaya-melon-X changed the title dev/kalashnikov Create DataBase Mar 9, 2025
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.

3 participants