mirror of
https://github.com/danog/postgres.git
synced 2024-11-30 04:29:12 +01:00
Support identifiers with numbers and type casts
Named identifiers in prepared statement queries may now contain (but not begin with) numbers, i.e., :column3. Type casts are now skipped (i.e., column_name::integer).
This commit is contained in:
parent
33c056b635
commit
650d464ef8
@ -5,7 +5,7 @@ namespace Amp\Postgres\Internal;
|
||||
use function Amp\Postgres\cast;
|
||||
|
||||
const STATEMENT_PARAM_REGEX = <<<'REGEX'
|
||||
~(["'`])(?:\\(?:\\|\1)|(?!\1).)*+\1(*SKIP)(*F)|(\$(\d+)|\?)|:([a-zA-Z_]+)~ms
|
||||
~(["'`])(?:\\(?:\\|\1)|(?!\1).)*+\1(*SKIP)(*FAIL)|(\$(\d+)|\?)|(?<!:):([a-zA-Z_][a-zA-Z0-9_]*)~ms
|
||||
REGEX;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user