Class: Spanner::Translator::Rules::Translation::BigintToInteger
- Inherits:
-
BaseRule
- Object
- Parser::AST::Processor
- BaseRule
- Spanner::Translator::Rules::Translation::BigintToInteger
- Defined in:
- lib/spanner/translator/rules/translation/bigint_to_integer.rb
Overview
t.bigint is not supported in spanner, so replace with t.integer, keeping null option if given
Constant Summary
Constants inherited from BaseRule
Instance Attribute Summary
Attributes inherited from BaseRule
Instance Method Summary collapse
Methods inherited from BaseRule
#any_index?, #capture_column_nullity, #capture_primary_key_argument, #capture_table_name, #conditionally_propagate_argument, #create_range, #initialize, #unless_seen
Constructor Details
This class inherits a constructor from Spanner::Translator::Rules::BaseRule
Instance Method Details
#on_send(node) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/spanner/translator/rules/translation/bigint_to_integer.rb', line 9 def on_send(node) return unless node.t_bigint? new_arguments = [node.arguments[0].source, "limit: 8"] conditionally_propagate_argument new_arguments, node, "null" @rewriter.replace(node.loc.expression, "t.integer #{new_arguments.join(", ")}") end |