Download the PHP package juanparati/query-timeout without Composer

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

test

Query Timeout ⏰

A Laravel database library that implements query timeouts at the database level, helping you implement the circuit breaker pattern.

Compatible with the following RDBMS:

Installation

How it works.

Running queries

Use the QueryTimeout facade to set a maximum execution time for your queries:

or using the fluent builder:

In the previous example if the query exceeds the specified timeout (3 seconds), it will send an error to the log and throw a \Juanparati\QueryTimeout\QueryTimeoutException.

Returning direct results

Instead of passing the results as reference like in the following example:

you can also get the results directly:

Obtain execution time

RDBMS are not very accurate stopping queries, but you can get the real execution time of the query using the getQueryTime method:

The configuration key ´resolution´ defines the precision of the time measurement output.

How it works under the hood

Instead of using co-routines or parallel execution monitoring, this library leverages native database features:

The timeout mechanism works by:

  1. Setting the timeout value for the database session.
  2. Executing the query.
  3. Restoring the original timeout value even if the main query fails.

Limitations

MySQL-specific

MariaDB-specific

General Limitations:

Best Practices

  1. Keep application logic outside the closure.

✅ Recommended:

❌ Not recommended:

  1. In MySQL, try to use only one query per closure (Be cautious with ORM operations that might trigger multiple queries).

Configuration

Publish configuration (Optional)


All versions of query-timeout with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-pdo Version *
illuminate/support Version >=12
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 juanparati/query-timeout contains the following files

Loading the files please wait ...