Download the PHP package phenixphp/sqlite without Composer
On this page you can find all versions of the php package phenixphp/sqlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phenixphp/sqlite
More information about phenixphp/sqlite
Files in phenixphp/sqlite
Package sqlite
Short Description Asynchronous SQLite 3 client for PHP based on Amp.
License MIT
Homepage https://github.com/phenixphp/sqlite
Informations about the package sqlite
phenixphp/sqlite
Asynchronous SQLite 3 client for PHP based on Amp.
phenixphp/sqlite is part of the Phenix PHP framework ecosystem. Phenix is a web framework built on pure PHP, without external extensions, based on the Amphp ecosystem, which provides non-blocking operations, asynchronism and parallel code execution natively. It runs in the PHP SAPI CLI and on its own server — it is simply powerful.
Table of Contents
- Requirements
- Installation
- Configuration
- Usage
- Establishing a Connection
- Executing Queries
- Prepared Statements
- Transactions
- License
Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.2 |
| ext-sqlite3 | * |
Installation
Install the package via Composer:
Configuration
The SqliteConfig class is the entry point for configuring the SQLite connection. It allows you to define the database path and connection parameters aligned with the Amphp SQL ecosystem.
You can use
:memory:as the database path to create an in-memory SQLite database, which is ideal for testing scenarios.
Usage
Establishing a Connection
Use SqliteConfig to create and manage asynchronous connections to your SQLite database. Since this package is built on top of Amphp, all database operations are non-blocking and run asynchronously using fibers.
Executing Queries
Once you have an active connection, you can execute SQL statements — CREATE, INSERT, SELECT, UPDATE, and DELETE — all asynchronously without blocking the event loop.
Creating a Table
Inserting Records
Selecting Records
Updating Records
Deleting Records
Prepared Statements
Prepared statements allow you to precompile a SQL template and execute it repeatedly with different bound parameters. This improves both performance and security by preventing SQL injection.
Preparing and Executing a Statement
Prepared Statement with Named Parameters
Closing a Prepared Statement
Transactions
Transactions group multiple SQL operations into a single atomic unit. If any operation fails, all changes within the transaction are rolled back, ensuring data consistency.
Basic Transaction
Transaction with Prepared Statements
Learning Phenix
You can learn about Phenix in the official documentation and discover the power of asynchronous and concurrent applications in native PHP.
Security Vulnerabilities
If you discover a security vulnerability within Phenix, please send an e-mail to Omar Barbosa via [email protected]. All security vulnerabilities will be promptly addressed.
License
This package is open-sourced software licensed under the MIT license.
All versions of sqlite with dependencies
ext-sqlite3 Version *
amphp/amp Version ^3
amphp/parser Version ^1.1
amphp/pipeline Version ^1
amphp/sql Version ^2
amphp/sql-common Version ^2
amphp/parallel Version ^2.3