Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dbal Laravel Package

enqueue/dbal

Doctrine DBAL transport for Enqueue/Queue Interop: use an SQL database as a message broker to send and consume messages via Doctrine DBAL. Part of the Enqueue ecosystem; docs and support available via site and community channels.

View on GitHub
Deep Wiki
Context7

[READ-ONLY] This is an implementation of PSR specification. It allows you to send and consume message through Doctrine DBAL library and SQL like database as broker.

Frequently asked questions about Dbal
How do I install enqueue/dbal in a Laravel project?
Run `composer require enqueue/dbal` and `composer require php-enqueue/laravel` for Laravel integration. Configure the transport in your Enqueue context (e.g., `DbalTransport` with your Doctrine DBAL connection). Ensure Doctrine DBAL is installed (v2.5+) and your database schema is set up.
Does enqueue/dbal work with Laravel’s built-in queue system?
No, it requires Enqueue for advanced features like retries, dead-letter queues, and priority queues. Use it alongside Laravel’s queue system if you need Enqueue’s capabilities, but avoid mixing transports for the same queue to prevent conflicts.
What Laravel versions does enqueue/dbal support?
The package works with Laravel 8.x, 9.x, and 10.x via the `php-enqueue/laravel` bridge. Ensure your Laravel version aligns with Enqueue’s compatibility (check the [Enqueue docs](https://php-enqueue.github.io/transport/dbal/) for specifics).
How do I set up the database schema for enqueue/dbal?
Use Doctrine Migrations or raw SQL to create the required tables (`enqueue_message`, `enqueue_queue`, `enqueue_lock`). The package doesn’t auto-migrate, so include schema setup in your deployment process. Example migrations are in the [Enqueue DBAL docs](https://php-enqueue.github.io/transport/dbal/).
Can I use enqueue/dbal for high-throughput messaging (e.g., 1000+ messages/sec)?
No, DBAL is not optimized for high throughput. It’s best for low-to-moderate volume (e.g., background jobs, notifications). For high throughput, use Redis or RabbitMQ. Benchmark under your expected load—DBAL may struggle with >1000 msg/sec due to polling and transaction overhead.
How does enqueue/dbal handle distributed locking for consumers?
Locking is managed via database transactions and the `enqueue_lock` table. In distributed setups, contention can occur. Use optimistic locking or external locks (e.g., Redis) for critical paths. Avoid long-running locks to prevent deadlocks.
What’s the difference between enqueue/dbal and Laravel’s database queue driver?
enqueue/dbal is part of the Enqueue ecosystem, offering advanced features like retries, dead-letter queues, and priority queues. Laravel’s built-in database driver is simpler but lacks these features. Use enqueue/dbal if you need Enqueue’s functionality or already use Doctrine DBAL.
How do I monitor message processing with enqueue/dbal?
The package lacks native metrics, so instrument with custom logging (e.g., log message IDs, processing times). Integrate with Laravel’s queue monitoring or use a third-party tool like Prometheus. Track retries, failures, and lock durations manually.
Can I switch from enqueue/dbal to Redis later without rewriting code?
Yes, abstract your queue logic behind an interface (e.g., `QueueInterface`) and use dependency injection. This allows swapping transports (e.g., `DbalTransport` → `RedisTransport`) with minimal changes. Follow Enqueue’s [transport abstraction guide](https://php-enqueue.github.io/).
What databases does enqueue/dbal support?
Any database supported by Doctrine DBAL (v2.5+), including PostgreSQL, MySQL, SQLite, and others. Performance varies—PostgreSQL and MySQL are recommended for production. Test your specific database under expected load to validate latency and reliability.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky