diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-21 08:33:09 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-21 08:33:09 -0400 |
commit | db1bb4e9a728a437d16f8bdb48c3b772c3e4edb0 (patch) | |
tree | f0f7623e9b730679adcb0dfe97f9c8415a91328f /test/visitors/test_mysql.rb | |
parent | f031a3b9aa6a8093802e0188abce58e0b997078e (diff) | |
download | rails-db1bb4e9a728a437d16f8bdb48c3b772c3e4edb0.tar.gz rails-db1bb4e9a728a437d16f8bdb48c3b772c3e4edb0.tar.bz2 rails-db1bb4e9a728a437d16f8bdb48c3b772c3e4edb0.zip |
Add a value field `Nodes::BindParam`
This is part of a greater refactoring to have the `BindParam` nodes hold
onto their values. We want to generally keep the AST decoupled from what
you're actually doing with those values, but ultimately the usage of
`BindParam` is almost identical to how you'd use `Casted` or `Quoted`.
Forcing consumers of Arel's API to maintain the bind values separately
from the AST makes manipulating the AST essentially impossible, as you
would need to perform a full walk of the AST to determine whether a
given node contains bind parameters, and which value it maps to.
By storing the value on the bind parameter directly, we can collect them
in another AST pass (realistically it'll be part of the same pass that
performs SQL construction for performance reasons). This will
dramatically simplify AST manipulation for Rails or any other consumers
that work with bind params.
As part of this change I've removed the `BindVisitor`, which appears to
be dead code, and had tests break from this change.
Diffstat (limited to 'test/visitors/test_mysql.rb')
0 files changed, 0 insertions, 0 deletions