System meta-data
The data that the system internally uses for maintaining the database is exposed to OSQL and can be queried in terms of types and functions as other data. For example, the types and functions used in the database are accessible through system functions, so it is possible to search the database for types and functions and how they relate.
Accessing function signatures
The function arguments
returns a vector describing arguments of signature of resolvent r
:
arguments(Function r) -> Bag of Vector`
Each element in the vector is a triplet (vector) describing one of the arguments with structure [type,name,uniqueness]
where type
is the type of the argument, name
is the name of the argument, and uniqueness
is either key
or nonkey
depending on the declaration of the argument.
Example:
arguments(#'timespan');
returns the vector of vectors
[ [#[OID 371 "TIMEVAL"],"TV1","nonkey"],
[#[OID 371 "TIMEVAL"],"TV2","nonkey"] ]`
Analogous to arguments(f)
the function results(f)
returns a description of the results of function f
:
results(Function r) -> Bag of Vector
Functions
allfunctions()->Bag of Function f
All functions in database
allfunctions(Type t)->Bag of Function
All functions having argument or result of type t
allobjects()->Bag
All surrogate objects in the database
allobjects(Type t)->Bag o
All surrogate objects of type t
allsubtypes(Type t)->Type
All types under type t
in type hierarchy
allsupertypes(Type t)->Bag of Type
All supertypes above type t
in the type hierarchy
alltypes()->Bag of Type t
All non-parameterized types in database
argument_types(Function f)->Vector of Type
The argument types of function f
arity(Function f)->Integer
The number of arguments of function f
attributes(Type t)->Bag of Function
The generic names of all single argument functions of typet
calledby(Function f)->Bag of Function r
The functions calling function f
calledby_somehow(Function f)->Bag of Function
The functions calling f
directly or indirectly
calls(Function f)->Bag of Function
The functions called by function f
calls_somehow(Function f)->Bag of Function g
The functions called by function f
directly or indirectly
cardinality(Type t)->Integer
The number of objects of type t
deep_extent(Type tp)->Object
extent(Type t)->Object o
The objects belonging to type t
extent(Function f)->Bag of Vector
The tuples of function f
functionnamed(Charstring nm)->Function f
The function named nm
generic(Function r)->Function g
The generic function of function f
generic_name(Function f)->Charstring
The generic name of function f
kindoffunction(Function f)->Charstring
The kind of fuction f
as one of stored
, derived
, foreign
, or overloaded
methods(Type t)->Bag of Function
The functions having one argument of type t
name(Function f)->Charstring
The name of function f
name(Type t)->Charstring
the name of type t
resolvents(Function f)->Bag of Function
The resolvents of function f
resolvents(Charstring fn)->Bag of Function
The resolvents of the generic function named fn
resolventtype(Function f)->Type
The type of the first argument of resolvent f
result_types(Function f)->Vector of Type
The result types of function f
root_type(Type t)->Type
The root type of a parameterized type t
signature(Type t)->Charstring
The signature of type t
signature(Function f)->Bag of Charstring
The signature of resolvent f
or
the signatures of all resolvents of the generic function f
subtypes(Type t)->Bag of Type
The types one level below type t
in the type hierarchy
supertypes(Type t)->Type
The types one level above type t
in the type hierarchy
thefunction(Charstring fn)->Function
The function named fn
.
An error is raised if no function is named fn
thefunctions(Vector of Charstring fns)->Vector of Function
Vector of functions with names fns
theresolvent(Charstring fn)->Function
If fn
is the name of a resolvent return it.
If fn
is a generic function with a single resolvent return the resolvent.
Raise an error if there more than one resolvent of the genetic fn
thetbr(Function f,Charstring bpat)->Function
The TBR of function f
for binding pattern bpat
thetype(Charstring tn)->Type
The type named tn
.
An error is raised if no type is named tn
typenamed(Charstring nm)->Type t
The type named nm
typeof_object(Object o)->Type
typesof(Object)->Type
The types of object o
userfunction(Function f)->Boolean
Is function f
a user defined function?
userfunctions()->Bag of Function f
All user defined functions
userobject(Object o)->Boolean
Is o
a user defined object?
usersupertypes(Type t)->Bag of Type s
Find the user defined types above type t
in type hierarchy
usertype(Type t)->Boolean
Is type t
a user defined type?
usertypes()->Bag of Type t
All user defined types
vref(Object o,Object i)->Object
width(Function f)->Integer
The width of function f