SQL errors lost in Javascript stacktrace

Đang mở
#99 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
postgresql, typescript
Lĩnh vực
cli, databases

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện migrate watch trong một cửa sổ terminal nhỏ cùng với lỗi cú pháp SQL được hiển thị trong ví dụ. Theo dõi cách lỗi migration và JavaScript stack trace được định dạng, sau đó xác minh rằng lỗi SQL vẫn hiển thị mà không bị stack trace che khuất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
836
Fork
71
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphile/migrate

Tất cả issue của graphile/migrate

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.