Download the PHP package timefrontiers/php-sql-database without Composer

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

TimeFrontiers PHP SQL Database

A small SQL database manager supporting MySQLi and PDO through a compatible prepared-query and transaction API.

PHP Version

Features

Requirements

Installation

Connections

MySQLi is the default facade backend:

Use the additive PDO factory when the database name must be supplied:

An existing concrete driver can also be wrapped without replacing it:

The existing constructor and class-name construction paths remain available for compatibility. The class-name PDO path has no database-name parameter, so new PDO callers should use SQLDatabase::pdo() or fromConnection().

Prepared queries

The legacy query(), multiQuery(), confirmQuery(), result helpers, and magic facade forwarding remain available.

Manual transactions

transactionDepth() reports the managed scope count. inTransaction() reports managed state and verifies it against PDO's native state when PDO can do so.

Callback transactions

The callback receives the concrete driver when called on a concrete driver, or the facade when called on SQLDatabase. Its original return value is returned unchanged; false, 0, null, and an empty array are normal values and are committed.

A thrown callback exception rolls back exactly the callback's scope and is rethrown unchanged when rollback succeeds. Begin, commit, and rollback infrastructure failures use the public exception hierarchy under TimeFrontiers\Exceptions.

Do not call beginTransaction(), commit(), or rollBack() inside a callback in a way that leaves the wrapper owning a different scope than it opened. The wrapper validates scope ownership by identity and throws TransactionException rather than guessing which scope to close. Two consequences matter:

Neither case is a rollback. Inspect transactionDepth() and reconcile state before deciding what to do.

Nested scopes and rollback-only behavior

Nested beginTransaction() or transaction() calls create library-generated savepoints. An inner rollback discards only the inner work and leaves a clean parent usable:

If a package-managed statement fails inside a transaction, its current scope becomes rollback-only. A later commit() rolls that scope back, records a transaction error, and returns false. The callback API throws TransactionException. Empty SELECT results and successful DML affecting zero rows do not mark a scope rollback-only.

A failure of the transaction machinery itself — begin, savepoint, commit, release, or rollback — marks every open scope rollback-only, not just the current one, because no remaining scope can be proven safe to commit. A failed nested SAVEPOINT will therefore also cause a clean parent scope to roll back.

Calling execute() lets the package observe failures and affected rows. If a caller obtains a native statement from prepare() and executes that native object directly, the package cannot observe a later native execution failure.

Locking and affected rows

Use database row locks inside a managed transaction:

affectedRows() stores the result from the most recently completed statement. Portable guarantees apply to INSERT, UPDATE, and DELETE; SELECT row counts vary by driver. Rolling back does not change what the statement itself reported as affected, although persisted state is restored.

Driver diagnostics

These accessors allow callers to classify duplicate keys, deadlocks, and lock timeouts without parsing localized messages. A later successful operation clears the latest driver identity. getErrors() retains its existing five-element entry format and historical collection behavior. Prepared bound values are not included in new failure messages.

Important transaction rules

Tests

Unit tests do not require a database:

Integration tests require a dedicated disposable MySQL or MariaDB database:

For safety, TF_SQL_TEST_DATABASE must contain test. The suite creates and drops uniquely named InnoDB tables but never creates or drops the database.

Focused suites are also available through composer test-nested, composer test-rollback-only, and composer test-concurrency.

License

MIT License. See LICENSE for details.


All versions of php-sql-database with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-mysqli 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 timefrontiers/php-sql-database contains the following files

Loading the files please wait ...