Skip to content

support using input variable in more than one place in query (and w/ null) #28

@uladkasach

Description

@uladkasach

right now, duplicate usage of input variable -> duplicate row in type def


export interface SqlQueryFindAllLatestInput {
  city: SqlTableLocation['city'];
  city: SqlTableLocation['city'];
  state: SqlTableLocation['state'];
  state: SqlTableLocation['state'];
  postal: SqlTableLocation['postal'];
  postal: SqlTableLocation['postal'];
}

from

  where 1=1
    and (
      :city is null
      OR
      :city = l.city
    )
    and (
      :state is null
      OR
      :state = l.state
    )
    and (
      :postal is null
      OR
      :postal = l.postal
    )

we can just check that they're all equivalent and only output the first one if so. (maybe throw an error if not? or just don't dedupe and warn user - and they can decide? (second option is better because it does not block user))

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockerBlocks an in scope use case until completedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions