Download the PHP package rancoud/database without Composer

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

Database Package

Packagist PHP Version Support Packagist Version Packagist Downloads Composer dependencies Test workflow Codecov

Request Database (use PDO). Supported drivers: MySQL, PostgreSQL, SQLite.

Installation

How to use it?

Connection to a database

Examples

For example we have a table users with this schema:

Field Type Options
id int(8) primary key, auto increment
username varchar(255)
ranking int(8)

In the table we have these data:

id username ranking
1 taylor 10
2 alison 30
3 swifts 20

Select methods

The output is always an array.

SelectAll

Return all rows

SelectRow

Return only the first row

SelectCol

Return only the first column

SelectVar

Return only the first value of first line

Select + (Read OR ReadAll)

Having the statement and use read to get row by row or readAll for all data. Useful when you want to use a specific fetch mode.

Count

Return only the value when using SELECT COUNT(*) FROM ....

Insert

Update

Delete

Transactions

Nested transactions are supported for MySQL, PostgreSQL, SQLite.

Named instances

You have to name your instances.
Then you can get them by their name.

Configurator

Constructor Settings

Here is the description of the array passed to the construct

Mandatory keys

Parameter Type Description
driver string driver of the database, it will be check with PDO::getAvailableDrivers
host string hostname of the database (port number may be included, e.g example.org:5342)
user string user used to connect to the database
password string password used to connect to the database
database string name of the database

Optional keys

Parameter Type Default value Description
save_queries bool true all queries will be saved in memory with execution time and the connection time
persistent_connection bool false use persistent connection
charset string it depends on the driver (MySQL: utf8mb4 , PostgreSQL: UTF8) set specific database charset
parameters array [] extra parameters used by PDO on connection

Methods

Database

Constructor

Mandatory

Parameter Type Description
configurator Configurator Database configuration

General Commands

Transactions

Errors

Save Queries

Specific Commands

Low Level

Static Method

How to Dev

docker compose build && docker compose run lib composer ci for launching tests


All versions of database with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
ext-pdo Version *
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 rancoud/database contains the following files

Loading the files please wait ....