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

Database Laravel Package

cakephp/database

CakePHP Database provides a flexible database abstraction layer with a powerful query builder, schema and type system, connection management, and drivers for common SQL databases. Use it standalone or within CakePHP to build and run queries cleanly.

View on GitHub
Deep Wiki
Context7

[READ-ONLY] Flexible and powerful Database abstraction library with a familiar PDO-like API. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

Frequently asked questions about Database
Can I use cakephp/database in Laravel without the full CakePHP framework?
Yes, the package is designed as a standalone library. You only need to install it via Composer and integrate it into Laravel’s service container. It doesn’t require any CakePHP core dependencies beyond the database layer itself.
Does this package support write operations like INSERT, UPDATE, or DELETE?
No, cakephp/database is read-only focused. It excels at SELECT queries, schema reflection, and analytics but lacks built-in support for write operations. For CRUD apps, stick with Laravel’s Eloquent or Query Builder.
How do I integrate this with Laravel’s existing DB connections?
You’ll need to create a custom Laravel service provider to bind the CakePHP database adapter to a new connection (e.g., `cakephp`). Use Laravel’s `bind()` method to register it, then configure it in your `config/database.php` file under a new connection name.
Will this work with Laravel 10.x, or are there version compatibility issues?
The package is framework-agnostic, so it *should* work with Laravel 10.x, but test thoroughly. Ensure your Composer dependencies don’t conflict with Laravel’s core packages. Check the package’s `composer.json` for PHP version requirements (typically 8.0+).
Can I use this for migrations or schema changes in Laravel?
The package includes schema reflection tools, but it doesn’t natively integrate with Laravel Migrations. You’d need to build a custom adapter or use it alongside Laravel’s migration system for read-heavy validation or analytics during deployments.
Is there a performance penalty compared to Laravel’s Query Builder or raw PDO?
Yes, there’s a slight overhead due to abstraction. Benchmark your use case—it’s often negligible for read operations but could matter in high-frequency queries. For latency-sensitive apps, test both approaches before committing.
How does the query builder syntax compare to Laravel’s Eloquent?
The syntax is PDO-like and familiar to CakePHP users but differs from Laravel’s fluent query builder. For example, `find()` replaces `where()`, and joins use a chained method style. You’ll need to adapt or create a wrapper layer for Laravel teams.
Are there alternatives to cakephp/database for read-heavy Laravel apps?
Yes. Consider Laravel’s native Query Builder (already optimized for reads), Doctrine DBAL (more feature-rich but heavier), or custom PDO wrappers. If you need analytics, tools like Laravel Scout or dedicated reporting libraries (e.g., Spatie’s Analytics) may suffice.
How do I handle transactions with this package?
Transactions aren’t supported natively. For read operations, this isn’t an issue, but if you need atomicity, pair it with Laravel’s transaction manager or raw PDO transactions. The package focuses on query execution, not ACID guarantees.
What’s the maintenance status of cakephp/database? Is it actively developed?
The package is part of the CakePHP ecosystem, which is actively maintained. However, it’s a standalone layer, so updates may not always align with Laravel’s release cycle. Check the GitHub repo for recent commits or open issues to gauge activity.
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.
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
spatie/mailcoach-vapor