Download the PHP package grizz-it/dbal-sql without Composer
On this page you can find all versions of the php package grizz-it/dbal-sql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package dbal-sql
GrizzIT DBAL SQL
GrizzIT DBAL SQL provides a SQL implementation for GrizzIT DBAL. This package only implements the query assembly part.
Installation
To install the package run the following command:
Usage
Using filters
Some queries accept filters. Filters are used to narrow down the amount of
returned results. These filters are based on the QueryFilterInterface
from the
grizz-it/dbal
package.
Filters can be grouped in the QueryFilterGroup
object. All filters inside this
group are separated by an AND statement. If a query object accepts multiple filter
groups, the filter groups will be separated by an OR statement.
- QueryFilterGroup: The base filter object expected by most queries.
Filters can be added to the group after instantiation:
- ComparatorFilter: Compare a column to a value with a standard comparator.
- ExistsFilter: Adds an EXISTS statement with a sub-query as a filter.
- QueryInFilter: Connects a default comparator with a sub-query as a filter.
- QueryOperatorFilter: Create a ANY or ALL filter in combination with a comparator for a sub-query.
- RelationalComparatorFilter: Creates
a direct value injected filter. This filter does not use a parameter, but
operates similar to the
ComparatorFilter
.
Creating queries
Queries are created by instantiating and configuring and object, before passing it to the connection.
Traits
Some queries have shared logic and thus implement common traits.
- FilterableQueryTrait: This trait is implemented by queries that support filters.
- JoinableQueryTrait: This trait is implemented by queries that support joining multiple tables in a single query.
- PageableQueryTrait: This trait is
implemented by queries that support paging (
LIMIT
with(out) anOFFSET
). - SortableQueryTrait: This trait is implemented by queries that support sorting.
Enums
Some options and queries have a limitation in the options that can be passed to the object. Enums are used for this.
- ColumnAttributeEnum
- ColumnDefaultEnum
- ColumnTypeEnum
- ComparatorEnum
- IndexTypeEnum
- OperatorEnum
- ShowTypeEnum
- UnionEnum
Queries
The queries are sorted by their affecting goal. There are also a few standard queries which don't fit in any category.
- BatchQuery: Joins multiple queries for a single line execution.
- RawQuery: If none of the query object fit the bill, this object can be used to execute a custom query.
Context
- ShowQuery
- UseQuery
Data
- DeleteQuery
- InsertIntoSelectQuery
- InsertQuery
- SelectIntoQuery
- SelectQuery
- UnionQuery
- UpdateQuery
Database
- AlterDatabaseQuery
- BackupDatabaseQuery
- CreateDatabaseQuery
- DropDatabaseQuery
Table
- AbstractTableQuery: Forms the base for the other table queries.
- AlterTableQuery
- CreateTableQuery
- DropTableQuery
Column operations are defined through:
- ColumnDefinition
View
- CreateOrReplaceViewQuery
- CreateViewQuery
- DropViewQuery
Index
- CreateIndexQuery
- DropIndexQuery
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CODE_OF_CONDUCT for details.
MIT License
Copyright (c) GrizzIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.