묻고 답해요
132만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
로그아웃 후에도 계속 쿠키가 존재합니다.
안녕하세요! 로그아웃 후 계속 auth/me후 계속 req에서 쿠키가 존재해서 문의 남깁니다! application탭에서 쿠키는 잘 삭제가 되고 네트워크 탭에서도 logout이 성공적으로 이루어지는데 reload하면 바로 auth/me가 계속 200코드와 함께 user가 전달됩니다. 콘솔에도 찍어봤는데 계속 req에 쿠키가 같이 전달되고 있어서 요. 서버도 껐다 켜보고 했는데도 계속 그래서 문의드립니다!client/src/context/auth.tsxclient/src/components/NavBar.tsxserver/src/middlewares/auth.tsserver/src/routes/auth.ts
-
미해결[개념은 호옹~, 실습 빡] SQL 데이터 분석, 입문!
홍팍선생님! 질문입니다!
DISTINCT 함수(거래처 목록, 중복 없이 뽑아주세요) 이 강의에서과제를 내주셨잖아요? 거래내역의 입금 총액은? 이렇게요 . --거래내역의 총합SELECT sum(amount) as totalFROM transactions;이걸 말씀하시는건지.. 아니면 제가 문제를 이해를 못하는건가요 ...혹시 답을 적어주실수있나요 선생님의 과제 의도를 이해하고싶어서요
-
미해결Prisma로 알아보는 postgreSQL와 mongoDB
pgadmin 관련 질문이 있습니다
pgadmin 은 비추인가요? pg admin으로 user 입력 해보려는데 USER_INFO 랑 연관성 에러가 발생 해요 그리고 datetime 은 어떤 형식으로 입력 해야 될까요?
-
미해결Prisma로 알아보는 postgreSQL와 mongoDB
모듈 관련 에러 해결 방법 입니다 ex)Cannot find module '@nestjs/core'
error:Cannot find module '@nestjs/core' or its corresponding type declarations 해결: npm install @nestjs/common npm install @nestjs/core
-
미해결다양한 사례로 익히는 SQL 데이터 분석
'작년 대비 동월 매출 비교 SQL로 구하기' 문의 드립니다.
작년 대비 동월 매출 비교 SQL로 구하기 부분에서lag 함수로 12 row 이전의 데이터를 가져오셨는데,실제 데이터가 특정 월에 매출이 발생하지 않는 케이스를 포함할 경우에는 어떻게 해야할지 문의 드립니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
회원가입 코드 작성후, 500에러
안녕하세요 강사님! 강의 잘 듣고 있습니다!!현재 회원가입 페이지 기능생성(3)을 듣고있는데요.회원가입 요청을 보내는 과정에서 500오류가 뜹니다. 일단 로그를 확인해봤는데요. 클라이언트는 문제가 없는것 같았고, server와 db에러로그를 살펴봤습니다.server에러로그server running at http://localhost:4000 Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) { errno: -61, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 5432 } Error: DataSource is not set for this entity. at Function.getRepository (/Users/seokjiseon/Desktop/coding/clone/reddit/server/src/repository/BaseEntity.ts:115:19) at Function.findOneBy (/Users/seokjiseon/Desktop/coding/clone/reddit/server/src/repository/BaseEntity.ts:489:21) at /Users/seokjiseon/Desktop/coding/clone/reddit/server/src/routes/auth.ts:13:34 at Generator.next (<anonymous>) at /Users/seokjiseon/Desktop/coding/clone/reddit/server/src/routes/auth.ts:8:71 at new Promise (<anonymous>) at __awaiter (/Users/seokjiseon/Desktop/coding/clone/reddit/server/src/routes/auth.ts:4:12) at register (/Users/seokjiseon/Desktop/coding/clone/reddit/server/src/routes/auth.ts:6:56) at Layer.handle [as handle_request] (/Users/seokjiseon/Desktop/coding/clone/reddit/server/node_modules/express/lib/router/layer.js:95:5) at next (/Users/seokjiseon/Desktop/coding/clone/reddit/server/node_modules/express/lib/router/route.js:144:13) POST /api/auth/register 500 52.995 ms - 10 Error: DataSource is not set for this entity.이 문구를 보고, db와 연결이 안됐다고 추측하고 db로그를 확인했습니다. db로그Attaching to postgresdocker-compose up을 입력하면, 여기서 넘어가지 않더라구요.ㅠㅠ 구글링해보니 docker-compose up -d 를 입력하면 실행로그를 자세히 볼수 있다고 해서 입력해 봤는데요. 아래 오른쪽 터미널 창에 뜨는게 무한히 반복되는 상태만 지속되고 있었습니다.. 백엔드 지식이 전무해서, docker랑 db를 전부 처음 다뤄봐서 혼자 해결하기 어려워서 질문 남깁니다ㅠㅠ혹시 어떤부분을 더 살펴봐야 할까요??ㅠㅠ
-
미해결다양한 사례로 익히는 SQL 데이터 분석
DAU, WAU, MAU를 SQL로 구하기-02 관련 질문드립니다.
withtemp_00 as (select generate_series('2016-08-02'::date, '2016-11-01'::date, '1 days'::interval)::date as current_date)select b.current_date, count(distinct user_id) as daufrom ga_sess across join temp_00 bwhere visit_stime >= (b.current_date - interval '1 days') and visit_stime < b.current_dategroup by b.current_date 위 SQL문에서where visit_stime >= (b.current_date - interval '1 days') and visit_stime < b.current_date이 부분이 이해가 가지 않습니다.current_date가 2016-08-02일 경우visit_stime이 2016-08-02보다는 작아야 하고,2016-08-01보다는 크거나 같다는 말인데..그럼 즉, 2016-08-01 00:00:00 ~2016-08-01 23:59:59 라는 건데요..그럼 이게 2016-08-01의 DAU가 아닌가요?..select 절에서는 current_date로 group by를 해서추출된 데이터는 2016-08-02의 DAU로 추출이 되더라구요..실제 csv파일로 받아서 보아도,2016-08-01의 dau가 1569로 확인이 되는거 같기두 하구요.. withtemp_00 as (select generate_series('2016-08-01'::date, '2016-11-01'::date, '1 days'::interval)::date as current_date)select b.current_date, count(distinct user_id) as daufrom ga_sess across join temp_00 bwhere visit_stime >= b.current_date and visit_stime < (b.current_date + interval '1 days')group by b.current_date withtemp_00 as (select generate_series('2016-08-01'::date, '2016-11-01'::date, '1 days'::interval)::date as current_date)select b.current_date, count(distinct user_id) as waufrom ga_sess across join temp_00 bwhere visit_stime >= (b.current_date - interval '6 days') and visit_stime < (b.current_date + interval '1 days')group by b.current_date; withtemp_00 as (select generate_series('2016-08-01'::date, '2016-11-01'::date, '1 days'::interval)::date as current_date)select b.current_date, count(distinct user_id) as maufrom ga_sess across join temp_00 bwhere visit_stime >= (b.current_date - interval '29 days') and visit_stime < (b.current_date + interval '1 days')group by b.current_date; 이렇게 구하는게 맞는거 아닌지 문의드립니다 !
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
배포 후 로그인 인증이 안됩니다..
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 현재 강의대로 배포중인 상태입니다.회원가입도 잘 되어서 로그인도 되는데로그아웃이란 커뮤니티 생성 시 401 (Unauthorized)에러가 뜹니다.. 로컬에서는 아무런 문제 없이 잘 작동하고 있습니다.아무리 찾아봐도 어떤 문제가 있는지를 모르겠습니다 ㅠㅠ
-
미해결데이터 분석 SQL Fundamentals
메인 쿼리 집합 레벨 변경 관련 질문입니다.
select * from nw.orders where (customer_id,order_date) in (select customer_id,max(order_date) from nw.orders group by customer_id)이 쿼리를 날려도 customer_id 레벨이 M이라 LACOR이라는 value가 중복이 되는 건가요? 강의에선 메인 쿼리 레벨이 1이고 서브 쿼리 레벨이 M일 때 메인 쿼리 레벨이 1로 유지된다고 했는데, 이 쿼리처럼 메인 쿼리 레벨이 M이고 서브 쿼리 레벨이 1일 때도 메인 쿼리 레벨은 M으로 유지된다고 이해해도 괜찮을까요?
-
미해결데이터 분석 SQL Fundamentals
Analytic SQL 관련 질문
안녕하세요. 권철민 선생님.저는 SQL을 업무에서 활용하고 싶은 직장인입니다.선생님 강의로 SQL을 열심히 공부하고 있고 지금은 Analytic SQL을 수강 중인데요.제 궁극적인 목표는 회사 데이터베이스에서 SQL로 데이터를 가져와 판다스 등으로 처리한 뒤 머신러닝으로 결과를 도출하는 것이라서 'Analytic SQL이 내게 필요할까?' 라는 생각이 들고 있습니다. 왜냐하면 다양한 계산들은 판다스에서 더 수월히 수행할 수 있을 것 같아서요.혹시 제가 아직 지식이 부족하여 그런 것이고 제가 모르는 Analytic SQL의 장점이 있다면 조언 부탁드립니다.
-
미해결데이터 분석 SQL Fundamentals
맥북 환경에서 SQL
안녕하세요,제가 맥북을 사용하고 있고, PostgreSQL과 Dbeaver 두가지 모두 다운받았는데 이 두개가 연동(?)이 안되는 것 같아요 ㅠㅠ 인터넷 검색해보니 도커를 다운받아야한다는데 제 컴퓨터엔 도커도 설치가 안되네요.. 윈도우 기반으로 설명해주셔서 명강의를 어떻게 들으면 좋을 지 고민이라 여쭤봅니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
TypeORM 에러 및 middleware 설치 이후 cors 에러 문의드립니다.
안녕하세요, 강사님!강의 듣던 도중 해결하지 못한 에러가 있어 조언해주실 수 있으신지 문의드립니다. 1 TypeORM에서 다음과 같은 에러가 뜹니다.Server running at http://localhost:4000 QueryFailedError: tables can have at most 1600 columns at PostgresQueryRunner.query (생략) { query: 'ALTER TABLE "posts" ADD "title" character varying NOT NULL', parameters: undefined, driverError: error: tables can have at most 1600 columns at Parser.parseErrorMessage (생략) { length: 100, severity: 'ERROR', code: '54011', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'tablecmds.c', line: '6819', routine: 'ATExecAddColumn' }, length: 100, severity: 'ERROR', code: '54011', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'tablecmds.c', line: '6819', routine: 'ATExecAddColumn' } <== 이 부분이 계속 반복됩니다 (반복적으로 테이블이 생성되는 듯)stackoverflow를 찾아보니 oneToMany relation이 문제가 된다는 글을 봤는데... 제가 백앤드쪽 지식이 전무하다보니, oneToMany 데코레이터로 설정된 Entity를 어떻게 수정해야하는건지 잘 모르겠고, 강사님 코드와 동일하게 작성한 것 같은데 뭐가 문젠지 잘 모르겠습니다.특히나 아래 코드 중,{ length: 100, severity: 'ERROR', .... }이 부분이 반복적으로 로그에 찍히는데 어떻게 해결해야할지 잘 모르겠습니다.이 글을 보니, nomarlization을 진행하라는데 이게 맞는 솔루션인가요?백앤드 해보고 싶어서 아는 것 없이 무작정 따라하는 중인데, 지식이 부족해서 제대로 된 해결방법이 뭔지 알 수가 없네요.. 2middleware 설치 전까지는 회원가입 기능이 잘 되었었는데, middleware 설치 이후로는, 로컬호스트 3000에서 cors 에러가 뜹니다. (아래 이미지 첨부)로그인, 회원가입 기능 어떤것도 되지 않는 상태이고, token도 생성되지 않습니다.일단 계속해서 강의를 듣고 있는데 에러 해결이 안되어 더이상 진도를 나갈 수가 없어서 문의남깁니다 ㅠㅠAccess to XMLHttpRequest at 'http://localhost:4000/api/auth/me' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. { "message": "Network Error", "name": "AxiosError", "stack": "AxiosError: Network Error\n at XMLHttpRequest.handleError (webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:168:14)", "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json, text/plain, /" }, "baseURL": "http://localhost:4000/api", "withCredentials": true, "method": "get", "url": "/auth/me" }, "code": "ERR_NETWORK", "status": null } 나름대로 검색도 해보고, node_modules 싹 날리고 재설치해봤으나.. ㅠㅠ 답변 기다리겠습니다 감사합니다
-
미해결데이터 분석 SQL Fundamentals
쿼리 질문
안녕하세요~아래 문제에서,join nw.shippers d on b.ship_via = d.shipper_id>> 왜 ship_via = shipper_id 인지 잘 이해가 안됩니다.두 키 값이 같은 키 값인걸까요? [문제]-- Berlin에 살고 있는 고객이 주문한 주문 정보를 구할것-- 고객명, 주문id, 주문일자, 주문접수 직원명, 배송업체명을 구할것.select a.customer_id, a.contact_name, b.order_id, b.order_date, c.first_name||' '||c.last_name as employee_name, d.company_name as shipper_namefrom nw.customers ajoin nw.orders b on a.customer_id = b.customer_idjoin nw.employees c on b.employee_id = c.employee_idjoin nw.shippers d on b.ship_via = d.shipper_idwhere a.city = 'Berlin'; 그리고 회사에서 DB2를 사용하는데, 현재 강의에서 알려주시는 postgres2 와 많은 차이가 있는지도 문의 드립니다..!
-
미해결데이터 분석 SQL Fundamentals
날짜 관련 질문
안녕하세요!-- 고객명 Antonio Moreno이 1997년에 주문한 주문 정보를 주문 아이디, 주문일자, 배송일자, 배송 주소를 고객 주소와 함께 구할것.이 문제에서, 1997년에 주문한 주문 정보 where절 작성할 때where b.order_date between '19970101' and '19971231' 이렇게 작성해도 1997년 주문 정보가 추출이 되는 거 같은데, 강의에서 between to_date('19970101', 'yyyymmdd') and to_date('19971231', 'yyyymmdd')이렇게 to_date라고 쓰신 이유가 따로 있을까요?!
-
미해결따라하며 배우는 NestJS
뒷 부분 공부하고 싶습니다!
강의 뒷 부분이 너무 궁금합니다!다른 비슷한 질문에 올라온 답변의 url은 다른 사람은 못 보게 돼 있는 것 같습니다.. 자료를 따로 받을 순 없는건가요??
-
미해결따라하며 배우는 NestJS
update를 repository로 빼서 작성했는데 오류가 나옵니다
boards.service.ts 코드입니다.import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { BoardStatus } from './board-status.enum'; import { Board } from './board.entity'; import { BoardRepository } from './board.repository'; import { CreateBoardDto } from './dto/create-board.dto'; @Injectable() export class BoardsService { constructor( @InjectRepository(Board) private boardRepository: BoardRepository, ) {} createBoard(createBoardDto: CreateBoardDto): Promise<Board> { return this.boardRepository.createBoard(createBoardDto); } async getBoardById(id: number): Promise<Board> { console.log(id, 'ididid'); return this.boardRepository.getBoardById(id); } async deleteBoard(id: number): Promise<void> { const result = await this.boardRepository.delete(id); if (result.affected == 0) { throw new NotFoundException(`Can't find Board with id ${id}`); } } async updateBoardStatus(id: number, status: BoardStatus): Promise<Board> { const board = await this.getBoardById(id); board.status = status; await this.boardRepository.save(board); return board; } } board.repository.ts 코드입니다import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { BoardStatus } from './board-status.enum'; import { Board } from './board.entity'; import { BoardRepository } from './board.repository'; import { CreateBoardDto } from './dto/create-board.dto'; @Injectable() export class BoardsService { constructor( @InjectRepository(Board) private boardRepository: BoardRepository, ) {} createBoard(createBoardDto: CreateBoardDto): Promise<Board> { return this.boardRepository.createBoard(createBoardDto); } async getBoardById(id: number): Promise<Board> { console.log(id, 'ididid'); return this.boardRepository.getBoardById(id); } async deleteBoard(id: number): Promise<void> { const result = await this.boardRepository.delete(id); if (result.affected == 0) { throw new NotFoundException(`Can't find Board with id ${id}`); } } async updateBoardStatus(id: number, status: BoardStatus): Promise<Board> { const board = await this.getBoardById(id); board.status = status; await this.boardRepository.save(board); return board; } } [Nest] 12296 - 2023. 01. 26. 오후 4:25:43 ERROR [ExceptionsHandler] this.boardRepository.getBoardById is not a functionTypeError: this.boardRepository.getBoardById is not a function at BoardsService.getBoardById (C:\Users\lgh38\Desktop\GH\nest-board-app\src\boards\boards.service.ts:22:33) at BoardsService.updateBoardStatus (C:\Users\lgh38\Desktop\GH\nest-board-app\src\boards\boards.service.ts:33:30) at BoardsController.updateBoardStatus (C:\Users\lgh38\Desktop\GH\nest-board-app\src\boards\boards.controller.ts:44:31)오류 내용은 위와 같습니다. 자세히 보면 this.boardRepository.getBoardById is not a function이라고 나오는데 제가 생각 했을 땐 처음 service의 updateBoardStatus 함수에서 getBoardById 함수로 넘겨주고 또 getBoardById 함수가 repository 안에 있는 getBoardById 함수에게 값을 넘겨서 두 번 리턴 받아서 해결 될 줄 알았는데 에러가 나오더라구요..오히려 분리를 안 시켰을 땐 오류가 안 나옵니다 무슨 이유일까요..?
-
미해결데이터 분석 SQL Fundamentals
dbeaver에 연결한 dbms에 따라 쿼리를 다르게 써야 하나요?
수업은 디비버에 postgre를 연결시켜서 쓰고 있는데, 만일 mysql을 디비버에 연결하면 mysql에 맞는 문법으로 쿼리를 적용해야 하는건가요?각 dbms마다 조금씩 문법이 다른걸로 알고 있어서 문의드립니다그리고, 수업에서 배우는 쿼리문은 posrgre에서만 사용할수 있는 문법인가요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
npm run dev 실행 오류
npm run dev 로 server.ts 실행시, 에러가 발생합니다.찾아보니, db 연결 시 인증에 관련된 오류 같은데... 어떻게 해야할지 잘 모르겠습니다.오타 꼼꼼히 확인하고 docker-compose도 다시 실행 해봤는데 해결이 되지 않네요.제가 수업 듣기 전에 pg-admin을 설치했었는데, 그것과 관련 있는 걸까요?
-
미해결따라하며 배우는 NestJS
findOne() undefined 이유 아시는분
async validate(payload) { const { username } = payload; console.log(username); console.log(payload); const user: User = await this.userRepository.findOne(username); if (!user) { throw new UnauthorizedException('error'); } return user; } }logleejinleejinseong{ username: 'leejinleejinseong', iat: 1674638178, exp: 1674641778 }위 로그처럼 데이터는 로그에 찍히는데 왜 findOne에서 undefined 나올까요? 이유 아시는분..2시간 박치기하고있습니다..덜덜;;; 별짓 다해봐도 해결이 안되네요;;
-
미해결따라하며 배우는 NestJS
회원가입 기능 구현
#7-2 회원가입 기능구현에서 강의 내용 전체 작성 후 회원가입 진행하였는데, username과 password가 컨트롤러에서 console.log(authCredentialDto)를 찍으니 빈 객체만 내뱉고 있고 db에 정상적으로 저장이 되지 않았습니다. 이리저리 코드를 수정해보니.dto 구성 단게에서 validator import 후에 정상적으로 출력이 됩니다. 강의 영상에서는 문제 없이 되던데 왜 이렇게 되는지 궁금합니다.