Builder
class Builder extends Builder
Adapted from october\rain\database\QueryBuilder
Properties
protected string | $cacheKey | The key that should be used when caching the query. |
|
protected int | $cacheMinutes | The number of minutes to cache the query. |
|
protected array | $cacheTags | The tags for the query cache. |
|
protected bool | $cachingDuplicateQueries | Indicates whether duplicate queries are being cached in memory. |
|
array | $concats | The aliased concatenation columns. |
Methods
Get an array with the values of a given column.
Indicate that the query results should be cached forever.
Indicate that the results, if cached, should use the given cache tags.
No description
Check the memory cache before executing the query
Execute the query as a cached "select" statement.
Get the cache object with tags assigned, if applicable.
Get the cache key and cache minutes as an array.
Get a unique cache key for the complete query.
Generate the unique cache key for the query.
Get the Closure callback used when caching queries.
Retrieve the "count" result of the query, also strips off any orderBy clause.
Update a record in the database.
Delete a record from the database.
Insert a new record and get the value of the primary key.
Insert a new record into the database.
Insert new records or update the existing ones.
Run a truncate statement on the table.
Clear memory cache for the given table.
Flush the memory cache.
Enable the memory cache on the query.
Disable the memory cache on the query.
Determine whether we're caching duplicate queries.
Adds a concatenated column as an alias.
Details
at line 57
array
lists(string $column, string|null $key = null)
Get an array with the values of a given column.
at line 69
$this
remember(DateTime|int $minutes, string $key = null)
Indicate that the query results should be cached.
at line 83
Builder|Builder
rememberForever(string $key = null)
Indicate that the query results should be cached forever.
at line 94
$this
cacheTags(array|mixed $cacheTags)
Indicate that the results, if cached, should use the given cache tags.
at line 104
get($columns = ['*'])
No description
at line 123
protected array
getDuplicateCached(array $columns = ['*'])
Check the memory cache before executing the query
at line 151
array
getCached(array $columns = ['*'])
Execute the query as a cached "select" statement.
at line 190
protected CacheManager
getCache()
Get the cache object with tags assigned, if applicable.
at line 202
protected array
getCacheInfo()
Get the cache key and cache minutes as an array.
at line 212
string
getCacheKey()
Get a unique cache key for the complete query.
at line 222
string
generateCacheKey()
Generate the unique cache key for the query.
at line 235
protected Closure
getCacheCallback(array $columns)
Get the Closure callback used when caching queries.
at line 249
int
count(string $columns = '*')
Retrieve the "count" result of the query, also strips off any orderBy clause.
at line 268
int
update(array $values)
Update a record in the database.
at line 281
int
delete(mixed $id = null)
Delete a record from the database.
at line 295
int
insertGetId(array $values, string $sequence = null)
Insert a new record and get the value of the primary key.
at line 308
bool
insert(array $values)
Insert a new record into the database.
at line 323
int
upsert(array $values, array|string $uniqueBy, array|null $update = null)
Insert new records or update the existing ones.
at line 366
void
truncate()
Run a truncate statement on the table.
at line 379
Builder|Builder
clearDuplicateCache(string|null $table = null)
Clear memory cache for the given table.
at line 391
Builder|Builder
flushDuplicateCache()
Flush the memory cache.
at line 403
Builder|Builder
enableDuplicateCache()
Enable the memory cache on the query.
at line 415
Builder|Builder
disableDuplicateCache()
Disable the memory cache on the query.
at line 427
bool
cachingDuplicates()
Determine whether we're caching duplicate queries.
at line 439
$this
selectConcat(array $parts, string $as)
Adds a concatenated column as an alias.