Download the PHP package drift/dbal without Composer

On this page you can find all versions of the php package drift/dbal. 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 dbal

DBAL for ReactPHP

CircleCI

This is a DBAL on top of ReactPHP SQL clients and Doctrine model implementation. You will be able to use

Attention. Only for proof of concept ATM. Do not use this library on production until the first stable version is tagged.

Example

Let's create an example of what this library can really do. For this example, we will create an adapter for Mysql, and will use Doctrine QueryBuilder to create a new element in database and query for some rows.

Because we will use Mysql adapter, you should have installed the ReactPHP based mysql library react/mysql. Because this library is on development stage, all adapters dependencies will be loaded for testing purposes.

First of all, we need to create a Connection instance with the selected platform driver. We will have to create as well a Credentials instance with all the connection data.

Once we have the connection, we can create a new register in the database by using the Doctrine QueryBuilder or direct built-in methods. The result of all these calls will be a Promise interface that, eventually, will return a Result instance.

You can use, at this moment, adapters for mysql, postgresql, and sqlite.

Connection shortcuts

This DBAL introduce some shortcuts useful for your projects on top of Doctrine query builder and escaping parametrization.

Insert

Inserts a new row in a table. Needs the table and an array with fields and their values. Returns a Promise.

Update

Updates an existing row from a table. Needs the table, an identifier as array and an array of fields with their values. Returns a Promise.

Upsert

Insert a row if not exists. Otherwise, it will update the existing row with given values. Needs the table, an identifier as array and an array of fields with their values. Returns a Promise.

Delete

Deletes a row if exists. Needs the table and the identifier as array. Returns a Promise.

Find one by

Find a row given a where clause. Needs the table and an array of fields with their values. Returns a Promise with, eventually, the result as array of all found rows.

Find by

Find all rows given an array of where clauses. Needs the table and an array of fields with their values. Returns a Promise with, eventually, the result as array of all found rows.

Create table

You can easily create a new table with basic information. Needs the table name and an array of fields and types. Strings are considered with length 255. First field position in the array will be considered as primary key. Returns a Promise with, eventually, the connection.

This is a basic table creation method. To create more complex tables, you can use Doctrine's Schema model. You can execute all Schema SQLs generated by using this method inside Connection named executeSchema. You'll find more information about this Schema model in Doctrine documentation

Drop table

You can easily drop an existing table. Needs just the table name, and returns, eventually, the connection.

Truncate table

You can easily truncate an existing table. Needs just the table name, and returns, eventually, the connection.

Tests

You can run tests by running docker-compose up and by doing php vendor/bin/phpunit.


All versions of dbal with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
doctrine/dbal Version ^3
react/event-loop Version ^1
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 drift/dbal contains the following files

Loading the files please wait ....