Download the PHP package jpi/query without Composer

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

Query

USE AT YOUR OWN RISK!

I would advise against using this on production applications...but feel free to use in your own personal / demo / experimental projects.

CodeFactor Latest Stable Version Total Downloads Latest Unstable Version License GitHub last commit (branch)

A simple library to make querying a database easier it works as a middleman between the application and a database.

This has been kept very simple stupid (KISS), other than type errors from PHP there is no validation, it will assume you are using it correctly. So please make sure to add your own validation if using user inputs in these queries.

Dependencies

Installation

Use Composer

Usage

To create an instance, you will need an instance of \JPI\Database (if unfamiliar you can read about that here) which is the first parameter, and the database table name as the second parameter. The same instance can be used multiple times as long as it's for the same database.

Action Methods:

These are the methods to call to end with select, count: int, insert($values array): int|null, update($values array): int & delete: int, all are pretty self-explanatory.

Builder methods

These are all fluent methods, so you can chain them together.

Examples

Assuming a \JPI\Database\Query\Builder instance has been created for the users database table and set to a variable named $queryBuilder.

select

This has 4 return types depending on how you use it:

PaginatedResult & Result work like a normal array just with some extra methods, see https://github.com/jahidulpabelislam/utils?tab=readme-ov-file#collection for more details.

count

As the name implies this method will just return the count as an integer.

For obvious reasons only the table & where builder methods are supported for this action.

insert

This method will just return the id of the row created unless it fails then null.

Only the table builder method is supported for this action.

update

This method will return the count of how many rows have been updated by the query.

column & page builder methods aren't supported for this action.

delete

This method will return the count of how many rows have been deleted by the query.

column & page builder methods aren't supported for this action.

Support

If you found this library interesting or useful please spread the word about this library: share on your socials, star on GitHub, etc.

If you find any issues or have any feature requests, you can open an issue or email me @ jahidulpabelislam.com :smirk:.

Authors

Licence

This module is licensed under the General Public Licence - see the licence file for details.


All versions of query with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
jpi/utils Version ^1.0
jpi/database Version ^2.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 jpi/query contains the following files

Loading the files please wait ....