torque-postgresql 4.1.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +28 -0
- data/lib/generators/torque/skill_generator.rb +17 -0
- data/lib/generators/torque/templates/trigger.sql.erb +3 -0
- data/lib/generators/torque/trigger_generator.rb +13 -0
- data/lib/torque/postgresql/adapter/database_statements.rb +9 -0
- data/lib/torque/postgresql/adapter/oid/array.rb +0 -4
- data/lib/torque/postgresql/adapter/oid/composite.rb +2 -1
- data/lib/torque/postgresql/adapter/oid/enum.rb +1 -1
- data/lib/torque/postgresql/adapter/oid/enum_set.rb +2 -2
- data/lib/torque/postgresql/adapter/oid/interval.rb +1 -1
- data/lib/torque/postgresql/adapter/oid/lquery.rb +45 -28
- data/lib/torque/postgresql/adapter/oid/ltree.rb +67 -9
- data/lib/torque/postgresql/adapter/oid/struct.rb +1 -1
- data/lib/torque/postgresql/adapter/oid.rb +13 -0
- data/lib/torque/postgresql/adapter/schema_definitions.rb +5 -0
- data/lib/torque/postgresql/adapter/schema_dumper.rb +1 -0
- data/lib/torque/postgresql/arel/nodes.rb +51 -0
- data/lib/torque/postgresql/arel/visitors.rb +46 -0
- data/lib/torque/postgresql/attributes/base.rb +10 -7
- data/lib/torque/postgresql/attributes/composite.rb +1 -5
- data/lib/torque/postgresql/attributes/enum.rb +1 -6
- data/lib/torque/postgresql/attributes/lquery.rb +67 -127
- data/lib/torque/postgresql/attributes/ltree.rb +35 -83
- data/lib/torque/postgresql/base.rb +9 -1
- data/lib/torque/postgresql/config.rb +21 -3
- data/lib/torque/postgresql/geometry_builder.rb +4 -10
- data/lib/torque/postgresql/inheritance.rb +5 -5
- data/lib/torque/postgresql/predicate_builder/arel_attribute_handler.rb +1 -1
- data/lib/torque/postgresql/predicate_builder/array_handler.rb +16 -8
- data/lib/torque/postgresql/predicate_builder/composite_handler.rb +18 -5
- data/lib/torque/postgresql/predicate_builder/ltree_handler.rb +86 -18
- data/lib/torque/postgresql/predicate_builder/struct_handler.rb +29 -9
- data/lib/torque/postgresql/predicate_builder.rb +38 -11
- data/lib/torque/postgresql/railtie.rb +17 -0
- data/lib/torque/postgresql/relation/auxiliary_statement.rb +7 -3
- data/lib/torque/postgresql/relation/buckets.rb +2 -1
- data/lib/torque/postgresql/relation/cross_join.rb +193 -0
- data/lib/torque/postgresql/relation/inheritance.rb +1 -2
- data/lib/torque/postgresql/relation/join_series.rb +1 -0
- data/lib/torque/postgresql/relation/merger.rb +9 -0
- data/lib/torque/postgresql/relation/segments.rb +140 -0
- data/lib/torque/postgresql/relation.rb +23 -4
- data/lib/torque/postgresql/version.rb +1 -1
- data/lib/torque/postgresql/versioned_commands/command_migration.rb +23 -0
- data/lib/torque/postgresql/versioned_commands.rb +39 -0
- data/lib/torque/postgresql.rb +0 -2
- data/sig/generators/torque/function_generator.rbs +9 -0
- data/sig/generators/torque/skill_generator.rbs +7 -0
- data/sig/generators/torque/trigger_generator.rbs +9 -0
- data/sig/generators/torque/type_generator.rbs +9 -0
- data/sig/generators/torque/view_generator.rbs +9 -0
- data/sig/manifest.yaml +7 -0
- data/sig/torque/postgresql/adapter/database_statements.rbs +42 -0
- data/sig/torque/postgresql/adapter/inheritance_statements.rbs +36 -0
- data/sig/torque/postgresql/adapter/oid/array.rbs +20 -0
- data/sig/torque/postgresql/adapter/oid/box.rbs +28 -0
- data/sig/torque/postgresql/adapter/oid/circle.rbs +33 -0
- data/sig/torque/postgresql/adapter/oid/composite.rbs +35 -0
- data/sig/torque/postgresql/adapter/oid/enum.rbs +28 -0
- data/sig/torque/postgresql/adapter/oid/enum_set.rbs +19 -0
- data/sig/torque/postgresql/adapter/oid/interval.rbs +20 -0
- data/sig/torque/postgresql/adapter/oid/line.rbs +33 -0
- data/sig/torque/postgresql/adapter/oid/lquery.rbs +21 -0
- data/sig/torque/postgresql/adapter/oid/ltree.rbs +32 -0
- data/sig/torque/postgresql/adapter/oid/range.rbs +28 -0
- data/sig/torque/postgresql/adapter/oid/segment.rbs +38 -0
- data/sig/torque/postgresql/adapter/oid/struct.rbs +41 -0
- data/sig/torque/postgresql/adapter/oid/struct_list.rbs +20 -0
- data/sig/torque/postgresql/adapter/oid/struct_set.rbs +18 -0
- data/sig/torque/postgresql/adapter/oid.rbs +9 -0
- data/sig/torque/postgresql/adapter/quoting.rbs +20 -0
- data/sig/torque/postgresql/adapter/schema_creation.rbs +13 -0
- data/sig/torque/postgresql/adapter/schema_definitions.rbs +55 -0
- data/sig/torque/postgresql/adapter/schema_dumper.rbs +37 -0
- data/sig/torque/postgresql/adapter/schema_overrides.rbs +46 -0
- data/sig/torque/postgresql/adapter/schema_statements.rbs +50 -0
- data/sig/torque/postgresql/adapter.rbs +24 -0
- data/sig/torque/postgresql/arel/infix_operation.rbs +79 -0
- data/sig/torque/postgresql/arel/join_source.rbs +19 -0
- data/sig/torque/postgresql/arel/nodes.rbs +83 -0
- data/sig/torque/postgresql/arel/operations.rbs +28 -0
- data/sig/torque/postgresql/arel/select_manager.rbs +15 -0
- data/sig/torque/postgresql/arel/visitors.rbs +30 -0
- data/sig/torque/postgresql/arel.rbs +6 -0
- data/sig/torque/postgresql/associations/association_scope.rbs +28 -0
- data/sig/torque/postgresql/associations/belongs_to_many_association.rbs +51 -0
- data/sig/torque/postgresql/associations/builder/belongs_to_many.rbs +24 -0
- data/sig/torque/postgresql/associations/builder/has_many.rbs +15 -0
- data/sig/torque/postgresql/associations/builder.rbs +8 -0
- data/sig/torque/postgresql/associations/foreign_association.rbs +16 -0
- data/sig/torque/postgresql/associations/join_dependency.rbs +16 -0
- data/sig/torque/postgresql/associations/preloader/association.rbs +32 -0
- data/sig/torque/postgresql/associations/preloader/loader_query.rbs +20 -0
- data/sig/torque/postgresql/associations/preloader.rbs +8 -0
- data/sig/torque/postgresql/associations.rbs +17 -0
- data/sig/torque/postgresql/attributes/base.rbs +37 -0
- data/sig/torque/postgresql/attributes/builder/enum.rbs +38 -0
- data/sig/torque/postgresql/attributes/builder/full_text_search.rbs +27 -0
- data/sig/torque/postgresql/attributes/builder/period.rbs +106 -0
- data/sig/torque/postgresql/attributes/builder.rbs +19 -0
- data/sig/torque/postgresql/attributes/composite.rbs +28 -0
- data/sig/torque/postgresql/attributes/enum.rbs +69 -0
- data/sig/torque/postgresql/attributes/enum_set.rbs +75 -0
- data/sig/torque/postgresql/attributes/full_text_search.rbs +13 -0
- data/sig/torque/postgresql/attributes/lazy.rbs +17 -0
- data/sig/torque/postgresql/attributes/lquery.rbs +48 -0
- data/sig/torque/postgresql/attributes/ltree.rbs +46 -0
- data/sig/torque/postgresql/attributes/period.rbs +13 -0
- data/sig/torque/postgresql/attributes/simple_enum.rbs +39 -0
- data/sig/torque/postgresql/attributes/struct.rbs +38 -0
- data/sig/torque/postgresql/attributes.rbs +6 -0
- data/sig/torque/postgresql/autosave_association.rbs +16 -0
- data/sig/torque/postgresql/auxiliary_statement/recursive.rbs +22 -0
- data/sig/torque/postgresql/auxiliary_statement/settings.rbs +63 -0
- data/sig/torque/postgresql/auxiliary_statement.rbs +57 -0
- data/sig/torque/postgresql/base.rbs +41 -0
- data/sig/torque/postgresql/collector.rbs +7 -0
- data/sig/torque/postgresql/config.rbs +9 -0
- data/sig/torque/postgresql/function.rbs +21 -0
- data/sig/torque/postgresql/geometry_builder.rbs +20 -0
- data/sig/torque/postgresql/i18n.rbs +15 -0
- data/sig/torque/postgresql/inheritance/expander.rbs +23 -0
- data/sig/torque/postgresql/inheritance/record.rbs +20 -0
- data/sig/torque/postgresql/inheritance.rbs +47 -0
- data/sig/torque/postgresql/insert_all.rbs +22 -0
- data/sig/torque/postgresql/migration/command_recorder.rbs +30 -0
- data/sig/torque/postgresql/migration.rbs +6 -0
- data/sig/torque/postgresql/predicate_builder/arel_attribute_handler.rbs +15 -0
- data/sig/torque/postgresql/predicate_builder/array_handler.rbs +26 -0
- data/sig/torque/postgresql/predicate_builder/composite_handler.rbs +26 -0
- data/sig/torque/postgresql/predicate_builder/enumerator_lazy_handler.rbs +18 -0
- data/sig/torque/postgresql/predicate_builder/ltree_handler.rbs +36 -0
- data/sig/torque/postgresql/predicate_builder/regexp_handler.rbs +16 -0
- data/sig/torque/postgresql/predicate_builder/struct_handler.rbs +24 -0
- data/sig/torque/postgresql/predicate_builder.rbs +23 -0
- data/sig/torque/postgresql/predicate_table.rbs +24 -0
- data/sig/torque/postgresql/railtie.rbs +10 -0
- data/sig/torque/postgresql/reflection/abstract_reflection.rbs +22 -0
- data/sig/torque/postgresql/reflection/association_reflection.rbs +18 -0
- data/sig/torque/postgresql/reflection/belongs_to_many_reflection.rbs +30 -0
- data/sig/torque/postgresql/reflection/has_many_reflection.rbs +14 -0
- data/sig/torque/postgresql/reflection/runtime_reflection.rbs +18 -0
- data/sig/torque/postgresql/reflection/through_reflection.rbs +14 -0
- data/sig/torque/postgresql/reflection.rbs +11 -0
- data/sig/torque/postgresql/relation/auxiliary_statement.rbs +29 -0
- data/sig/torque/postgresql/relation/buckets.rbs +35 -0
- data/sig/torque/postgresql/relation/cross_join.rbs +63 -0
- data/sig/torque/postgresql/relation/distinct_on.rbs +16 -0
- data/sig/torque/postgresql/relation/inheritance.rbs +48 -0
- data/sig/torque/postgresql/relation/join_series.rbs +28 -0
- data/sig/torque/postgresql/relation/merger.rbs +23 -0
- data/sig/torque/postgresql/relation/segments.rbs +27 -0
- data/sig/torque/postgresql/relation.rbs +48 -0
- data/sig/torque/postgresql/schema_cache/bound_schema_reflection.rbs +14 -0
- data/sig/torque/postgresql/schema_cache/inheritance.rbs +12 -0
- data/sig/torque/postgresql/schema_cache/schema_reflection.rbs +14 -0
- data/sig/torque/postgresql/schema_cache.rbs +43 -0
- data/sig/torque/postgresql/table_name.rbs +20 -0
- data/sig/torque/postgresql/validations.rbs +13 -0
- data/sig/torque/postgresql/version.rbs +5 -0
- data/sig/torque/postgresql/versioned_commands/command_migration.rbs +54 -0
- data/sig/torque/postgresql/versioned_commands/generator.rbs +17 -0
- data/sig/torque/postgresql/versioned_commands/migration_context.rbs +30 -0
- data/sig/torque/postgresql/versioned_commands/migrator.rbs +19 -0
- data/sig/torque/postgresql/versioned_commands/schema_table.rbs +23 -0
- data/sig/torque/postgresql/versioned_commands.rbs +25 -0
- data/sig/torque/postgresql.rbs +26 -0
- data/skills/torque-postgresql/SKILL.md +70 -0
- data/spec/fixtures/migrations/20250101000008_create_trigger_audit_users_v1.sql +3 -0
- data/spec/initialize.rb +9 -0
- data/spec/mocks/cache_query.rb +1 -1
- data/spec/rbs_helper.rb +8 -0
- data/spec/schema.rb +2 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/tests/arel_spec.rb +1 -3
- data/spec/tests/auxiliary_statement_spec.rb +12 -0
- data/spec/tests/buckets_spec.rb +122 -0
- data/spec/tests/composite_spec.rb +67 -0
- data/spec/tests/cross_join_spec.rb +185 -0
- data/spec/tests/distinct_on_spec.rb +5 -0
- data/spec/tests/enum_set_spec.rb +4 -0
- data/spec/tests/enum_spec.rb +20 -4
- data/spec/tests/geometric_builder_spec.rb +16 -5
- data/spec/tests/has_many_spec.rb +2 -1
- data/spec/tests/interval_spec.rb +6 -0
- data/spec/tests/ltree_spec.rb +398 -64
- data/spec/tests/predicate_builder_spec.rb +120 -0
- data/spec/tests/relation_spec.rb +25 -69
- data/spec/tests/segments_spec.rb +264 -0
- data/spec/tests/struct_spec.rb +202 -0
- data/spec/tests/table_inheritance_spec.rb +10 -0
- data/spec/tests/versioned_commands_spec.rb +145 -0
- metadata +153 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module OID
|
|
5
|
+
class Lquery < Ltree
|
|
6
|
+
STAR: Regexp
|
|
7
|
+
|
|
8
|
+
def type: () -> :lquery
|
|
9
|
+
|
|
10
|
+
private
|
|
11
|
+
|
|
12
|
+
def value_class: () -> singleton(Attributes::LQuery)
|
|
13
|
+
def items_of: (untyped entry, bool sanitize) -> ::Array[untyped]
|
|
14
|
+
def compile: (untyped item) -> String
|
|
15
|
+
def quantifier: (::Range[Integer?] range) -> String
|
|
16
|
+
def parse: (String text) -> (String | Symbol | ::Array[String] | ::Range[Integer?])
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module OID
|
|
5
|
+
class Ltree < ActiveModel::Type::Value
|
|
6
|
+
type path = Attributes::LTree | Attributes::LQuery
|
|
7
|
+
|
|
8
|
+
def type: () -> :ltree
|
|
9
|
+
def cast: (untyped value) -> path?
|
|
10
|
+
def serialize: (untyped value) -> String?
|
|
11
|
+
def deserialize: (String? value) -> path?
|
|
12
|
+
def items_for: (untyped value, ?sanitize: bool) -> ::Array[untyped]
|
|
13
|
+
def type_cast_for_schema: (untyped value) -> String
|
|
14
|
+
def changed_in_place?: (String? raw_old_value, untyped new_value) -> bool
|
|
15
|
+
def ==: (untyped other) -> bool
|
|
16
|
+
alias eql? ==
|
|
17
|
+
def hash: () -> Integer
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def value_class: () -> (singleton(Attributes::LTree) | singleton(Attributes::LQuery))
|
|
22
|
+
def items_of: (untyped entry, bool sanitize) -> ::Array[untyped]
|
|
23
|
+
def labels_of: (String text, bool sanitize) -> ::Array[untyped]
|
|
24
|
+
def record_label: (record record) -> String
|
|
25
|
+
def sanitize: (String text) -> String
|
|
26
|
+
def compile: (untyped item) -> String
|
|
27
|
+
def parse: (String text) -> untyped
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module OID
|
|
5
|
+
class Range < ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Range[untyped]
|
|
6
|
+
HASH_PICK: ::Array[Symbol]
|
|
7
|
+
|
|
8
|
+
module Comparison
|
|
9
|
+
def <=>: (untyped other) -> Integer?
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def cast_value: (untyped value) -> untyped
|
|
13
|
+
def map: (untyped value) { (untyped) -> untyped } -> untyped
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def cast_custom: (untyped from, untyped to) -> ::Range[untyped]
|
|
18
|
+
def custom_cast_single: (untyped value, ?bool negative) -> untyped
|
|
19
|
+
def custom_infinity: (bool negative) -> Float
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Float
|
|
27
|
+
prepend Torque::PostgreSQL::Adapter::OID::Range::Comparison
|
|
28
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
class Segment < ::Struct[untyped]
|
|
4
|
+
def point0: () -> untyped
|
|
5
|
+
def point0=: (untyped value) -> untyped
|
|
6
|
+
def point1: () -> untyped
|
|
7
|
+
def point1=: (untyped value) -> untyped
|
|
8
|
+
|
|
9
|
+
def x1=: (Numeric value) -> untyped
|
|
10
|
+
def x1: () -> Numeric
|
|
11
|
+
def y1=: (Numeric value) -> untyped
|
|
12
|
+
def y1: () -> Numeric
|
|
13
|
+
def x2=: (Numeric value) -> untyped
|
|
14
|
+
def x2: () -> Numeric
|
|
15
|
+
def y2=: (Numeric value) -> untyped
|
|
16
|
+
def y2: () -> Numeric
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def new_point: (Numeric x, Numeric y) -> untyped
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
module Adapter
|
|
24
|
+
module OID
|
|
25
|
+
class Segment < Torque::PostgreSQL::GeometryBuilder
|
|
26
|
+
PIECES: ::Array[Symbol]
|
|
27
|
+
FORMATION: String
|
|
28
|
+
|
|
29
|
+
def point_class: () -> Class
|
|
30
|
+
def build_klass: (*untyped args) -> untyped
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class ActiveRecord::Segment < Torque::PostgreSQL::Segment
|
|
38
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module OID
|
|
5
|
+
class Struct < ActiveRecord::Type::Json
|
|
6
|
+
type backfill = bool | column_ref | ::Array[column_ref] | nil
|
|
7
|
+
type document = Hash[String, untyped]
|
|
8
|
+
|
|
9
|
+
attr_reader klass: Class
|
|
10
|
+
attr_reader type: Symbol
|
|
11
|
+
attr_reader backfill: backfill
|
|
12
|
+
|
|
13
|
+
@without_backfill: Struct
|
|
14
|
+
|
|
15
|
+
def self.state: (untyped value) -> untyped
|
|
16
|
+
def initialize: (Class klass, ?type: Symbol, ?backfill: backfill) -> void
|
|
17
|
+
def cast: (untyped value) -> untyped
|
|
18
|
+
def deserialize: (String | Hash[untyped, untyped] | nil value) -> untyped
|
|
19
|
+
def serialize: (untyped value) -> String?
|
|
20
|
+
def changed?: (untyped old_value, untyped new_value, untyped _new_value_before_cast) -> bool
|
|
21
|
+
def changed_in_place?: (String? raw_old_value, untyped new_value) -> bool
|
|
22
|
+
def without_backfill: () -> Struct
|
|
23
|
+
def empty?: (untyped value) -> bool
|
|
24
|
+
def document_for: (untyped value) -> document?
|
|
25
|
+
def document: (untyped value) -> document
|
|
26
|
+
def blank_document: () -> document
|
|
27
|
+
def ==: (untyped other) -> bool
|
|
28
|
+
alias eql? ==
|
|
29
|
+
def hash: () -> Integer
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def parse: (untyped value) -> untyped
|
|
34
|
+
def build: (untyped data, ?from_database: bool, ?blank: bool) -> untyped
|
|
35
|
+
def blank!: (untyped instance) -> untyped
|
|
36
|
+
def load: (untyped instance, Hash[column_ref, untyped] data) -> untyped
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module OID
|
|
5
|
+
class StructList < Struct
|
|
6
|
+
def cast: (untyped value) -> untyped
|
|
7
|
+
def deserialize: (untyped value) -> ::Array[Attributes::Struct]
|
|
8
|
+
def serialize: (untyped value) -> String?
|
|
9
|
+
def document_for: (untyped value) -> ::Array[untyped]
|
|
10
|
+
def empty?: (untyped value) -> bool
|
|
11
|
+
def blank_document: () -> ::Array[untyped]
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def encode: (::Array[untyped] items) -> String
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module OID
|
|
5
|
+
class StructSet < ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array[untyped]
|
|
6
|
+
@without_backfill: StructSet
|
|
7
|
+
|
|
8
|
+
def deserialize: (untyped value) -> ::Array[untyped]
|
|
9
|
+
def serialize: (untyped value) -> untyped
|
|
10
|
+
def changed_in_place?: (untyped raw_old_value, untyped new_value) -> bool
|
|
11
|
+
def without_backfill: () -> StructSet
|
|
12
|
+
def empty?: (untyped value) -> bool
|
|
13
|
+
def blank_document: () -> ::Array[untyped]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module Quoting
|
|
5
|
+
type name = table_ref
|
|
6
|
+
|
|
7
|
+
QUOTED_TYPE_NAMES: untyped
|
|
8
|
+
Name: singleton(ActiveRecord::ConnectionAdapters::PostgreSQL::Name)
|
|
9
|
+
Column: singleton(ActiveRecord::ConnectionAdapters::PostgreSQL::Column)
|
|
10
|
+
ColumnDefinition: untyped
|
|
11
|
+
Utils: singleton(ActiveRecord::ConnectionAdapters::PostgreSQL::Utils)
|
|
12
|
+
|
|
13
|
+
def quote_type_name: (name name, *table_ref args) -> String
|
|
14
|
+
def quote_identifier_name: (name name, ?table_ref? schema) -> String
|
|
15
|
+
def quote_default_expression: (untyped value, untyped column) -> String
|
|
16
|
+
def lookup_cast_type_for_column: (column column) -> type_caster
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module SchemaCreation
|
|
5
|
+
def add_table_options!: (String create_sql, ActiveRecord::ConnectionAdapters::TableDefinition o) -> String
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
class ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaCreation
|
|
12
|
+
prepend Torque::PostgreSQL::Adapter::SchemaCreation
|
|
13
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
type search_columns = column_ref | Array[column_ref] | Hash[column_ref, String]
|
|
5
|
+
type column_options = { ?limit: Integer, ?precision: Integer, ?scale: Integer, ?array: bool, ?null: bool, ?default: untyped, ?enum_type: table_ref, ?composite_type: table_ref, ?comment: String }
|
|
6
|
+
|
|
7
|
+
module ColumnMethods
|
|
8
|
+
def search_language: (*column_ref names, **untyped options) -> Array[column_ref]
|
|
9
|
+
def search_vector: (*column_ref names, columns: search_columns, **untyped options) -> Array[column_ref]
|
|
10
|
+
def composite: (*column_ref names, composite_type: table_ref, **untyped options) -> Array[column_ref]
|
|
11
|
+
def ltree: (*column_ref names, **untyped options) -> Array[column_ref]
|
|
12
|
+
def lquery: (*column_ref names, **untyped options) -> Array[column_ref]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
module TableDefinition
|
|
16
|
+
include ColumnMethods
|
|
17
|
+
|
|
18
|
+
attr_reader inherits: Array[table_ref]?
|
|
19
|
+
|
|
20
|
+
def initialize: (*untyped args, **untyped options) -> void
|
|
21
|
+
def set_primary_key: (table_ref tn, untyped id, untyped primary_key, *untyped, **untyped) -> untyped
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def create_column_definition: (column_ref name, Symbol | String type, Hash[Symbol, untyped]? options) -> untyped
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class CompositeTypeDefinition < ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition
|
|
29
|
+
attr_reader changes: Array[untyped]
|
|
30
|
+
attr_reader removals: Array[String]
|
|
31
|
+
attr_reader renames: Array[[String, String]]
|
|
32
|
+
|
|
33
|
+
def initialize: (*untyped args, **untyped xargs) -> void
|
|
34
|
+
def change: (column_ref name, Symbol | String type, **untyped options) -> Array[untyped]
|
|
35
|
+
def remove: (*column_ref names) -> Array[String]
|
|
36
|
+
def rename: (column_ref name, column_ref new_name) -> Array[[String, String]]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
module Definition
|
|
40
|
+
def create_function: (String name, version: Integer, ?dir: String | Array[String]) -> untyped
|
|
41
|
+
def create_type: (String name, version: Integer, ?dir: String | Array[String]) -> untyped
|
|
42
|
+
def create_view: (String name, version: Integer, ?dir: String | Array[String]) -> untyped
|
|
43
|
+
def create_trigger: (String name, version: Integer, ?dir: String | Array[String]) -> untyped
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class ActiveRecord::ConnectionAdapters::PostgreSQL::Table
|
|
50
|
+
include Torque::PostgreSQL::Adapter::ColumnMethods
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition
|
|
54
|
+
include Torque::PostgreSQL::Adapter::TableDefinition
|
|
55
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module SchemaDumper
|
|
5
|
+
SEARCH_VECTOR_SCANNER: Regexp
|
|
6
|
+
|
|
7
|
+
@versioned_commands: VersionedCommands::SchemaTable
|
|
8
|
+
|
|
9
|
+
def initialize: (*untyped) -> void
|
|
10
|
+
def dump: (stream stream) -> stream
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def types: (stream stream) -> untyped
|
|
15
|
+
def composite_types: (stream stream) -> untyped
|
|
16
|
+
def tables: (stream stream) -> untyped
|
|
17
|
+
def around_tables: (stream stream) { () -> void } -> untyped
|
|
18
|
+
def dump_tables: (stream stream) -> untyped
|
|
19
|
+
def remove_prefix_and_suffix: (String table) -> String
|
|
20
|
+
def schemas: (stream stream) -> untyped
|
|
21
|
+
def schema_type_with_virtual: (column column) -> Symbol
|
|
22
|
+
def schema_type: (column column) -> Symbol
|
|
23
|
+
def prepare_column_options: (column column) -> Hash[Symbol, untyped]
|
|
24
|
+
def parse_search_vector_options: (column column, Hash[Symbol, untyped] options) -> Hash[Symbol, untyped]?
|
|
25
|
+
def parse_search_vector_columns: (Array[Array[String?]] settings) -> (String | Hash[String, String])
|
|
26
|
+
def versioned_commands: (stream stream, Symbol type, ?bool add_newline) -> untyped
|
|
27
|
+
def list_existing_versioned_commands: (Symbol type) -> Set[String]
|
|
28
|
+
def with_versioned_commands?: () -> bool
|
|
29
|
+
def fx_functions_position: () -> Symbol?
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaDumper
|
|
36
|
+
prepend Torque::PostgreSQL::Adapter::SchemaDumper
|
|
37
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module SchemaOverrides
|
|
5
|
+
def quote_table_name: (table_ref name) -> String
|
|
6
|
+
def table_exists?: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
7
|
+
def indexes: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
8
|
+
def index_exists?: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
9
|
+
def columns: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
10
|
+
def column_exists?: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
11
|
+
def primary_key: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
12
|
+
def create_table: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
13
|
+
def change_table: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
14
|
+
def add_column: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
15
|
+
def add_columns: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
16
|
+
def remove_columns: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
17
|
+
def remove_column: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
18
|
+
def change_column: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
19
|
+
def change_column_default: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
20
|
+
def change_column_null: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
21
|
+
def rename_column: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
22
|
+
def add_index: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
23
|
+
def remove_index: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
24
|
+
def rename_index: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
25
|
+
def index_name_exists?: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
26
|
+
def foreign_keys: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
27
|
+
def add_timestamps: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
28
|
+
def remove_timestamps: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
29
|
+
def change_table_comment: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
30
|
+
def change_column_comment: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
31
|
+
def bulk_change_table: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
32
|
+
def rename_table: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
33
|
+
def add_foreign_key: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
34
|
+
def remove_foreign_key: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
35
|
+
def foreign_key_exists?: (table_ref table_name, *untyped args, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
36
|
+
def drop_table: (*table_ref table_names, **untyped options) -> untyped
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
def validate_table_length!: (table_ref table_name) -> untyped
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
include SchemaOverrides
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
module SchemaStatements
|
|
5
|
+
type schema_options = { ?schema: table_ref }
|
|
6
|
+
type drop_options = { ?force: Symbol | String | nil, ?check: bool, ?schema: table_ref? }
|
|
7
|
+
type create_type_options = { ?force: Symbol | bool | nil, ?schema: table_ref }
|
|
8
|
+
type composite_column_options = { ?schema: table_ref, ?limit: Integer, ?precision: Integer, ?scale: Integer, ?array: bool, ?enum_type: table_ref, ?composite_type: table_ref }
|
|
9
|
+
type search_vector_options = { ?language: String | Symbol, ?stored: bool, ?index: bool | Hash[Symbol, untyped] }
|
|
10
|
+
type enum_values_options = { ?before: String | Symbol | false, ?after: String | Symbol | false, ?prepend: bool, ?prefix: String | bool, ?suffix: String | bool, ?schema: table_ref }
|
|
11
|
+
|
|
12
|
+
def drop_type: (table_ref name, ?drop_options options) -> untyped
|
|
13
|
+
def rename_type: (table_ref type_name, table_ref new_name, ?schema_options options) -> untyped
|
|
14
|
+
def create_composite_type: (table_ref name, ?create_type_options options) ?{ (CompositeTypeDefinition td) -> void } -> untyped
|
|
15
|
+
def change_composite_type: (table_ref name, ?schema_options options) { (CompositeTypeDefinition td) -> void } -> untyped
|
|
16
|
+
def add_composite_column: (table_ref type_name, column_ref column_name, Symbol | String type, ?composite_column_options options) -> untyped
|
|
17
|
+
def remove_composite_column: (table_ref type_name, column_ref column_name, ?Symbol | String | nil type, ?schema_options options) -> untyped
|
|
18
|
+
def change_composite_column: (table_ref type_name, column_ref column_name, Symbol | String type, ?composite_column_options options) -> untyped
|
|
19
|
+
def rename_composite_column: (table_ref type_name, column_ref column_name, column_ref new_name, ?schema_options options) -> untyped
|
|
20
|
+
def add_search_language: (table_ref table, column_ref name, ?Hash[Symbol, untyped] options) -> untyped
|
|
21
|
+
def add_search_vector: (table_ref table, column_ref name, search_columns columns, ?search_vector_options options) -> untyped
|
|
22
|
+
def add_enum_values: (table_ref name, Array[String | Symbol] values, ?enum_values_options options) -> Array[String]
|
|
23
|
+
def enum_values: (table_ref name) -> Array[String]
|
|
24
|
+
def create_table: (table_ref table_name, ?sync: bool | Hash[Symbol, bool], ?inherits: table_ref | Array[table_ref], ?schema: table_ref, **untyped options) ?{ (?) -> untyped } -> untyped
|
|
25
|
+
def primary_key: (table_ref table_name) -> (String | Array[String] | nil)
|
|
26
|
+
def table_options: (table_ref table_name) -> Hash[Symbol, untyped]
|
|
27
|
+
def quoted_scope: (?table_ref? name, ?type: String?) -> Hash[Symbol, String]
|
|
28
|
+
def data_source_sql: (?table_ref? name, ?type: String?) -> String
|
|
29
|
+
def valid_table_definition_options: () -> Array[Symbol]
|
|
30
|
+
def valid_column_definition_options: () -> Array[Symbol]
|
|
31
|
+
def type_to_sql: (Symbol | String type, ?composite_type: table_ref?, **untyped options) -> untyped
|
|
32
|
+
def assume_migrated_upto_version: (Integer | String version) -> untyped
|
|
33
|
+
def insert_versions_sql: (Array[Integer] versions) -> String
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def sequence_name_from_parts: (String table_name, column_ref column_name, String suffix) -> String
|
|
38
|
+
def sanitize_name_with_schema: (table_ref name, Hash[Symbol, untyped]? options) -> table_ref
|
|
39
|
+
def create_composite_type_definition: (table_ref name) -> CompositeTypeDefinition
|
|
40
|
+
def alter_composite_type: (table_ref name, table_ref? schema, Array[String] actions) -> untyped
|
|
41
|
+
def composite_type_actions: (table_ref name, CompositeTypeDefinition td) -> Array[String]
|
|
42
|
+
def validate_composite_type!: (table_ref name, CompositeTypeDefinition td) -> nil
|
|
43
|
+
def composite_column_definition: (table_ref name, untyped column) -> String
|
|
44
|
+
def composite_column_type: (table_ref name, untyped column) -> untyped
|
|
45
|
+
def reset_composite_type: (table_ref name) -> untyped
|
|
46
|
+
def quote_enum_values: (table_ref name, Array[String | Symbol] values, enum_values_options options) -> Array[String]
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Adapter
|
|
4
|
+
include Quoting
|
|
5
|
+
include DatabaseStatements
|
|
6
|
+
include InheritanceStatements
|
|
7
|
+
include SchemaStatements
|
|
8
|
+
|
|
9
|
+
@version: Gem::Version
|
|
10
|
+
|
|
11
|
+
class DeduplicatableArray < ::Array[untyped]
|
|
12
|
+
def deduplicate: () -> Array[untyped]
|
|
13
|
+
alias -@ deduplicate
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def version: () -> Gem::Version
|
|
17
|
+
def build_insert_sql: (ActiveRecord::InsertAll::Builder insert) -> String
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
|
|
23
|
+
prepend Torque::PostgreSQL::Adapter
|
|
24
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Arel
|
|
4
|
+
module Math
|
|
5
|
+
def contained_by: (untyped other) -> ::Arel::Nodes::ContainedBy
|
|
6
|
+
def has_key: (untyped other) -> ::Arel::Nodes::HasKey
|
|
7
|
+
def has_all_keys: (untyped other) -> ::Arel::Nodes::HasAllKeys
|
|
8
|
+
def has_any_keys: (untyped other) -> ::Arel::Nodes::HasAnyKeys
|
|
9
|
+
def strictly_left: (untyped other) -> ::Arel::Nodes::StrictlyLeft
|
|
10
|
+
def strictly_right: (untyped other) -> ::Arel::Nodes::StrictlyRight
|
|
11
|
+
def doesnt_right_extend: (untyped other) -> ::Arel::Nodes::DoesntRightExtend
|
|
12
|
+
def doesnt_left_extend: (untyped other) -> ::Arel::Nodes::DoesntLeftExtend
|
|
13
|
+
def adjacent_to: (untyped other) -> ::Arel::Nodes::AdjacentTo
|
|
14
|
+
def matches_lquery: (untyped other) -> ::Arel::Nodes::MatchesLquery
|
|
15
|
+
def matches_any_lquery: (untyped other) -> ::Arel::Nodes::MatchesAnyLquery
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.build_operations: (Hash[Symbol | String, String]? operations) -> Hash[Symbol | String, String]?
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
module Arel
|
|
24
|
+
module Nodes
|
|
25
|
+
class ContainedBy < InfixOperation
|
|
26
|
+
def initialize: (untyped left, untyped right) -> void
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class HasKey < InfixOperation
|
|
30
|
+
def initialize: (untyped left, untyped right) -> void
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class HasAllKeys < InfixOperation
|
|
34
|
+
def initialize: (untyped left, untyped right) -> void
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class HasAnyKeys < InfixOperation
|
|
38
|
+
def initialize: (untyped left, untyped right) -> void
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class StrictlyLeft < InfixOperation
|
|
42
|
+
def initialize: (untyped left, untyped right) -> void
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
class StrictlyRight < InfixOperation
|
|
46
|
+
def initialize: (untyped left, untyped right) -> void
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class DoesntRightExtend < InfixOperation
|
|
50
|
+
def initialize: (untyped left, untyped right) -> void
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class DoesntLeftExtend < InfixOperation
|
|
54
|
+
def initialize: (untyped left, untyped right) -> void
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class AdjacentTo < InfixOperation
|
|
58
|
+
def initialize: (untyped left, untyped right) -> void
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class MatchesLquery < InfixOperation
|
|
62
|
+
def initialize: (untyped left, untyped right) -> void
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class MatchesAnyLquery < InfixOperation
|
|
66
|
+
def initialize: (untyped left, untyped right) -> void
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class Node
|
|
70
|
+
include Torque::PostgreSQL::Arel::Math
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
module Attributes
|
|
75
|
+
class Attribute
|
|
76
|
+
include Torque::PostgreSQL::Arel::Math
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Arel
|
|
4
|
+
module JoinSource
|
|
5
|
+
attr_accessor only: bool?
|
|
6
|
+
|
|
7
|
+
def only?: () -> bool
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
module Arel
|
|
14
|
+
module Nodes
|
|
15
|
+
class JoinSource
|
|
16
|
+
include Torque::PostgreSQL::Arel::JoinSource
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
module Torque
|
|
2
|
+
module PostgreSQL
|
|
3
|
+
module Arel
|
|
4
|
+
module Nodes
|
|
5
|
+
class Cast < ::Arel::Nodes::Binary
|
|
6
|
+
include ::Arel::Expressions
|
|
7
|
+
include ::Arel::Predications
|
|
8
|
+
include ::Arel::AliasPredication
|
|
9
|
+
include ::Arel::OrderPredications
|
|
10
|
+
include ::Arel::Math
|
|
11
|
+
|
|
12
|
+
def initialize: (arel_node left, column_ref right, ?bool | Symbol array) -> void
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class Column < ::Arel::Nodes::Binary
|
|
16
|
+
include ::Arel::Expressions
|
|
17
|
+
include ::Arel::Predications
|
|
18
|
+
include ::Arel::AliasPredication
|
|
19
|
+
include ::Arel::OrderPredications
|
|
20
|
+
include ::Arel::Math
|
|
21
|
+
|
|
22
|
+
attr_reader type_caster: type_caster?
|
|
23
|
+
alias name right
|
|
24
|
+
|
|
25
|
+
def initialize: (arel_node source, column_ref name, type_caster? type_caster) -> void
|
|
26
|
+
def able_to_type_cast?: () -> true
|
|
27
|
+
def type_cast_for_database: (untyped value) -> untyped
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class Property < ::Arel::Nodes::Binary
|
|
31
|
+
include ::Arel::Expressions
|
|
32
|
+
include ::Arel::Predications
|
|
33
|
+
include ::Arel::AliasPredication
|
|
34
|
+
include ::Arel::OrderPredications
|
|
35
|
+
include ::Arel::Math
|
|
36
|
+
|
|
37
|
+
attr_reader type_caster: type_caster?
|
|
38
|
+
attr_reader cast: column_ref?
|
|
39
|
+
alias path right
|
|
40
|
+
|
|
41
|
+
def initialize: (arel_node source, path_key key, type_caster? type_caster, ?column_ref? cast) -> void
|
|
42
|
+
def name: () -> String
|
|
43
|
+
def able_to_type_cast?: () -> true
|
|
44
|
+
def type_cast_for_database: (untyped value) -> untyped
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
class CrossJoin < ::Arel::Nodes::Join
|
|
48
|
+
def initialize: (arel_node left, ?arel_node? right) -> void
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
class FromItem < ::Arel::Nodes::Binary
|
|
52
|
+
attr_reader columns: Array[column_ref]?
|
|
53
|
+
attr_reader definitions: Hash[column_ref, String?]?
|
|
54
|
+
attr_reader ordinality: String?
|
|
55
|
+
attr_reader lateral: bool
|
|
56
|
+
alias name right
|
|
57
|
+
|
|
58
|
+
def initialize: (arel_node source, column_ref name, ?columns: Array[column_ref] | column_ref | nil, ?definitions: Hash[column_ref, String?]?, ?ordinality: column_ref?, ?lateral: bool) -> void
|
|
59
|
+
def rows_from?: () -> bool
|
|
60
|
+
def alias_columns: () -> Hash[column_ref, String?]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class Ref < ::Arel::Nodes::Unary
|
|
64
|
+
attr_reader reference: arel_node?
|
|
65
|
+
alias to_s expr
|
|
66
|
+
|
|
67
|
+
def initialize: (String | arel_node expr, ?arel_node? reference) -> void
|
|
68
|
+
def as: (column_ref other) -> ::Arel::Nodes::As
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
module Arel
|
|
76
|
+
def self.array: (*untyped values, ?cast: Torque::PostgreSQL::column_ref?) -> (::Arel::Nodes::Quoted | Torque::PostgreSQL::Arel::Nodes::Cast)
|
|
77
|
+
|
|
78
|
+
module Nodes
|
|
79
|
+
class Function
|
|
80
|
+
include ::Arel::Math
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|