Skip to content

Documentation


Documentation / @blazetrails/arel / Attribute

Class: Attribute ​

Defined in: packages/arel/lib/attributes/attribute.ts:25

Extends ​

  • StructInstance<this> & Record<"relation" | "name", unknown>.Omit<PredicationsModule, "between" | "notBetween" | "isInfinity" | "isUnboundable" | "isOpenEnded">.ExpressionsModule.AliasPredicationModule.OrderPredicationsModule.MathModule

Constructors ​

Constructor ​

new Attribute(relation, name): Attribute

Defined in: packages/arel/lib/attributes/attribute.ts:29

Parameters ​

ParameterType
relationRelationLike | null
namestring | ArelNode | null

Returns ​

Attribute

Overrides ​

Struct.new("relation", "name").constructor

Properties ​

name ​

readonly name: string | ArelNode | null

Defined in: packages/arel/lib/attributes/attribute.ts:27

Overrides ​

Struct.new("relation", "name").name


relation ​

readonly relation: RelationLike

Defined in: packages/arel/lib/attributes/attribute.ts:26

Overrides ​

Struct.new("relation", "name").relation

Accessors ​

typeCaster ​

Get Signature ​

get typeCaster(): unknown

Defined in: packages/arel/lib/attributes/attribute.ts:33

Returns ​

unknown

Methods ​

add() ​

add(other): Grouping

Defined in: packages/arel/lib/math.ts:10

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


as() ​

as(other): As

Defined in: packages/arel/lib/alias-predication.ts:7

Parameters ​

ParameterType
otherstring | SqlLiteral

Returns ​

As


asc() ​

asc(): Ascending

Defined in: packages/arel/lib/order-predications.ts:7

Returns ​

Ascending


average() ​

average(): Avg

Defined in: packages/arel/lib/expressions.ts:12

Returns ​

Avg


between() ​

between(other): Node

Defined in: packages/arel/lib/attributes/attribute.ts:67

Parameters ​

ParameterType
otherRangeLike

Returns ​

Node


bitwiseAnd() ​

bitwiseAnd(other): Grouping

Defined in: packages/arel/lib/math.ts:13

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


bitwiseNot() ​

bitwiseNot(): BitwiseNot

Defined in: packages/arel/lib/math.ts:18

Returns ​

BitwiseNot


bitwiseOr() ​

bitwiseOr(other): Grouping

Defined in: packages/arel/lib/math.ts:14

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


bitwiseShiftLeft() ​

bitwiseShiftLeft(other): Grouping

Defined in: packages/arel/lib/math.ts:16

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


bitwiseShiftRight() ​

bitwiseShiftRight(other): Grouping

Defined in: packages/arel/lib/math.ts:17

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


bitwiseXor() ​

bitwiseXor(other): Grouping

Defined in: packages/arel/lib/math.ts:15

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


concat() ​

concat(other): Concat

Defined in: packages/arel/lib/predications.ts:162

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Concat


contains() ​

contains(other): Contains

Defined in: packages/arel/lib/predications.ts:163

Parameters ​

ParameterType
otherunknown

Returns ​

Contains


count() ​

count(distinct?): Count

Defined in: packages/arel/lib/expressions.ts:8

Parameters ​

ParameterType
distinct?boolean | null

Returns ​

Count


desc() ​

desc(): Descending

Defined in: packages/arel/lib/order-predications.ts:8

Returns ​

Descending


divide() ​

divide(other): Division

Defined in: packages/arel/lib/math.ts:12

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Division


doesNotMatch() ​

doesNotMatch(other, escape?, caseSensitive?): DoesNotMatch

Defined in: packages/arel/lib/predications.ts:130

Parameters ​

ParameterType
otherunknown
escape?string | Node | null
caseSensitive?boolean

Returns ​

DoesNotMatch


doesNotMatchAll() ​

doesNotMatchAll(others, escape?): Grouping

Defined in: packages/arel/lib/predications.ts:156

Parameters ​

ParameterType
othersstring[]
escape?string | Node | null

Returns ​

Grouping


doesNotMatchAny() ​

doesNotMatchAny(others, escape?): Grouping

Defined in: packages/arel/lib/predications.ts:155

Parameters ​

ParameterType
othersstring[]
escape?string | Node | null

Returns ​

Grouping


doesNotMatchRegexp() ​

doesNotMatchRegexp(other, caseSensitive?): NotRegexp

Defined in: packages/arel/lib/predications.ts:136

Parameters ​

ParameterType
otherstring
caseSensitive?boolean

Returns ​

NotRegexp


eq() ​

eq(other): Equality

Defined in: packages/arel/lib/predications.ts:121

Parameters ​

ParameterType
otherunknown

Returns ​

Equality


eqAll() ​

eqAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:142

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


eqAny() ​

eqAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:141

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


eql() ​

eql(other): boolean

Defined in: packages/ruby-compat/dist/struct.d.ts:12

Parameters ​

ParameterType
otherunknown

Returns ​

boolean

Inherited from ​

Struct.new("relation", "name").eql


equals() ​

equals(other): boolean

Defined in: packages/ruby-compat/dist/struct.d.ts:11

Parameters ​

ParameterType
otherunknown

Returns ​

boolean

Inherited from ​

Struct.new("relation", "name").equals


extract() ​

extract(field): Extract

Defined in: packages/arel/lib/expressions.ts:13

Parameters ​

ParameterType
fieldstring

Returns ​

Extract


gt() ​

gt(right): GreaterThan

Defined in: packages/arel/lib/predications.ts:123

Parameters ​

ParameterType
rightunknown

Returns ​

GreaterThan


gtAll() ​

gtAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:146

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


gtAny() ​

gtAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:145

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


gteq() ​

gteq(right): GreaterThanOrEqual

Defined in: packages/arel/lib/predications.ts:124

Parameters ​

ParameterType
rightunknown

Returns ​

GreaterThanOrEqual


gteqAll() ​

gteqAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:148

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


gteqAny() ​

gteqAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:147

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


hash() ​

hash(): number

Defined in: packages/ruby-compat/dist/struct.d.ts:13

Returns ​

number

Inherited from ​

Struct.new("relation", "name").hash


in() ​

in(other): In

Defined in: packages/arel/lib/predications.ts:137

Parameters ​

ParameterType
otherunknown

Returns ​

In


inAll() ​

inAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:158

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


inAny() ​

inAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:157

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


initializeCopy() ​

initializeCopy(s): this

Defined in: packages/ruby-compat/dist/struct.d.ts:10

Parameters ​

ParameterType
sStructInstance

Returns ​

this

Inherited from ​

Struct.new("relation", "name").initializeCopy


isAbleToTypeCast() ​

isAbleToTypeCast(): boolean

Defined in: packages/arel/lib/attributes/attribute.ts:45

Returns ​

boolean


isDistinctFrom() ​

isDistinctFrom(other): IsDistinctFrom

Defined in: packages/arel/lib/predications.ts:127

Parameters ​

ParameterType
otherunknown

Returns ​

IsDistinctFrom


isNotDistinctFrom() ​

isNotDistinctFrom(other): IsNotDistinctFrom

Defined in: packages/arel/lib/predications.ts:128

Parameters ​

ParameterType
otherunknown

Returns ​

IsNotDistinctFrom


lower() ​

lower(): NamedFunction

Defined in: packages/arel/lib/attributes/attribute.ts:37

Returns ​

NamedFunction


lt() ​

lt(right): LessThan

Defined in: packages/arel/lib/predications.ts:125

Parameters ​

ParameterType
rightunknown

Returns ​

LessThan


ltAll() ​

ltAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:150

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


ltAny() ​

ltAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:149

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


lteq() ​

lteq(right): LessThanOrEqual

Defined in: packages/arel/lib/predications.ts:126

Parameters ​

ParameterType
rightunknown

Returns ​

LessThanOrEqual


lteqAll() ​

lteqAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:152

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


lteqAny() ​

lteqAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:151

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


matches() ​

matches(other, escape?, caseSensitive?): Matches

Defined in: packages/arel/lib/predications.ts:129

Parameters ​

ParameterType
otherunknown
escape?string | Node | null
caseSensitive?boolean

Returns ​

Matches


matchesAll() ​

matchesAll(others, escape?, caseSensitive?): Grouping

Defined in: packages/arel/lib/predications.ts:154

Parameters ​

ParameterType
othersstring[]
escape?string | Node | null
caseSensitive?boolean

Returns ​

Grouping


matchesAny() ​

matchesAny(others, escape?, caseSensitive?): Grouping

Defined in: packages/arel/lib/predications.ts:153

Parameters ​

ParameterType
othersstring[]
escape?string | Node | null
caseSensitive?boolean

Returns ​

Grouping


matchesRegexp() ​

matchesRegexp(other, caseSensitive?): Regexp

Defined in: packages/arel/lib/predications.ts:135

Parameters ​

ParameterType
otherstring
caseSensitive?boolean

Returns ​

Regexp


maximum() ​

maximum(): Max

Defined in: packages/arel/lib/expressions.ts:10

Returns ​

Max


members() ​

members(): string[]

Defined in: packages/ruby-compat/dist/struct.d.ts:9

Returns ​

string[]

Inherited from ​

Struct.new("relation", "name").members


minimum() ​

minimum(): Min

Defined in: packages/arel/lib/expressions.ts:11

Returns ​

Min


multiply() ​

multiply(other): Multiplication

Defined in: packages/arel/lib/math.ts:9

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Multiplication


notBetween() ​

notBetween(other): Node

Defined in: packages/arel/lib/attributes/attribute.ts:68

Parameters ​

ParameterType
otherRangeLike

Returns ​

Node


notEq() ​

notEq(other): NotEqual

Defined in: packages/arel/lib/predications.ts:122

Parameters ​

ParameterType
otherunknown

Returns ​

NotEqual


notEqAll() ​

notEqAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:144

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


notEqAny() ​

notEqAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:143

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


notIn() ​

notIn(other): NotIn

Defined in: packages/arel/lib/predications.ts:138

Parameters ​

ParameterType
otherunknown

Returns ​

NotIn


notInAll() ​

notInAll(others): Grouping

Defined in: packages/arel/lib/predications.ts:160

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


notInAny() ​

notInAny(others): Grouping

Defined in: packages/arel/lib/predications.ts:159

Parameters ​

ParameterType
othersunknown[]

Returns ​

Grouping


overlaps() ​

overlaps(other): Overlaps

Defined in: packages/arel/lib/predications.ts:164

Parameters ​

ParameterType
otherunknown

Returns ​

Overlaps


subtract() ​

subtract(other): Grouping

Defined in: packages/arel/lib/math.ts:11

Parameters ​

ParameterType
otherNodeOrValue

Returns ​

Grouping


sum() ​

sum(): Sum

Defined in: packages/arel/lib/expressions.ts:9

Returns ​

Sum


toA() ​

toA(): unknown[]

Defined in: packages/ruby-compat/dist/struct.d.ts:14

Returns ​

unknown[]

Inherited from ​

Struct.new("relation", "name").toA


toH() ​

toH(block?): Record<string, unknown>

Defined in: packages/ruby-compat/dist/struct.d.ts:15

Parameters ​

ParameterType
block?(k, v) => [unknown, unknown]

Returns ​

Record<string, unknown>

Inherited from ​

Struct.new("relation", "name").toH


typeCastForDatabase() ​

typeCastForDatabase(value): unknown

Defined in: packages/arel/lib/attributes/attribute.ts:41

Parameters ​

ParameterType
valueunknown

Returns ​

unknown


when() ​

when(right): Case

Defined in: packages/arel/lib/predications.ts:161

Parameters ​

ParameterType
rightunknown

Returns ​

Case