interface QueryInterface (View source)

Methods

Add
add(array $updates, string $class, boolean $append)

Adds a relation in a link-list|set.

Alter
alter(string $class, string $attribute, string $value)

Alters an attribute of a class.

Alter
alterProperty(string $class, string $property, string $attribute, string $value)

Alters the $property of $class setting $sttribute to $value.

andWhere(string $condition, mixed $value)

Adds a where condition to the query.

between(string $key, string $left, string $right)

Converts a "normal" select into an index one.

mixed
create($class, $property)

Executes a CREATE of a $class, or of the $property in the given $class if $property is specified.

Delete
delete(string $from)

Executes a DELETE SQL query on the given class (= $from).

mixed
drop(string $class, string $property)

Drops a $class, or the $property in the given $class if $property is specified.

fields(array $fields, boolean $append)

Sets the fields to query.

from(array $target, boolean $append)

Adds a from clause to the query.

String
getRaw()

Returns the raw SQL query statement.

array
getTokens()

Returns the tokens associated to the current query.

Grant
grant(string $permission)

Converts the query into an GRANT with the given $permission.

Find
findReferences(string $rid, array $classes, boolean $append)

Finds documents referencing the document with the given $rid.

mixed
in(array $in, boolean $append)

Sets the classes in which the query performs is operation.

index(string $property, string $class, string $type)

Creates a index

indexCount(string $indexName)

Count the elements of the index $indexName.

indexPut(string $indexName, string $key, string $rid)

Puts a new entry in the index $indexName with the given $key and $rid.

indexRemove(string $indexName, string $key, string $rid)

Removes the index $indexName with the given $key/$rid.

insert()

Converts the query into an INSERT.

into(string $target)

Inserts the INTO clause to a query.

$this
limit($limit)

Adds a limit to the current query.

$this
skip($records)

Adds a skip clause to the current query.

Link
link(string $class, string $property, string $alias, boolean $inverse)

Sets the internal command to a LINK, which is capable to create a reference from the $property of $class, with a given $alias.

on(string $on)

Sets the ON clause of a query.

orderBy(array $order, boolean $append, boolean $first)

Orders the query.

orWhere(string $condition, mixed $value)

Adds an OR clause to the query.

Remove
remove(array $updates, string $class, boolean $append)

Removes a link from a link-set|list.

resetWhere()

Resets the WHERE conditions.

Revoke
revoke(string $permission)

Converts the query into an REVOKE with the given $permission.

select(array $projections, boolean $append)

Adds an array of fields into the select part of the query.

type(string $type)

Sets the type clause of a query.

to(string $to)

Adds a subject to the query.

Insert
values(array $values, boolean $append)

Sets the values to be inserted into the current query.

unindex(string $property, string $class)

Removes a index

put(array $values, $class, $append)

No description

update($class)

No description

where(string $condition, mixed $value = null)

Adds the WHERE clause.

Details

Add add(array $updates, string $class, boolean $append)

Adds a relation in a link-list|set.

Parameters

array $updates
string $class
boolean $append

Return Value

Add

Alter alter(string $class, string $attribute, string $value)

Alters an attribute of a class.

Parameters

string $class
string $attribute
string $value

Return Value

Alter

Alter alterProperty(string $class, string $property, string $attribute, string $value)

Alters the $property of $class setting $sttribute to $value.

Parameters

string $class
string $property
string $attribute
string $value

Return Value

Alter

andWhere(string $condition, mixed $value)

Adds a where condition to the query.

Parameters

string $condition
mixed $value

between(string $key, string $left, string $right)

Converts a "normal" select into an index one.

You use do a select on an index you can use the between operator.

Parameters

string $key
string $left
string $right

mixed create($class, $property)

Executes a CREATE of a $class, or of the $property in the given $class if $property is specified.

Parameters

$class
$property

Return Value

mixed

Delete delete(string $from)

Executes a DELETE SQL query on the given class (= $from).

Parameters

string $from

Return Value

Delete

mixed drop(string $class, string $property)

Drops a $class, or the $property in the given $class if $property is specified.

Parameters

string $class
string $property

Return Value

mixed

Query fields(array $fields, boolean $append)

Sets the fields to query.

Parameters

array $fields
boolean $append

Return Value

Query

from(array $target, boolean $append)

Adds a from clause to the query.

Parameters

array $target
boolean $append

String getRaw()

Returns the raw SQL query statement.

Return Value

String

array getTokens()

Returns the tokens associated to the current query.

Return Value

array

Grant grant(string $permission)

Converts the query into an GRANT with the given $permission.

Parameters

string $permission

Return Value

Grant

Find findReferences(string $rid, array $classes, boolean $append)

Finds documents referencing the document with the given $rid.

You can specify to look for only certain $classes, that can be appended.

Parameters

string $rid
array $classes
boolean $append

Return Value

Find

mixed in(array $in, boolean $append)

Sets the classes in which the query performs is operation.

For example a FIND REFERENCES uses the IN in order to find documents referencing to a given document in N classes.

Parameters

array $in
boolean $append

Return Value

mixed

Query index(string $property, string $class, string $type)

Creates a index

Parameters

string $property
string $class
string $type

Return Value

Query

indexCount(string $indexName)

Count the elements of the index $indexName.

Parameters

string $indexName

indexPut(string $indexName, string $key, string $rid)

Puts a new entry in the index $indexName with the given $key and $rid.

Parameters

string $indexName
string $key
string $rid

indexRemove(string $indexName, string $key, string $rid)

Removes the index $indexName with the given $key/$rid.

Parameters

string $indexName
string $key
string $rid

Query insert()

Converts the query into an INSERT.

Return Value

Query

Query into(string $target)

Inserts the INTO clause to a query.

Parameters

string $target

Return Value

Query

$this limit($limit)

Adds a limit to the current query.

Parameters

$limit

Return Value

$this

$this skip($records)

Adds a skip clause to the current query.

Parameters

$records

Return Value

$this

Sets the internal command to a LINK, which is capable to create a reference from the $property of $class, with a given $alias.

You can specify if the link is one-* or two-way with the $inverse parameter.

Parameters

string $class
string $property
string $alias
boolean $inverse

Return Value

Link

Query on(string $on)

Sets the ON clause of a query.

Parameters

string $on

Return Value

Query

orderBy(array $order, boolean $append, boolean $first)

Orders the query.

Parameters

array $order
boolean $append
boolean $first

orWhere(string $condition, mixed $value)

Adds an OR clause to the query.

Parameters

string $condition
mixed $value

Remove remove(array $updates, string $class, boolean $append)

Removes a link from a link-set|list.

Parameters

array $updates
string $class
boolean $append

Return Value

Remove

resetWhere()

Resets the WHERE conditions.

Revoke revoke(string $permission)

Converts the query into an REVOKE with the given $permission.

Parameters

string $permission

Return Value

Revoke

select(array $projections, boolean $append)

Adds an array of fields into the select part of the query.

Parameters

array $projections
boolean $append

Query type(string $type)

Sets the type clause of a query.

Parameters

string $type

Return Value

Query

Query to(string $to)

Adds a subject to the query.

Parameters

string $to

Return Value

Query

Insert values(array $values, boolean $append)

Sets the values to be inserted into the current query.

Parameters

array $values
boolean $append

Return Value

Insert

Query unindex(string $property, string $class)

Removes a index

Parameters

string $property
string $class

Return Value

Query

put(array $values, $class, $append)

Parameters

array $values
$class
$append

update($class)

Parameters

$class

where(string $condition, mixed $value = null)

Adds the WHERE clause.

Parameters

string $condition
mixed $value