Skip to content

Deprecate ? as a token for positional replacements, in favor of :<n> #15082

Description

@ephys

The problem

  • PostgreSQL has an operator that uses ? as its token (https://www.postgresql.org/docs/current/functions-json.html). While our parser is smarter than before, it's still pretty dumb (by design, it needs to be fast and work in many different dialects), and treats any ? token that is outside of a string as a replacement.
  • bind parameters use $name for named parameters & $1 for positional parameters. replacements use :name and ?
  • Unlike bind parameters, ? doesn't support specifying an index. If the same parameter is used twice, it must be added twice in the replacement array.

The solution

  • Deprecate usage of ? as a bind parameter
  • Add support for :1, :2, etc as positional replacement tokens

Activity

  1. added
    RFC
    on Oct 3, 2022
  2. self-assigned this
    on Oct 3, 2022
  3. WikiRik commented on Dec 10, 2022

    @WikiRik
    Member

    This doesn't seem like something that's much work. Should we deprecate it in v7 alpha so we can remove in v8?

  4. ephys commented on Dec 10, 2022

    @ephys
    MemberAuthor

    Doesn't have to be during the alpha phase but I do think we should deprecate it in v7 too. I agree that it's not too difficult to implement

  5. added
    type: feature
    and removed
    RFC
    on Dec 10, 2022
  6. added theissue type on Mar 9, 2025
  7. removed
    type: feature
    on Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions