Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight field in error report #247

Open
cdignam-segment opened this issue Jul 27, 2022 · 0 comments
Open

highlight field in error report #247

cdignam-segment opened this issue Jul 27, 2022 · 0 comments

Comments

@cdignam-segment
Copy link
Contributor

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  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant