squawk icon indicating copy to clipboard operation
squawk copied to clipboard

highlight field in error report

Open cdignam-segment opened this issue 3 years ago • 0 comments

Input SQL

create table app.users (
    id          bigint generated by default as identity primary key,
    "name"      text not null,
    created_ts  timestamptz  not null default now(),
    age         smallint not null
);

actual

stdin:1:0: warning: prefer-big-int

   1 | create table app.users (
   2 |     id          bigint generated by default as identity primary key,
   3 |     "name"      text not null,
   4 |     created_ts  timestamptz  not null default now(),
   5 |     age         smallint not null
   6 | );

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules  

expected

stdin:1:0: warning: prefer-big-int
     |
   5 |     age         smallint not null
     |                 ^^^^^^^^
                       |
                       help: consider using a 64bit integer: `bigint`

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules  

cdignam-segment avatar Jul 27 '22 15:07 cdignam-segment