Assume in transaction still warns about concurrent index creation

Open
#331 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, rust, sql
Domain
databases, tooling

Research direction

Reproduce the report using the migration.sql example and the squawk --assume-in-transaction --verbose command. Trace the rule producing require-concurrent-index-creation; done means the warning is suppressed for non-concurrent index creation when --assume-in-transaction is enabled.

Written by the indexing model from the issue text.

Description

My SQL migration that I run in transaction with flyway:

CREATE INDEX IF NOT EXISTS idx_foo_bar ON foo.bar (field);

Lint it:

squawk --assume-in-transaction --verbose "migration.sql"

Output:

./sql/migration.sql:1:1: warning: require-concurrent-index-creation

   1 | CREATE INDEX IF NOT EXISTS idx_foo_bar ON foo.bar (field);

  note: Creating an index blocks writes.
  help: Create the index CONCURRENTLY.

I would expect that this warning gets suppressed if I create indexes non-concurrently in a transaction.

Dominant language
Rust
Stars
1.2k
Forks
70
Avg merge
52m
Merged PRs (30d)
47

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sbdchd/squawk

All issues in sbdchd/squawk

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.