Download the PHP package zethika/virtual-sql without Composer

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

Virtual SQL

Virtual SQL is a class-based abstraction layer for MySQL, designed to help with programmatically writing MySQL queries.
It allows working with query structures via a singular VirtualSqlQuery class, abstracting the actual MySQL syntax away from consideration.

Installation

Table definitions

Virtual SQL provides a class (VirtualSqlTable) for defining a database table and its columns, which needs to be used when working with queries towards those tables.
These table definitions can be generated at runtime, by providing a PDO instance to the VirtualSqlTableDefinitionGenerator Singleton.
It can then extract the CREATE TABLE definition directly from the database and provide an instance representing a given table.
The CREATE TABLE statements extracted from the database is kept in memory, to minimize excess SQL queries from repeated calls to the same table.

Queries

Queries are built using child classes of VirtualSqlQuery and is the programmatic interface, with which the runtime builds the query.
They provide a series of helper functions, depending on which type of query that's being built, for easier manipulation of the query parts.

Query instances can be generated by providing the VirtualSqlQuery::factory method a type constant, and a VirtualSqlTable instance for the base table.
Supported types are TYPE_SELECT, TYPE_INSERT, TYPE_UPDATE and TYPE_DELETE

Query config parameter

A third parameter can be provided to the factory method, an associative array $config.
This can be used to set most values in a query at instantiation.

The possible keys for it depends on the specific Query type. All values set via the $config parameter can also be manipulated via method calls after instantiation.

SELECT

INSERT

UPDATE

DELETE

Full example

Helpers

Depending on which type of VirtualSqlQuery is being worked, there are a number of helper methods present on the instance to add / manipulate the various parts.
For example to create joins on a select query, there is "innerJoin", "leftJoin", "rightJoin" and "outerJoin" methods which take a $from & $to column, as well as optionally a condition set

Conditions

Virtual SQL uses VirtualSqlCondition instances to describe individual conditions and VirtualSqlConditionSet to describe sets of conditions.
To help build them, there are 3 helper methods on VirtualSqlQuery "andX", "orX" and "condition". "andX" and "orX" takes an arbitrary number of parameters of either VirtualSqlCondition or VirtualSqlConditionSets.

After instantiation, conditions may still be manipulated and added / removed to, as would be expected.


All versions of virtual-sql with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-pdo Version *
ext-mbstring 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 zethika/virtual-sql contains the following files

Loading the files please wait ...