SQL errors lost in Javascript stacktrace

オープン
#99 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
postgresql, typescript
領域
cli, databases

調査の方向性

まず、小さなターミナルウィンドウで、例に示されている SQL 構文エラーとともに migrate watch を再現します。マイグレーションエラーと JavaScript スタックトレースがどのように整形されるかを追跡し、その後、SQL エラーがスタックトレースに埋もれずに表示され続けることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Feature description

When running migrate watch in a rather short terminal window SQL errors are lost amongst Javascript stack traces

Motivating example

There are 10 lines of JS stack trace for 2 lines of SQL errors.

graphile-migrate: Already up to date
[2020-11-04T06:48:27.687Z]: Running current.sql

🛑 Error occurred at line 12, column 1 of "current.sql":
|   alter table taxonomy_level
|     add constraint fk_taxonomy_level_parent foreign key (parent_id, project_id, environment_id)
|       references taxonomy_level (id, project_id, environment_id);
|   asdf;
| --^
| 42601: syntax error at or near "asdf"
    error: syntax error at or near "asdf"
        at Parser.parseErrorMessage (/Users/.../node_modules/pg-protocol/dist/parser.js:278:15)
        at Parser.handlePacket (/Users/.../node_modules/pg-protocol/dist/parser.js:126:29)
        at Parser.parse (/Users/.../node_modules/pg-protocol/dist/parser.js:39:38)
        at Socket.<anonymous> (/Users/.../node_modules/pg-protocol/dist/index.js:8:42)
        at Socket.emit (node:events:327:20)
        at addChunk (node:internal/streams/readable:304:12)
        at readableAddChunk (node:internal/streams/readable:279:9)
        at Socket.Readable.push (node:internal/streams/readable:218:10)
        at TCP.onStreamRead (node:internal/stream_base_commons:192:23)

    Severity:   ERROR
    Code:       42601


Breaking changes

I feel this can be implemented without much overhead.

Supporting development

I [tick all that apply]:

  • am interested in building this feature myself
  • am interested in collaborating on building this feature
  • am willing to help testing this feature before it's released
  • am willing to write a test-driven test suite for this feature (before it exists)
  • am a Graphile sponsor ❤️
  • have an active support or consultancy contract with Graphile
主要言語
TypeScript
スター
836
フォーク
71
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphile/migrate のほかの issue

graphile/migrate の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。