14.0 Upload Form 늘 하던 패턴의 반복. Model -> Form(useForm()) -> useMutation() 14.1 Detail Page 14.2 Send Message 14.3 See Message 14.4 Mutations and Refresh 14.5 Seeding - prisma의 seeding 가짜 데이트베이스 많이 생성 하는 법.
3. npm i ts-node 설치(https://www.npmjs.com/package/ts-node) 이게 뭐냐? TypeScript execution and REPL for node.js, with source map and native ESM support. REPL이란 : Node. js Read-Eval-Print-Loop (REPL) is an easy-to-use command-line tool, used for processing Node. js expressions. It captures the user's JavaScript code inputs, interprets, and evaluates the result of this code. It displays the result to the screen, and repeats the process till the user quits the shell. 브라우저 개발자 모드에 있는 console대신 쓸수 있는 듯
5. package.json맨 아래에 해당 명령어 추
6. 그리고 바로 npx prisma db seed 명령어 치면 에러 남. SyntaxError: Cannot use import statement outside a module
대신, pool time out 때문에 그렇다. Pool은 데이터 모으는거고, pool timeout은 이게 정해진 시간 넘도록 특정 쿼리 처리 못하면 exception을 던지고 다음 쿼리로 감. The default connection pool timeout is 10 seconds. If the query engine does not process a particular query within that time, it throws an exception and moves on to the next query in the queue. 근데 serverless가 아닌 일반 서버는 데이터베이스가 허용하는 연결의 수 제한이 매우 작음 근데 우리는 planetscale이 1000개의 동시연결이 가능하단걸 prisma에게 알려주지 않았다. 그래서 prisma에서 시간 초과가 되었다. 우린 일반 DB보다 훨씬 빨랐기 때문에!
SELECT `carrot-market`.`Stream`.`id`, `carrot-market`.`Stream`.`created`, `carrot-market`.`Stream`.`updated`, `carrot-market`.`Stream`.`name`, `carrot-market`.`Stream`.`description`, `carrot-market`.`Stream`.`price`, `carrot-market`.`Stream`.`userId` FROM `carrot-market`.`Stream` WHERE 1=1 ORDER BY `carrot-market`.`Stream`.`id` ASC LIMIT ? OFFSET ?