(->atomic-type name
nullable?
numeric?
ordered?
predicate
const->datum-fn
datum->const-fn
method-map-atom
data)
Positional factory function for class sqlosure.type.atomic-type.
Positional factory function for class sqlosure.type.atomic-type.
(->bounded-string-type max-size nullable?)
Positional factory function for class sqlosure.type.bounded-string-type.
Positional factory function for class sqlosure.type.bounded-string-type.
(->product-type components)
Positional factory function for class sqlosure.type.product-type.
Positional factory function for class sqlosure.type.product-type.
(->set-type member-type)
Positional factory function for class sqlosure.type.set-type.
Positional factory function for class sqlosure.type.set-type.
(->type-method name default-implementation)
Positional factory function for class sqlosure.type.type-method.
Positional factory function for class sqlosure.type.type-method.
(atomic-type-const->datum-fn atomic-type)
Access const->datum-fn
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `const->datum-fn` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-data atomic-type)
Access data
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `data` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-datum->const-fn atomic-type)
Access datum->const-fn
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `datum->const-fn` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-method-map-atom atomic-type)
Access method-map-atom
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `method-map-atom` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-name atomic-type)
Access name
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `name` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-nullable? atomic-type)
Access nullable?
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `nullable?` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-numeric? atomic-type)
Access numeric?
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `numeric?` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-ordered? atomic-type)
Access ordered?
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `ordered?` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type-predicate atomic-type)
Access predicate
field from a [[atomic-type]] record. See sqlosure.type/make-atomic-type
.
Access `predicate` field from a [[atomic-type]] record. See [[sqlosure.type/make-atomic-type]].
(atomic-type? thing)
Is object a atomic-type
record? See sqlosure.type/make-atomic-type
.
Is object a `atomic-type` record? See [[sqlosure.type/make-atomic-type]].
(base-type-name t)
Yield name of base type.
Yield name of base type.
Protocol for base types.
Protocol for base types.
(-contains? this val)
Does non-null value belong to this base type?
Does non-null value belong to this base type?
(-nullable? this)
Is this type nullable?
Is this type nullable?
(-ordered? this)
Is this type ordered?
Is this type ordered?
(-numeric? this)
Is this type numeric?
Is this type numeric?
(-const->datum this val)
Convert value to datum.
Convert value to datum.
(-method-map-atom this)
Get us an an atom pointing to a map of type-specific methods.
Get us an an atom pointing to a map of type-specific methods.
(-name this)
Get name of the type.
Get name of the type.
(-data this)
Domain-specific data, for outside use.
Domain-specific data, for outside use.
(-datum->const this datum)
Convert datum to value.
Convert datum to value.
(-nullable this)
Get us nullable version of this type.
Get us nullable version of this type.
(-non-nullable this)
Get us non-nullable version of this type.
Get us non-nullable version of this type.
(boolean? x)
Checks if a value if of type boolean. This includes booleans and nil.
Checks if a value if of type boolean. This includes booleans and nil.
(bounded-string-type-max-size bounded-string-type)
Access max-size
field from a [[bounded-string-type]] record. See sqlosure.type/really-make-bounded-string-type
.
Access `max-size` field from a [[bounded-string-type]] record. See [[sqlosure.type/really-make-bounded-string-type]].
(bounded-string-type-nullable? bounded-string-type)
Access nullable?
field from a [[bounded-string-type]] record. See sqlosure.type/really-make-bounded-string-type
.
Access `nullable?` field from a [[bounded-string-type]] record. See [[sqlosure.type/really-make-bounded-string-type]].
(bounded-string-type? thing)
Is object a bounded-string-type
record? See sqlosure.type/really-make-bounded-string-type
.
Is object a `bounded-string-type` record? See [[sqlosure.type/really-make-bounded-string-type]].
(const->datum t val)
const->datum
takes a type and a value and applies the types and returns the
corresponding clojure value. If the type or value are invalid, throws an
exception.
Example:
(const->datum string% "foobar") => "foobar"
(const->datum (make-product-type [string% integer%]) ["foo" 42]) => ["foo" 42]
`const->datum` takes a type and a value and applies the types and returns the corresponding clojure value. If the type or value are invalid, throws an exception. Example: * `(const->datum string% "foobar") => "foobar"` * `(const->datum (make-product-type [string% integer%]) ["foo" 42]) => ["foo" 42]`
(date? x)
checks whether a value is of type java.util.Date.
checks whether a value is of type java.util.Date.
(datum->const t d)
datum->const
takes a type and a datum and turns the datum in the
corresponding clojure data. If type is invalid or datum does not match the
type, throws an exception.
Example:
(datum->const double% 42) => 42
'(datum->const (make-set-type integer%) [42 23]) => [42 23]
`datum->const` takes a type and a datum and turns the datum in the corresponding clojure data. If type is invalid or datum does not match the type, throws an exception. Example: * `(datum->const double% 42) => 42`' * `(datum->const (make-set-type integer%) [42 23]) => [42 23]`
(datum->type d universe)
datum->type
takes a datum (as produced by type->datum
) and a universe and
returns the corresponding type. If the type is not a base type defined in
type.clj
, try looking it up in the supplied universe. If it's not found,
throws an exception.
Examples:
(datum->type (string) => string
(datum->type (product (string) (double))) => (make-product-type [string% double%])
`datum->type` takes a datum (as produced by `type->datum`) and a universe and returns the corresponding type. If the type is not a base type defined in `type.clj`, try looking it up in the supplied universe. If it's not found, throws an exception. Examples: * `(datum->type (string) => string` * `(datum->type (product (string) (double))) => (make-product-type [string% double%])`
(double? x)
checks if a value is of type double.
checks if a value is of type double.
(invoke-type-method ty method & args)
Looks up the type-method-implementation for ty and method and applies it's result (fn) to the rest-args.
Looks up the type-method-implementation for ty and method and applies it's result (fn) to the rest-args.
(make-atomic-type name
nullable?
numeric?
ordered?
predicate
const->datum-fn
datum->const-fn
method-map-atom
data)
Construct a atomic-type
record.
name
: access via sqlosure.type/atomic-type-name
nullable?
: access via sqlosure.type/atomic-type-nullable?
numeric?
: access via sqlosure.type/atomic-type-numeric?
ordered?
: access via sqlosure.type/atomic-type-ordered?
predicate
: access via sqlosure.type/atomic-type-predicate
const->datum-fn
: access via sqlosure.type/atomic-type-const->datum-fn
datum->const-fn
: access via sqlosure.type/atomic-type-datum->const-fn
method-map-atom
: access via sqlosure.type/atomic-type-method-map-atom
data
: access via sqlosure.type/atomic-type-data
Construct a `atomic-type` record. `name`: access via [[sqlosure.type/atomic-type-name]] `nullable?`: access via [[sqlosure.type/atomic-type-nullable?]] `numeric?`: access via [[sqlosure.type/atomic-type-numeric?]] `ordered?`: access via [[sqlosure.type/atomic-type-ordered?]] `predicate`: access via [[sqlosure.type/atomic-type-predicate]] `const->datum-fn`: access via [[sqlosure.type/atomic-type-const->datum-fn]] `datum->const-fn`: access via [[sqlosure.type/atomic-type-datum->const-fn]] `method-map-atom`: access via [[sqlosure.type/atomic-type-method-map-atom]] `data`: access via [[sqlosure.type/atomic-type-data]]
(make-base-type name
predicate
const->datum-proc
datum->const-proc
&
{:keys [universe numeric? ordered? data]
:or [universe nil numeric? false ordered? false data nil]})
Returns a new base type as specified.
If :universe is supplied, the new type will be registered in the universe and
this function returns a vector containing [type universe]
.
Returns a new base type as specified. If :universe is supplied, the new type will be registered in the universe and this function returns a vector containing `[type universe]`.
(make-bounded-string-type max-size)
Create string type with given maximum number of chars.
Create string type with given maximum number of chars.
(make-nullable-type base)
Make type nullable.
Make type nullable.
(make-product-type components)
Construct a product-type
record.
components
: access via sqlosure.type/product-type-components
Construct a `product-type` record. `components`: access via [[sqlosure.type/product-type-components]]
(make-set-type member-type)
Construct a set-type
record.
member-type
: access via sqlosure.type/set-type-member-type
Construct a `set-type` record. `member-type`: access via [[sqlosure.type/set-type-member-type]]
(map->atomic-type m__7585__auto__)
Factory function for class sqlosure.type.atomic-type, taking a map of keywords to field values.
Factory function for class sqlosure.type.atomic-type, taking a map of keywords to field values.
(map->bounded-string-type m__7585__auto__)
Factory function for class sqlosure.type.bounded-string-type, taking a map of keywords to field values.
Factory function for class sqlosure.type.bounded-string-type, taking a map of keywords to field values.
(map->product-type m__7585__auto__)
Factory function for class sqlosure.type.product-type, taking a map of keywords to field values.
Factory function for class sqlosure.type.product-type, taking a map of keywords to field values.
(map->set-type m__7585__auto__)
Factory function for class sqlosure.type.set-type, taking a map of keywords to field values.
Factory function for class sqlosure.type.set-type, taking a map of keywords to field values.
(map->type-method m__7585__auto__)
Factory function for class sqlosure.type.type-method, taking a map of keywords to field values.
Factory function for class sqlosure.type.type-method, taking a map of keywords to field values.
(non-nullable-type base)
Yield non-nullable version of type.
Yield non-nullable version of type.
(numeric-type? ty)
Is type numeric, in the sense of the server's capability to call standard operations like MAX and AVG on them.
Is type numeric, in the sense of the server's capability to call standard operations like MAX and AVG on them.
(ordered-type? ty)
Is type ordered, in the sense of the servers' capability to make an 'order by' on them.
Is type ordered, in the sense of the servers' capability to make an 'order by' on them.
(pair? v)
Returns true if v is a sequence not empty (like schemes pair? function).
Returns true if v is a sequence not empty (like schemes pair? function).
(product-type-components product-type)
Access components
field from a [[product-type]] record. See sqlosure.type/make-product-type
.
Access `components` field from a [[product-type]] record. See [[sqlosure.type/make-product-type]].
(product-type? thing)
Is object a product-type
record? See sqlosure.type/make-product-type
.
Is object a `product-type` record? See [[sqlosure.type/make-product-type]].
(really-make-bounded-string-type max-size nullable?)
Construct a bounded-string-type
record.
max-size
: access via sqlosure.type/bounded-string-type-max-size
nullable?
: access via sqlosure.type/bounded-string-type-nullable?
Construct a `bounded-string-type` record. `max-size`: access via [[sqlosure.type/bounded-string-type-max-size]] `nullable?`: access via [[sqlosure.type/bounded-string-type-nullable?]]
(really-make-type-method name default-implementation)
Construct a type-method
record.
name
: access via sqlosure.type/type-method-name
default-implementation
: access via sqlosure.type/type-method-default-implementation
Construct a `type-method` record. `name`: access via [[sqlosure.type/type-method-name]] `default-implementation`: access via [[sqlosure.type/type-method-default-implementation]]
(set-type-member-type set-type)
Access member-type
field from a [[set-type]] record. See sqlosure.type/make-set-type
.
Access `member-type` field from a [[set-type]] record. See [[sqlosure.type/make-set-type]].
(set-type? thing)
Is object a set-type
record? See sqlosure.type/make-set-type
.
Is object a `set-type` record? See [[sqlosure.type/make-set-type]].
(timestamp? d)
Returns true if d is a java.time.LocalDateTime.
Returns true if d is a java.time.LocalDateTime.
(type->datum t)
type->datum
takes a type and returns it into a recursive list of it's
subtypes. If the type
is invalid, raises assertion-violation.
Examples:
(type->datum string%) => (string)
(type->datum (make-product-type [string% double%])) => (product (string) (double)
`type->datum` takes a type and returns it into a recursive list of it's subtypes. If the `type` is invalid, raises assertion-violation. Examples: * `(type->datum string%) => (string)` * `(type->datum (make-product-type [string% double%])) => (product (string) (double)`
(type-member? thing ty)
Checks if thing
is a member of a type.
Checks if `thing` is a member of a type.
(type-method-default-implementation type-method)
Access default-implementation
field from a [[type-method]] record. See sqlosure.type/really-make-type-method
.
Access `default-implementation` field from a [[type-method]] record. See [[sqlosure.type/really-make-type-method]].
(type-method-name type-method)
Access name
field from a [[type-method]] record. See sqlosure.type/really-make-type-method
.
Access `name` field from a [[type-method]] record. See [[sqlosure.type/really-make-type-method]].
(type-method? thing)
Is object a type-method
record? See sqlosure.type/really-make-type-method
.
Is object a `type-method` record? See [[sqlosure.type/really-make-type-method]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close