module Ktistec::Rule

Defined in:

framework/rule.cr

Class Method Summary

Macro Summary

Class Method Detail

def self.condition(table : String, column : String, expression : School::Expression, bindings : School::Bindings, block : School::DomainTypes -> SupportedType | Nil) : ConditionPair | Nil #

Returns a SQL condition and values given an expression. The supplied function must return an appropriate supported type (or nil) given a rules domain type.


[View source]

Macro Detail

macro make_pattern(name, clazz, associations = nil, properties = nil) #

Makes a pattern class given a model class.

Ktistec::Rule.make_pattern( PatternClass, ModelClass, associations: [child_of], properties: [id, name] )

In order to perform a match operation, pattern classes have to transform literals and bound values into the types the SQLite client library understands. This imposes constraints on types that participating model properties may use. In the example above, properties id and name must be one of the supported types.


[View source]