Class FOFDatabaseQueryPostgresql
-
FOFDatabaseQuery
-
FOFDatabaseQueryPostgresql
implements
FOFDatabaseQueryLimitable
Methods summary
public
string
|
#
__toString( )
Magic function to convert the query to a string, only for postgresql specific
query
Magic function to convert the query to a string, only for postgresql specific
query
Returns
string - The completed query.
Since
11.3
Overrides
|
public
FOFDatabaseQueryPostgresql
|
#
clear( string $clause = null )
Clear data from the query or a specific clause of the query.
Clear data from the query or a specific clause of the query.
Parameters
- $clause
string - $clause Optionally, the name of the clause to clear, or nothing to clear the
whole query.
Returns
Since
11.3
Overrides
|
public
string
|
#
castAsChar( string $value )
Casts a value to a char.
Ensure that the value is properly quoted before passing to the method.
Usage: $query->select($query->castAsChar('a'));
Parameters
- $value
string - $value The value to cast as a char.
Returns
string - Returns the cast value.
Since
11.3
Overrides
|
public
string
|
#
concatenate( array $values, string $separator = null )
Concatenates an array of column names or values.
Concatenates an array of column names or values.
Usage: $query->select($query->concatenate(array('a', 'b')));
Parameters
- $values
array - $values An array of values to concatenate.
- $separator
string - $separator As separator to place between each value.
Returns
string - The concatenated values.
Since
11.3
Overrides
|
public
string
|
#
currentTimestamp( )
Gets the current date and time.
Gets the current date and time.
Returns
string - Return string used in query to obtain
Since
11.3
Overrides
|
public
FOFDatabaseQueryPostgresql
|
#
forUpdate( string $table_name, string $glue = ',' )
Sets the FOR UPDATE lock on select's output row
Sets the FOR UPDATE lock on select's output row
Parameters
- $table_name
string - $table_name The table to lock
- $glue
string - $glue The glue by which to join the conditions. Defaults to ',' .
Returns
Since
11.3
|
public
FOFDatabaseQueryPostgresql
|
#
forShare( string $table_name, string $glue = ',' )
Sets the FOR SHARE lock on select's output row
Sets the FOR SHARE lock on select's output row
Parameters
- $table_name
string - $table_name The table to lock
- $glue
string - $glue The glue by which to join the conditions. Defaults to ',' .
Returns
Since
11.3
|
public
string
|
#
year( string $date )
Used to get a string to extract year from date column.
Used to get a string to extract year from date column.
Usage:
$query->select($query->year($query->quoteName('dateColumn')));
Parameters
- $date
string - $date Date column containing year to be extracted.
Returns
string - Returns string to extract year from a date.
Since
12.1
Overrides
|
public
string
|
#
month( string $date )
Used to get a string to extract month from date column.
Used to get a string to extract month from date column.
Usage:
$query->select($query->month($query->quoteName('dateColumn')));
Parameters
- $date
string - $date Date column containing month to be extracted.
Returns
string - Returns string to extract month from a date.
Since
12.1
Overrides
|
public
string
|
#
day( string $date )
Used to get a string to extract day from date column.
Used to get a string to extract day from date column.
Usage:
$query->select($query->day($query->quoteName('dateColumn')));
Parameters
- $date
string - $date Date column containing day to be extracted.
Returns
string - Returns string to extract day from a date.
Since
12.1
Overrides
|
public
string
|
#
hour( string $date )
Used to get a string to extract hour from date column.
Used to get a string to extract hour from date column.
Usage:
$query->select($query->hour($query->quoteName('dateColumn')));
Parameters
- $date
string - $date Date column containing hour to be extracted.
Returns
string - Returns string to extract hour from a date.
Since
12.1
Overrides
|
public
string
|
#
minute( string $date )
Used to get a string to extract minute from date column.
Used to get a string to extract minute from date column.
Usage:
$query->select($query->minute($query->quoteName('dateColumn')));
Parameters
- $date
string - $date Date column containing minute to be extracted.
Returns
string - Returns string to extract minute from a date.
Since
12.1
Overrides
|
public
string
|
#
second( string $date )
Used to get a string to extract seconds from date column.
Used to get a string to extract seconds from date column.
Usage:
$query->select($query->second($query->quoteName('dateColumn')));
Parameters
- $date
string - $date Date column containing second to be extracted.
Returns
string - Returns string to extract second from a date.
Since
12.1
Overrides
|
public
FOFDatabaseQueryPostgresql
|
#
noWait( )
Sets the NOWAIT lock on select's output row
Sets the NOWAIT lock on select's output row
Returns
Since
11.3
|
public
FOFDatabaseQueryPostgresql
|
#
limit( integer $limit = 0 )
Set the LIMIT clause to the query
Set the LIMIT clause to the query
Parameters
- $limit
integer - $limit An int of how many row will be returned
Returns
Since
11.3
|
public
FOFDatabaseQueryPostgresql
|
#
offset( integer $offset = 0 )
Set the OFFSET clause to the query
Set the OFFSET clause to the query
Parameters
- $offset
integer - $offset An int for skipping row
Returns
Since
11.3
|
public
FOFDatabaseQueryPostgresql
|
#
returning( mixed $pkCol )
Add the RETURNING element to INSERT INTO statement.
Add the RETURNING element to INSERT INTO statement.
Parameters
- $pkCol
mixed - $pkCol The name of the primary key column.
Returns
Since
11.3
|
public
FOFDatabaseQueryPostgresql
|
#
setLimit( integer $limit = 0, integer $offset = 0 )
Sets the offset and limit for the result set, if the database driver supports
it.
Sets the offset and limit for the result set, if the database driver supports
it.
Usage: $query->setLimit(100, 0); (retrieve 100 rows, starting at first
record) $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th
record)
Parameters
- $limit
integer - $limit The limit for the result set
- $offset
integer - $offset The offset for the result set
Returns
Since
12.1
|
public
string
|
#
processLimit( string $query, integer $limit, integer $offset = 0 )
Method to modify a query already in string format with the needed additions
to make the query limited to a particular number of results, or start at a
particular offset.
Method to modify a query already in string format with the needed additions
to make the query limited to a particular number of results, or start at a
particular offset.
Parameters
- $query
string - $query The query in string format
- $limit
integer - $limit The limit for the result set
- $offset
integer - $offset The offset for the result set
Returns
string
Since
12.1
|
public
string
|
#
dateAdd( datetime $date, string $interval, string $datePart )
Add to the current date and time in Postgresql. Usage:
$query->select($query->dateAdd()); Prefixing the interval with a -
(negative sign) will cause subtraction to be used.
Add to the current date and time in Postgresql. Usage:
$query->select($query->dateAdd()); Prefixing the interval with a -
(negative sign) will cause subtraction to be used.
Parameters
- $date
datetime - $date The date to add to
- $interval
string - $interval The string representation of the appropriate number of units
- $datePart
string - $datePart The part of the date to perform the addition on
Returns
string - The string with the appropriate sql for addition of dates
Since
13.1
Link
Note
Not all drivers support all units. Check appropriate references
Overrides
|
public
string
|
#
regexp( string $value )
Return correct regexp operator for Postgresql.
Return correct regexp operator for Postgresql.
Ensure that the regexp operator is Postgresql compatible.
Usage: $query->where('field ' . $query->regexp($search));
Parameters
- $value
string - $value The regex pattern.
Returns
string - Returns the regex operator.
Since
11.3
|
public
string
|
#
Rand( )
Return correct rand() function for Postgresql.
Return correct rand() function for Postgresql.
Ensure that the rand() function is Postgresql compatible.
Usage: $query->Rand();
Returns
string - The correct rand function.
Since
3.5
|
__call()
,
__clone()
,
__construct()
,
__get()
,
call()
,
charLength()
,
columns()
,
dateFormat()
,
delete()
,
dump()
,
escape()
,
exec()
,
format()
,
from()
,
group()
,
having()
,
innerJoin()
,
insert()
,
join()
,
leftJoin()
,
length()
,
nullDate()
,
order()
,
outerJoin()
,
quote()
,
quoteName()
,
rightJoin()
,
select()
,
set()
,
setQuery()
,
union()
,
unionAll()
,
unionDistinct()
,
update()
,
values()
,
where()
Magic methods summary
e()
,
q()
,
qn()
Properties summary
protected
object
|
$forUpdate
|
#
The FOR UPDATE element used in "FOR UPDATE" lock
The FOR UPDATE element used in "FOR UPDATE" lock
Since
11.3
|
protected
object
|
$forShare
|
#
The FOR SHARE element used in "FOR SHARE" lock
The FOR SHARE element used in "FOR SHARE" lock
Since
11.3
|
protected
object
|
$noWait
|
#
The NOWAIT element used in "FOR SHARE" and "FOR UPDATE" lock
The NOWAIT element used in "FOR SHARE" and "FOR UPDATE" lock
Since
11.3
|
protected
object
|
$limit
|
#
The LIMIT element
Since
11.3
|
protected
object
|
$offset
|
#
The OFFSET element
Since
11.3
|
protected
object
|
$returning
|
#
The RETURNING element of INSERT INTO
The RETURNING element of INSERT INTO
Since
11.3
|
$autoIncrementField
,
$call
,
$columns
,
$db
,
$delete
,
$element
,
$exec
,
$from
,
$group
,
$having
,
$insert
,
$join
,
$order
,
$select
,
$set
,
$sql
,
$type
,
$union
,
$unionAll
,
$update
,
$values
,
$where
$group
,
$having
,
$select
,
$type