Skip to content

Why mix the style of functions and phrases? #66

@0-issue

Description

@0-issue

Input:

select
  foo,
  bar
from
  baz
where
  foo like 'abd%'
  or foo like 'ada%' escape '!'
  or foo not like 'abd%'
  or foo not like 'ada%' escape '!'
  or foo ilike 'efg%'
  or foo ilike 'ada%' escape '!'
  or foo not ilike 'efg%'
  or foo not ilike 'ada%' escape '!'

output (cat file.sql | ./main --align --casemode lower):

select foo, bar
  from baz
 where foo like 'abd%'
    or like_escape(foo, 'ada%', '!')
    or foo not like 'abd%'
    or not_like_escape(foo, 'ada%', '!')
    or foo ilike 'efg%'
    or ilike_escape(foo, 'ada%', '!')
    or foo not ilike 'efg%'
    or not_ilike_escape(foo, 'ada%', '!');

In the following excerpt, every other line has been converted to a function. Why, does it make more sense? If not, is there a way to disable that?

    or like_escape(foo, 'ada%', '!')
    or foo not like 'abd%'
    or not_like_escape(foo, 'ada%', '!')
    or foo ilike 'efg%'
    or ilike_escape(foo, 'ada%', '!')
    or foo not ilike 'efg%'
    or not_ilike_escape(foo, 'ada%', '!')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions