mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Arel: :nodoc: all
This commit is contained in:
parent
4c0a3d4880
commit
354f1c28e8
81 changed files with 81 additions and 81 deletions
|
@ -25,7 +25,7 @@ require "arel/update_manager"
|
|||
require "arel/delete_manager"
|
||||
require "arel/nodes"
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
VERSION = "10.0.0"
|
||||
|
||||
def self.sql(raw_sql)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module AliasPredication
|
||||
def as(other)
|
||||
Nodes::As.new self, Nodes::SqlLiteral.new(other)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require "arel/attributes/attribute"
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Attributes
|
||||
###
|
||||
# Factory method to wrap a raw database +column+ to an Arel Attribute.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Attributes
|
||||
class Attribute < Struct.new :relation, :name
|
||||
include Arel::Expressions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Collectors
|
||||
class Bind
|
||||
def initialize
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Collectors
|
||||
class Composite
|
||||
def initialize(left, right)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Collectors
|
||||
class PlainString
|
||||
def initialize
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require "arel/collectors/plain_string"
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Collectors
|
||||
class SQLString < PlainString
|
||||
def initialize(*)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Collectors
|
||||
class SubstituteBinds
|
||||
def initialize(quoter, delegate_collector)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Compatibility # :nodoc:
|
||||
class Wheres # :nodoc:
|
||||
include Enumerable
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
###
|
||||
# FIXME hopefully we can remove this
|
||||
module Crud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class DeleteManager < Arel::TreeManager
|
||||
def initialize
|
||||
super
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class ArelError < StandardError
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Expressions
|
||||
def count(distinct = false)
|
||||
Nodes::Count.new [self], distinct
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
###
|
||||
# Methods for creating various nodes
|
||||
module FactoryMethods
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class InsertManager < Arel::TreeManager
|
||||
def initialize
|
||||
super
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Math
|
||||
def *(other)
|
||||
Arel::Nodes::Multiplication.new(self, other)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class And < Arel::Nodes::Node
|
||||
attr_reader :children
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Ascending < Ordering
|
||||
def reverse
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Binary < Arel::Nodes::NodeExpression
|
||||
attr_accessor :left, :right
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class BindParam < Node
|
||||
attr_accessor :value
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Case < Arel::Nodes::Node
|
||||
attr_accessor :case, :conditions, :default
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Casted < Arel::Nodes::NodeExpression # :nodoc:
|
||||
attr_reader :val, :attribute
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Count < Arel::Nodes::Function
|
||||
include Math
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class DeleteStatement < Arel::Nodes::Node
|
||||
attr_accessor :left, :right
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Descending < Ordering
|
||||
def reverse
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Equality < Arel::Nodes::Binary
|
||||
def operator; :== end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Extract < Arel::Nodes::Unary
|
||||
attr_accessor :field
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class False < Arel::Nodes::NodeExpression
|
||||
def hash
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class FullOuterJoin < Arel::Nodes::Join
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Function < Arel::Nodes::NodeExpression
|
||||
include Arel::WindowPredications
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Grouping < Unary
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class In < Equality
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class InfixOperation < Binary
|
||||
include Arel::Expressions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class InnerJoin < Arel::Nodes::Join
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class InsertStatement < Arel::Nodes::Node
|
||||
attr_accessor :relation, :columns, :values, :select
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
###
|
||||
# Class that represents a join source
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Matches < Binary
|
||||
attr_reader :escape
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class NamedFunction < Arel::Nodes::Function
|
||||
attr_accessor :name
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
###
|
||||
# Abstract base class for all AST nodes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class NodeExpression < Arel::Nodes::Node
|
||||
include Arel::Expressions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class OuterJoin < Arel::Nodes::Join
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Over < Binary
|
||||
include Arel::AliasPredication
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Regexp < Binary
|
||||
attr_accessor :case_sensitive
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class RightOuterJoin < Arel::Nodes::Join
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class SelectCore < Arel::Nodes::Node
|
||||
attr_accessor :top, :projections, :wheres, :groups, :windows
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class SelectStatement < Arel::Nodes::NodeExpression
|
||||
attr_reader :cores
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class SqlLiteral < String
|
||||
include Arel::Expressions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class StringJoin < Arel::Nodes::Join
|
||||
def initialize(left, right = nil)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class TableAlias < Arel::Nodes::Binary
|
||||
alias :name :right
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Distinct < Arel::Nodes::NodeExpression
|
||||
def hash
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class True < Arel::Nodes::NodeExpression
|
||||
def hash
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Unary < Arel::Nodes::NodeExpression
|
||||
attr_accessor :expr
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class UnaryOperation < Unary
|
||||
attr_reader :operator
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class UnqualifiedColumn < Arel::Nodes::Unary
|
||||
alias :attribute :expr
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class UpdateStatement < Arel::Nodes::Node
|
||||
attr_accessor :relation, :wheres, :values, :orders, :limit
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Values < Arel::Nodes::Binary
|
||||
alias :expressions :left
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class ValuesList < Node
|
||||
attr_reader :rows
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class Window < Arel::Nodes::Node
|
||||
attr_accessor :orders, :framing, :partitions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Nodes
|
||||
class With < Arel::Nodes::Unary
|
||||
alias children expr
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module OrderPredications
|
||||
def asc
|
||||
Nodes::Ascending.new self
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Predications
|
||||
def not_eq(other)
|
||||
Nodes::NotEqual.new self, quoted_node(other)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class SelectManager < Arel::TreeManager
|
||||
include Arel::Crud
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class Table
|
||||
include Arel::Crud
|
||||
include Arel::FactoryMethods
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class TreeManager
|
||||
include Arel::FactoryMethods
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
class UpdateManager < Arel::TreeManager
|
||||
def initialize
|
||||
super
|
||||
|
|
|
@ -14,7 +14,7 @@ require "arel/visitors/dot"
|
|||
require "arel/visitors/ibm_db"
|
||||
require "arel/visitors/informix"
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class DepthFirst < Arel::Visitors::Visitor
|
||||
def initialize(block = nil)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class Dot < Arel::Visitors::Visitor
|
||||
class Node # :nodoc:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class IBM_DB < Arel::Visitors::ToSql
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class Informix < Arel::Visitors::ToSql
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class MSSQL < Arel::Visitors::ToSql
|
||||
RowNumber = Struct.new :children
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class MySQL < Arel::Visitors::ToSql
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class Oracle < Arel::Visitors::ToSql
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class Oracle12 < Arel::Visitors::ToSql
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class PostgreSQL < Arel::Visitors::ToSql
|
||||
CUBE = "CUBE"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class SQLite < Arel::Visitors::ToSql
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class UnsupportedVisitError < StandardError
|
||||
def initialize(object)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class Visitor
|
||||
def initialize
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module Visitors
|
||||
class WhereSql < Arel::Visitors::ToSql
|
||||
def initialize(inner_visitor, *args, &block)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Arel
|
||||
module Arel # :nodoc: all
|
||||
module WindowPredications
|
||||
def over(expr = nil)
|
||||
Nodes::Over.new(self, expr)
|
||||
|
|
Loading…
Reference in a new issue