Download the PHP package fyre/db without Composer

On this page you can find all versions of the php package fyre/db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db

FyreDB

FyreDB is a free, open-source database library for PHP.

Table Of Contents

Installation

Using Composer

In PHP:

Methods

Clear

Clear and close connections.

Get Config

Set a Connection config.

Alternatively, if the $key argument is omitted an array containing all configurations will be returned.

Get Key

Get the key for a Connection instance.

Has Config

Check if a Connection config exists.

Is Loaded

Check if a Connection instance is loaded.

Load

Load a Connection.

Set Config

Set the Connection config.

Alternatively, a single array can be provided containing key/value of configuration options.

Unload

Unload a Connection.

Use

Load a shared Connection instance.

Connections

You can load a specific connection handler by specifying the className option of the $options variable above.

Custom connection handlers can be created by extending \Fyre\DB\Connection, ensuring all below methods are implemented.

Custom handlers should also implement a generator method that returns a new QueryGenerator (if required) and a resultSetClass static method that returns the class name to use for results.

Affected Rows

Get the number of affected rows.

After Commit

Queue a callback to execute after the transaction is committed.

The callback will be executed immediately if there is no active transaction.

Begin

Begin a transaction.

Commit

Commit a transaction.

Connect

Connect to the database.

This method is called automatically when the Connection is created.

Delete

Create a DeleteQuery.

Disconnect

Disconnect from the database.

Execute

Execute a SQL query with bound parameters.

The SQL query can use either ? as a placeholder (for numerically indexed parameters), or the array key prefixed with :.

This method will return a ResultSet for SELECT queries. Other query types will return a boolean value.

Get Charset

Get the connection character set.

Get Error

Get the last connection error.

Get Savepoint Level

Get the transaction save point level.

In Transaction

Determine if a transaction is in progress.

Insert

Create an InsertQuery.

Insert From

Create an InsertFromQuery.

Insert ID

Get the last inserted ID.

When performing bulk inserts, this method will return the first ID for Sqlite.

Literal

Create a QueryLiteral.

Query

Execute a SQL query.

This method will return a ResultSet for SELECT queries. Other query types will return a boolean value.

Quote

Quote a string for use in SQL queries.

Replace

Create a ReplaceQuery.

This method is only supported for queries using a MysqlConnection or SqliteConnection.

Rollback

Rollback a transaction.

Select

Create a SelectQuery.

Non-numeric array keys will be used as field aliases.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Set Charset

Set the connection character set.

Transactional

Execute a callback inside a database transaction.

If the callback returns false or throws an Exception the transaction will be rolled back, otherwise it will be committed.

Update

Create an UpdateQuery.

Non-numeric array keys will be used as table aliases.

Update Batch

Create an UpdateBatchQuery.

Non-numeric array keys will be used as table aliases.

Version

Get the server version.

MySQL

The MySQL connection can be loaded using custom configuration.

Get Collation

Get the connection collation.

Postgres

The Postgres connection can be loaded using custom configuration.

Set Schema

Set the connection schema.

Sqlite

The Sqlite connection can be loaded using custom configuration.

Queries

The \Fyre\DB\Query class provides base methods related to building queries, and is extended by the query type classes below.

Execute

Execute the query.

This method will return a ResultSet for SELECT queries. Other query types will return a boolean value.

Connection

Get the Connection.

Get Table

Get the table(s).

Sql

Generate the SQL query.

Table

Set the table(s).

Non-numeric array keys will be used as table aliases.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection.

Delete

The \Fyre\DB\Queries\DeleteQuery class extends the Query class, while providing additional methods for executing DELETE queries.

Multiple tables is only supported for queries using a MysqlConnection.

Alias

Set the delete alias(es).

This method is only supported for queries using a MysqlConnection.

Epilog

Set the epilog.

From

Set the FROM table(s).

Non-numeric array keys will be used as table aliases.

Get Alias

Get the delete alias(es).

Get Epilog

Get the epilog.

Get From

Get the FROM table(s).

Get Join

Get the JOIN tables.

Get Limit

Get the LIMIT clause.

Get Order By

Get the ORDER BY fields.

Get Using

Get the USING tables.

Get Where

Get the WHERE conditions.

Join

Set the JOIN tables.

Each join array can contain a table, alias, type and an array of conditions. If the type is not specified it will default to INNER.

This method is only supported for queries using a MysqlConnection.

Limit

Set the LIMIT clause.

Order By

Set the ORDER BY fields.

Using

Set the USING tables.

This method is only supported for queries using a PostgresConnection.

Where

Set the WHERE conditions.

Array conditions can contain:

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Insert

The \Fyre\DB\Queries\InsertQuery class extends the Query class, while providing additional methods for executing INSERT queries.

Epilog

Set the epilog.

Get Epilog

Get the epilog.

Get Into

Get the INTO table.

Get Values

Get the REPLACE data.

Into

Set the INTO table.

Values

Array keys will be used for the column names, and the values will be escaped automatically.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Insert From

The \Fyre\DB\Queries\InsertFromQuery class extends the Query class, while providing additional methods for executing INSERT queries from SELECT queries.

Epilog

Set the epilog.

Get Epilog

Get the epilog.

Get Into

Get the INTO table.

Into

Set the INTO table.

Replace

The \Fyre\DB\Queries\ReplaceQuery class extends the Query class, while providing additional methods for executing REPLACE queries.

Epilog

Set the epilog.

Get Epilog

Get the epilog.

Get Into

Get the INTO table.

Get Values

Get the REPLACE data.

Into

Set the INTO table.

Values

Array keys will be used for the column names, and the values will be escaped automatically.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Select

The \Fyre\DB\Queries\SelectQuery class extends the Query class, while providing additional methods for executing SELECT queries.

Distinct

Set the DISTINCT clause.

Epilog

Set the epilog.

Except

Add an EXCEPT query.

From

Set the FROM table(s).

Non-numeric array keys will be used as table aliases.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection.

Get Distinct

Get the DISTINCT clause.

Get Epilog

Get the epilog.

Get Group By

Get the GROUP BY fields.

Get From

Get the FROM table(s).

Get Having

Get the HAVING conditions.

Get Join

Get the JOIN tables.

Get Limit

Get the LIMIT clause.

Get Offset

Get the OFFSET clause.

Get Order By

Get the ORDER BY fields.

Get Select

Get the SELECT fields.

Get Union

Get the UNION queries.

Get Where

Get the WHERE conditions.

Get With

Get the WITH queries.

Group By

Set the GROUP BY fields.

Having

Set the HAVING conditions.

Array conditions can contain:

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Intersect

Add an INTERSECT query.

Join

Set the JOIN tables.

Each join array can contain a table, alias, type and an array of conditions. If the type is not specified it will default to INNER.

Limit

Set the LIMIT and OFFSET clauses.

Offset

Set the OFFSET clause.

Order By

Set the ORDER BY fields.

Select

Set the SELECT fields.

Non-numeric array keys will be used as field aliases.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Union

Add a UNION DISTINCT query.

Union All

Add a UNION ALL query.

Where

Set the WHERE conditions.

Array conditions can contain:

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

With

Set the WITH clause.

Array keys will be used as table aliases.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection.

With Recursive

Set the WITH RECURSIVE clause.

Array keys will be used as table aliases.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection.

Update

The \Fyre\DB\Queries\UpdateQuery class extends the Query class, while providing additional methods for executing UPDATE queries.

Multiple tables is only supported for queries using a MysqlConnection.

Epilog

Set the epilog.

From

Set the FROM tables.

This method is only supported for queries using a PostgresConnection or SqliteConnection.

Get Data

Get the UPDATE data.

Get Epilog

Get the epilog.

Get From

Get the FROM table(s).

Get Join

Get the JOIN tables.

Get Where

Get the WHERE conditions.

Join

Set the JOIN tables.

Each join array can contain a table, alias, type and an array of conditions. If the type is not specified it will default to INNER.

This method is only supported for queries using a MysqlConnection.

Set

Array keys will be used for the column names, and the values will be escaped automatically.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Where

Set the WHERE conditions.

Array conditions can contain:

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Update Batch

The \Fyre\DB\Queries\UpdateBatchQuery class extends the Query class, while providing additional methods for executing batch UPDATE queries.

Epilog

Set the epilog.

Get Data

Get the UPDATE data.

Get Epilog

Get the epilog.

Set

Array keys will be used for the column names, and the values will be escaped automatically.

If a SelectQuery or QueryLiteral is supplied as an array value they will be converted to a string and not escaped.

A Closure can also be supplied as an array value, where the first argument will be the Connection and the second argument will be the ValueBinder.

Results

SELECT queries will return a new ResultSet containing the results of the query.

The ResultSet is an implementation of an Iterator and can be used in a foreach loop.

All

Get the results as an array.

Clear Buffer

Clear the results from the buffer.

Alternatively, if the $index argument is omitted, the entire buffer will be cleared.

Column Count

Get the column count.

Columns

Get the result columns.

Count

Get the result count.

Fetch

Get a result by index.

First

Get the first result.

Free

Free the result from memory.

Get Type

Get the Type parser for a column.

Last

Get the last result.


All versions of db with dependencies

PHP Build Version
Package Version
Requires fyre/config Version ^4.0
fyre/container Version ^1.0
fyre/typeparser Version ^5.0
fyre/datetime Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fyre/db contains the following files

Loading the files please wait ....