Download the PHP package girgias/query-builder without Composer

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

SQL Query Builder

Build Status Maintainability Test Coverage

A fluent SQL Query Builder which ONLY builds a valid SQL query with the SQL clauses it has been asked to provide.

Installing

Features

This Query Builder can build a variety of SQL queries which are database agnostic as it uses the ANSI standardized syntax.

Every sort of query has its own class which extends from the base Query class, They all have the same constructor signature which requires the table name on which to execute the query.

To build a SELECT query with table join use the SelectJoin class. An example can be seen below on how to use this class.

It is possible to directly provide scalar values to WHERE clauses and while binding a field. It is also possible to specify the named parameter against which the value will be bounded. In case no named parameter has been provided a random one will be generated.

To retrieve the named parameters with their associated values use the getParameters method which will return an associative array parameter => value.

Examples

A basic SELECT query:

Will output:

A more complex SELECT query:

Will output:

An example with the whereOr method:

Will output:

UPDATE query example:

Will output:

A SELECT query with an INNER JOIN:

Will output:

Future scope

Possible features that will be added to this library

Contributing

If you found an invalid SQL name which DOESN'T throw a Runtime exception or a valid SQL name which does please add a test case into the tests/CheckSqlNamesTest.php file.

If you found an example where this library returns an invalid SQL query please add (or fix) a test case in the relevant Query test case or if it's a general error please use the tests/QueryTest file.

If a RunTime exception should be thrown please add a test in the relevant test file or if it is specific to SELECT Query please add a test in the tests/SelectThrowExceptionsTest.php file.

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Notes

When contributing please assure that Psalm runs without error and all unit tests pass. Moreover if you add functionality please add corresponding unit tests to cover at least 90% of your code and that these tests cover any edge cases if they exist.

Links

Licensing

The code in this project is licensed under MIT license.


All versions of query-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
girgias/php-enums Version ^1.0
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 girgias/query-builder contains the following files

Loading the files please wait ....