Download the PHP package liftkit/database without Composer

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

LiftKit database library

Installation

Let's jump right in to some examples.

Connection

Establish a connection

Run a raw SQL query

Using placeholders

Result objects

Loop through results

Fetch a single column as an array

Fetch all rows as an array of entities

Fetch all rows as an array of associative arrays

Query builder

New query

Simple select query

More complicated select query

Note that the method $connection->quoteIdentifier() is called on the right parameters. That's because the right parameter is expected to be a value. If it is instead a SQL identifier, it must be quoted.

This example shows the query with MySQL style identifier quotes to illustrate the point. Note the difference between the JOIN conditions and the WHERE conditions.

Update query

Note that update queries can utilize conditions the same as select statements.

Insert query

Insert queries return their insert ID.

Delete query

Note that delete queries can use conditions the same as select queries.

Subqueries

Subqueries can be substituted pretty much anywhere a value or identifier can be.

Note: This is also an example of how to use raw SQL instead of escaped values in your queries using the method $connection->createRaw(). Select arguments, like the left had side of conditions, will be quoted as an identifier unless otherwise specified.

Composing parts of queries

This comes in hand for extracting away parts of queries you use often, while retaining the ability to combine them with other queries.

Let's say you have a function that returns all of the rows from tbl.

Now you need another query which select only records which are active from tbl. Notice the additions to getAllTblRows.

Table objects

Table objects are meant to reduce the boilerplate you need to place in your query builder queries.

Fetching multiple rows

Fetching multiple rows with composed query

Fetching a single row

Inserting a new row

`

Updating a row

NOTE: The library will auto-detect the primary key column and create an equal condition on that column.

Deleting a row

More info on table objects, relations, and entities coming soon!


All versions of database with dependencies

PHP Build Version
Package Version
Requires liftkit/dependency-injection Version ^1.0
liftkit/collection Version ^1.0
ext-pdo Version *
ext-json 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 liftkit/database contains the following files

Loading the files please wait ....