- What is fabpot/amphp-sqlite3?
- fabpot/amphp-sqlite3 is an asynchronous, non-blocking SQLite3 client for PHP built on the Amp event-loop runtime. It exposes promises and coroutines so queries run without blocking the loop, which is useful in long-running concurrent processes. It is a personal package by Fabien Potencier and is not the same as the maintained amphp/sqlite3 under the amphp organization.
- Does fabpot/amphp-sqlite3 work with Laravel?
- Not out of the box. Laravel's database layer expects a PDO connection, and this package returns Amp futures instead, so it cannot back Eloquent or the query builder without a custom repository layer. Amp's coroutine model also assumes everything in the call path is async, which a normal PHP-FPM request is not. Treat it as a separate tool for background or Amp-native services rather than a database driver for your Laravel app.
- Can I use fabpot/amphp-sqlite3 with Eloquent or Laravel's query builder?
- No. Eloquent and the query builder are built on PDO and Laravel's Connection contract, which this package does not implement. You would have to hand-roll a repository layer or a custom connection resolver, and the async primitives would leak into domain code. Wrap it behind an internal interface if you must use it alongside Eloquent.
- Is fabpot/amphp-sqlite3 the same as amphp/sqlite3?
- Probably not. The amphp organization maintains amphp/sqlite3, while fabpot/amphp-sqlite3 appears to be a personal fork or experiment with very low adoption. Check the repository history, last commit dates, and tags to determine whether it is a rename, a stale fork, or a divergent rewrite, because the answer changes the risk profile. Confirm Composer resolution against your Amp dependencies before committing.
- Which Amp version does fabpot/amphp-sqlite3 target, v2 or v3 (Revolt)?
- You need to check the repository's composer.json to see whether it pins amphp/amp v2 (Loop) or v3 (Revolt). The two Amp majors are not compatible, and mixing loops is fragile and hard to debug. Verify this before writing any code, especially if you also use Octane with Swoole or RoadRunner.
- How do I install fabpot/amphp-sqlite3 via Composer?
- Run composer require fabpot/amphp-sqlite3 after confirming it resolves against your pinned Laravel, Amp, and PHP versions. Expect conflicts with anything that pins Amp majors, and check that your deployment image ships the required SQLite extension. The package may bind ext-sqlite3, ext-pdo_sqlite, or shell out to the sqlite3 binary, and each has different deployment consequences.
- Will fabpot/amphp-sqlite3 work under Laravel Octane?
- Risky. Octane with Swoole, OpenSwoole, or RoadRunner brings its own concurrency primitives, and mixing them with Amp's event loop is fragile and hard to debug. There are no public reports of this package running under Octane, and with zero dependents there is no field-hardening to lean on. Benchmark carefully and define kill criteria before adopting.
- How does fabpot/amphp-sqlite3 handle SQLITE_BUSY and write locks?
- Async does not remove SQLite's single-writer, file-locked bottleneck; it only moves where you wait. Under contention, writes surface as SQLITE_BUSY, so configure busy_timeout and consider WAL mode depending on your access pattern. Make sure the SQLite file is written from one process class, since FPM, CLI workers, and Octane workers all lock against each other.
- What are good use cases for fabpot/amphp-sqlite3 in a Laravel project?
- Good fits are Amp or Revolt CLI daemons, queue workers doing isolated local writes, websocket servers, and sidecar services where the loop is the application. Poor fits are standard Laravel HTTP CRUD, where PHP-FPM would have blocked on PDO anyway. Scope it to one bounded context, such as an import or aggregation worker, and hide it behind an internal interface.
- Is fabpot/amphp-sqlite3 production-ready and actively maintained?
- Treat it as high risk. It has a bus factor of one, very low adoption with single-digit stars and zero dependents, and no third-party patches or battle reports. Verify last commit and release dates, whether it tracks upstream amphp/sqlite3, and whether a security policy or disclosure contact exists. If the maintenance posture does not clear review, vendor the code or use upstream amphp instead.