이번에 새로 기능 구현하는 일이 지난주에 클론 코딩 하는 일 보다 많아졌다. 하지만, 하는 기능들이 늘어났다고 해서, 내 자신이 스스로 프로그래밍 하는 실력이 늘었다고 생각 안 한다. 그 이유는 아직 내가 팀원들로부터, 게더에 있는 다른 팀원들로부터 배워야 할 것이 많기 때문이다.
오늘 계획은 어제 만들었던 댓글 삭제기능을 구현하는 것에서 발생한 문제들로부터 오류 문제들을 해결하기 위해 할 것이고, 그 다음에 해야 할 좋아요 기능들을 어떻게 구현할 것인지, 오후에 할 계획이다.
(from afternoon)
삭제 기능 구현하면서, 내가 느꼈던 점은, 어느 부분에서 req.params 이고, 어느 부분에서 req.body인지 명확히 구분할 수 있었다. 하지만, 여전히 구조분해할당의 개념이 부족했고, async, await 부분에 대해서도 비동기 기법을 사용하기 때문에 부족함을 느꼈다. 더불어, sequelize 기법을 활용하기 때문에, where 구문을 어떻게 사용해야 하는지 공부를 할 필요를 느꼈다.
혹시 몰라서, 이렇게 하나하나씩 documentation을 달아주었고, 이 TIL을 보면서 하나씩 부족한 부분에 대해 공부하고, WIL에서 부족한 부분을 채워 나갈 예정이다.
what I learned :
terminal 에서 어떻게 했는지 보여준 결과를 출력한 결과이다.
Microsoft Windows Version 10.0.19042.1288 Microsoft Corporation. All rights reserved.
C:\Users\User>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
C:\Users\User>mysql -u root -p
Enter password: *
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 104
Server version: 8.0.27 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW DATABASES
-> SHOW DATABASES;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SHOW DATABASES' at line 2
mysql> SHOW DATABASES;
+----------------------+
| Database |
+----------------------+
| database_development |
| focus |
| information_schema |
| mysql |
| performance_schema |
| sys |
+----------------------+
6 rows in set (0.00 sec)
mysql> use focus
Database changed
mysql> show TABLES
-> ^C
mysql> SHOW TABLES;
+-----------------+
| Tables_in_focus |
+-----------------+
| bookmarks |
| comments |
| likes |
| posts |
| sequelizemeta |
| users |
+-----------------+
6 rows in set (0.01 sec)
mysql> DESC comments;4
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| userId | int | NO | | NULL | |
| postId | int | NO | | NULL | |
| textContent | varchar(255) | NO | | NULL | |
| avatarUrl | varchar(255) | YES | | NULL | |
| date | datetime | NO | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
6 rows in set (0.01 sec)
->
-> ^C
mysql> select * from comments;
+----+--------+--------+-------------+-----------+---------------------+
| id | userId | postId | textContent | avatarUrl | date |
+----+--------+--------+-------------+-----------+---------------------+
| 1 | 5 | 1 | ?? ??? | NULL | 2021-10-28 08:03:31 |
| 2 | 5 | 1 | ?? ??? | NULL | 2021-10-28 08:03:44 |
| 3 | 5 | 1 | ?? ??? | NULL | 2021-10-28 09:38:16 |
| 4 | 5 | 1 | ?? ??? | NULL | 2021-10-28 14:13:22 |
+----+--------+--------+-------------+-----------+---------------------+
4 rows in set (0.04 sec)
mysql> default-character-set=utf8
-> ^C
mysql> exit
Bye
C:\Users\User>vi /etc/mysql/my.cnf
'vi' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\User>sudo vi /etc/mysql/my.cnf
'sudo' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\User>