Reads the routing key or keys out of a statement and its bindings.
Statement text using ? placeholders
?
Positional bindings for the statement
Key-column configuration
The plan, or null when the routing key cannot be proven
null
1.4.0
planQuery('SELECT * FROM users WHERE id = ?', ['user-1']);// => { kind: 'select', table: 'users', keyColumn: 'id', keys: ['user-1'], readOnly: true }planQuery('SELECT * FROM users WHERE email = ?', ['a@b.c']);// => null, because email is not the key column Copy
planQuery('SELECT * FROM users WHERE id = ?', ['user-1']);// => { kind: 'select', table: 'users', keyColumn: 'id', keys: ['user-1'], readOnly: true }planQuery('SELECT * FROM users WHERE email = ?', ['a@b.c']);// => null, because email is not the key column
Reads the routing key or keys out of a statement and its bindings.