분류 전체보기
-
SQL과 NoSQLTutorial/0.Tutorial 2022. 10. 19. 09:12
SQL : RDBMS Relational DataBase Management System 장점 관계망에 따라 데이터가 테이블에 분배된다. 따라서 데이터가 각 테이블에 중복저장되는 것을 줄일 수 있다. 또 미리 정의된 스키마에 의해 데이터가 저장되므로, 테이터 무결성 data integrity 에 장점이 있다. 데이터 무결성 data integrity 소위 무결성 제한 Integrity constraints 등의 규칙으로 데이터베이스에 의해 강제되곤 한다. 다음의 세 갈래로 나눌 수 있다. -개체 무결성 Entity integrity 고유키 관련. 개체 무결성은 모든 테이블이 고유한 기본키를 가지고 null 을 허용하지 않는다. -참조 무결성 Referential Integrity 외래키 관련. 모든 외래..
-
클래스 호이스팅JavaScript/입 속의 검은 잎 2022. 10. 18. 10:52
먼저, 클래스는 함수의 일종이다. 클래서 선언문으로 정의한 클래스는 소스코드 평가과정, 즉 런타임 이전에 먼저 평가되어 함수 객체를 생성한다. 이때 클래스가 평가되어 생성된 함수 객체는 생성자 함수로서 호출할 수 있는 함수, 즉 constructor다. 생성자 함수로서 호출할 수 있는 함수는 함수 정의가 평가되어 함수 객체를 생성하는 시점에 프로토타입도 더불어 생성된다. 프로토타입과 생성자 함수는 단독으로 존재할 수 없고, 언제나 쌍으로 존재하기 때문이다. , 421쪽. const Jedi = ''; { //호이스팅이 발생하지 않는다면 ''이 출력되어야 한다. console.log(typeof Jedi) //ReferenceError: Cannot access 'Jedi' before initializa..
-
팀과제 : ORM과 MySQL이제 막 슬픔 없이 십오 초 정도가 지났다 2022. 10. 15. 09:30
ORM (Object Relational Mapper)은 객체와 데이터베이스의 관계를 매핑(Mapping)하는 도구이며, 시퀄라이저는 이 ORM으로서의 라이브러리, 혹은 모듈이다. ORM을 통해 관계형 데이터베이스가 다루는 엔티티 (어떤 사물 혹은 개념의 뭉치. 그냥 SQL 테이블을 생각하면 된다.) 를 객체로 활용할 수 있다. ORM은 객체간 관계를 바탕으로 SQL을 자동생성한다. 이로써 객체 모델과 관계형 모델 간의 불일치를 해소하는 것이다. 이 효용은 그저 SQL 쿼리문을 직접 작성해야 하는 수고를 덜어주는 정도에 그치지 않는다. ORM의 매개로 말미암아 데이터 베이스와 에플리케이션은 "느슨하게 연결된, 테스트에 용이한" 관계를 맺게 된다. 혹은 DBMS(Database Management Syst..
-
에러로그 : winston, morganJavaScript/Exress 2022. 10. 12. 21:23
https://github.com/winstonjs/winston GitHub - winstonjs/winston: A logger for just about everything. A logger for just about everything. Contribute to winstonjs/winston development by creating an account on GitHub. github.com https://www.npmjs.com/package/winston winston A logger for just about everything.. Latest version: 3.8.2, last published: a month ago. Start using winston in your project b..
-
클래스, super, 오버라이딩JavaScript/입 속의 검은 잎 2022. 10. 12. 10:53
const Jedi = function(name, age){ this.name = name; this.age = age; this.isJedi = true; this.force = ()=>{console.log('may the force be with you')}; }; const Anakin = new Jedi('Anakin', 30); console.log(Anakin) class Sith { constructor(name, age){ this.name = name; this.age = age; this.isJedi = false; } force(){ console.log('may the force serve you') }; } const DarthVader = new Sith('DarthVader'..
-
express.urlenconded()JavaScript/Exress 2022. 10. 11. 20:11
헤더에서 규정되는 content-type을 보라. x-www-form-urlencoded 형태를 받는다. 위의 예시는 클라이언트에서 form 태그를 통해 전송되었다. 이 말은 곧, form 태그로 전송되는 값은 express.json() 이 아니라 express.urlexcoded()로 받아야 한다는 것. 더보기 This is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser. 내장된 미들웨어. "urlencoded payload"로 들어오는 리퀘스트를 파싱. body-parser 기반. 지금은 express 패키지 안에 body-pa..
-
express.routerJavaScript/Exress 2022. 10. 11. 20:03
const router = express.Router([options]) 새로운 라우터 객체를 찍어낸다. 옵션에 들어갈 수 있는 것들 caseSensitive default 값이 disabled. 그간 열심히 '/posts' 를 '/Posts' 로 쓰지 않기 위해 기울였던 노력은 허사였다네. mergeParams Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. 라우터 파라미터에 대한 고질적인 이슈. https://inmanustuaspater.tistory.com/115 strict 디폴트는..
-
개인과제 : 시퀄라이저 exclude이제 막 슬픔 없이 십오 초 정도가 지났다 2022. 10. 11. 16:24
attribute는 배열로 하나씩 불러낼 수도 있고, 그 안에서 exclude를 통해 일종의 부정신학을 할 수도 있다. //좋아요 게시글 조회 : 로그인 필요 router.get("/",authMiddleware, async (req, res) => { const {user} = res.locals; console.log(user.userId) // 1 (userId 숫자) try { const likeList = await Likes.findAll({ where: {userId : user.userId}, order: [['likes', 'DESC']], attributes: {exclude: ["createdAt", "updatedAt"]}, //attribute[]로 하나하나 배열 안에 열거해도 된..