Download the PHP package llwebsol/easy-db without Composer

On this page you can find all versions of the php package llwebsol/easy-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 easy-db

EasyDB

A Simple Wrapper for PDO

To get the most out of this library, every table in your database should have a primary key called id.

Getting Started

using composer

1. Create a Config

Accepted db_type options:

*currently untested

Complete List of Options:

2. Get a DB Instance

Use the ConnectionPool to retrieve a database instance for a given configuration.

3. Querying the Database

Once you have an instance of the DB class, there are several helper methods available to you

- Query

accepts any database query you desire, with an optional array of bound parameters

returns a Generator for iterating through your result set

- QueryOne

helper for getting a single record from the database

Returns the record as an array, (not wrapped in a generator)

- Insert

Insert a record into a given table Returns the last inserted id

- Update

Update a record in a given table returns the number of rows affected

- Save

this is just an alias for insert/update if the $data has an 'id' field it will update, otherwise it will insert

- Delete

Delete a record from a given table returns the number of rows affected or false if invalid

- Delete Where

Delete records from a given table that meet the conditions of the where clause Returns the number of rows deleted

- Update Where

Update records from a given table that meet the conditions of the where clause Returns the number of rows updated

- Find In

Returns a Generator with all records in table where $column_name IN ( $in_array )

SQL Equivalent:

4. Events

You can add event listeners for any stage of a database interaction

Supported Events:

Helpers:

Examples

Echo the sql of every query that is performed

Add a user id to all inserted records

*Assumes all of your tables have a created_user column `

*Referenced Parameters are available for BEFORE_INSERT and BEFORE_UPDATE events only

5. Transactions

You can perform multiple actions with a single transaction with the following 3 methods

Example:


All versions of easy-db with dependencies

PHP Build Version
Package Version
Requires 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 llwebsol/easy-db contains the following files

Loading the files please wait ...