Download the PHP package eden/sql without Composer
On this page you can find all versions of the php package eden/sql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sql
Eden Sql
- Install
- Introduction
- API
- bind
- collection
- delete
- deleteRows
- getBinds
- getConnection
- getLastInsertedId
- getModel
- getQueries
- getRow
- insert
- insertRow
- insertRows
- model
- query
- search
- select
- setBinds
- setCollection
- setModel
- setRow
- update
- updateRows
- Contributing
====
Install
composer install eden/sql
====
Introduction
SQL is an abstract package used in:
See these documentations for more details. The following API methods are common amongst all SQL type databases.
====
API
====
bind
Binds a value and returns the bound key
Usage
Parameters
*string|array|number|null $value
- What to bind
Returns string
Example
====
collection
Returns collection
Usage
Parameters
array $data
- Initial collection data
Returns Eden\Sql\Collection
Example
====
delete
Returns the delete query builder
Usage
Parameters
*string|null $table
- The table name
Returns Eden\Sql\Delete
Example
====
deleteRows
Removes rows that match a filter
Usage
Parameters
*string|null $table
- The table namearray|string $filters
- Filters to test against
Returns Eden\Sql\Collection
Example
====
getBinds
Returns all the bound values of this query
Usage
Parameters
Returns array
====
getConnection
Returns the connection object if no connection has been made it will attempt to make it
Usage
Parameters
Returns resource
- PDO connection resource
====
getLastInsertedId
Returns the last inserted id
Usage
Parameters
string|null $column
- A particular column name
Returns int
- the id
Example
====
getModel
Returns a model given the column name and the value
Usage
Parameters
*string $table
- Table name*string $name
- Column name*scalar|null $value
- Column value
Returns Eden\Sql\Model|null
Example
====
getQueries
Returns the history of queries made still in memory
Usage
Parameters
int|string|null $index
- A particular index to return
Returns array|null
- the queries
Example
====
getRow
Returns a 1 row result given the column name and the value
Usage
Parameters
*string $table
- Table name*string $name
- Column name*scalar|null $value
- Column value
Returns array|null
Example
====
insert
Returns the insert query builder
Usage
Parameters
string|null $table
- Name of table
Returns Eden\Sql\Insert
Example
====
insertRow
Inserts data into a table and returns the ID
Usage
Parameters
*string $table
- Table name*array $setting
- Key/value array matching table columnsbool|array $bind
- Whether to compute with binded variables
Returns Eden\Sql\Index
Example
====
insertRows
Inserts multiple rows into a table
Usage
Parameters
*string $table
- Table namearray $setting
- Key/value 2D array matching table columnsbool|array $bind
- Whether to compute with binded variables
Returns Eden\Sql\Index
Example
====
model
Returns model
Usage
Parameters
array $data
- The initial data to set
Returns Eden\Sql\Model
Example
====
query
Queries the database
Usage
Parameters
*string $query
- The query to ranarray $binds
- List of binded values
Returns array
Example
====
search
Returns search
Usage
Parameters
string|null $table
- Table name
Returns Eden\Sql\Search
Example
====
select
Returns the select query builder
Usage
Parameters
string|array $select
- Column list
Returns Eden\Sql\Select
Example
====
setBinds
Sets all the bound values of this query
Usage
Parameters
*array $binds
- key/values to bind
Returns Eden\Sql\Index
Example
====
setCollection
Sets default collection
Usage
Parameters
*string $collection
- Collection class name
Returns Eden\Sql\Index
Example
====
setModel
Sets the default model
Usage
Parameters
*string Model
- class name
Returns Eden\Sql\Index
Example
====
setRow
Sets only 1 row given the column name and the value
Usage
Parameters
*string $table
- Table name*string $name
- Column name*scalar|null $value
- Column value*array $setting
- Key/value array matching table columns
Returns Eden\Sql\Index
Example
====
update
Returns the update query builder
Usage
Parameters
string|null $table
- Name of table
Returns Eden\Sql\Update
Example
====
updateRows
Updates rows that match a filter given the update settings
Usage
Parameters
*string $table
- Table name*array $setting
- Key/value array matching table columnsarray|string $filters
- Filters to test againstbool|array $bind
- Whether to compute with binded variables
Returns Eden\Sql\Index
Example
====
Contributing to Eden
Contributions to Eden are following the Github work flow. Please read up before contributing.
Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.
All versions of sql with dependencies
eden/core Version 1.*
eden/type Version 1.*
eden/collection Version 1.*
eden/model Version 1.*