Download the PHP package memran/marwa-db without Composer
On this page you can find all versions of the php package memran/marwa-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package marwa-db
Marwa-DB
MarwaDB is a PSR-compliant, framework-agnostic, Laravel-style database library built on top of PDO.
It includes a fluent query builder, Eloquent-style ORM, schema builder, migrations, and connection load balancing.
📌 Features
- Multiple Connections with load balancing & retry policies
- Fluent Query Builder — chainable, secure, prepared statements
- Eloquent-style ORM:
- Auto timestamps (
created_at
,updated_at
) - Soft deletes
fillable
/guarded
attributes for mass assignment protection- Relationships:
hasOne
,hasMany
,belongsTo
,belongsToMany
- Eager loading (
with()
,load()
)
- Auto timestamps (
- Schema Builder:
- Create/drop tables
- Foreign keys
- Indexes (
primary
,unique
,index
) - Column modifiers (
nullable
,default
,after
)
- Migrations CLI:
make:migration
migrate
,migrate:rollback
,migrate:refresh
- Seeder Support with Faker
- Debug Panel — view executed queries & timings
- PSR-3 Logging integration
📦 Installation
⚙ Configuration
config/database.php
🚀 CLI Usage
Create migration:
Run migrations:
Rollback:
🛠 Query Builder Examples
🏷 ORM Examples
🔗 Relationships
🏗 Schema Builder
📋 Function Reference
Query Builder
table($name)
— Selects tableselect(...$columns)
— Selects specific columnswhere($column, $operator, $value)
— Adds WHERE clauseorWhere(...)
— Adds OR WHERE clauseorderBy($column, $direction)
— Sort resultsgroupBy($column)
— Group resultslimit($n)
— Limit rowsget()
— Fetch resultsfirst()
— Fetch first rowinsert($data)
— Insert new record(s)update($data)
— Update record(s)delete()
— Delete record(s)
ORM
find($id)
— Find by primary keyall()
— Get all rowscreate($attributes)
— Insert & return modelsave()
— Save changesdelete()
— Delete (with soft delete if enabled)with($relations)
— Eager load relations
Schema Builder
create($table, $callback)
— Create new tabledrop($table)
— Drop table- Column types:
string
,integer
,text
,boolean
,timestamp
, etc. - Modifiers:
nullable()
,default($value)
,after($column)
🐞 Debugging
Enable query debug in config:
View queries:
📜 License
MIT — See LICENSE for details.
All versions of marwa-db with dependencies
PHP Build Version
Package Version
Requires
php Version
>= 7.2.0
ext-pdo Version *
ext-pdo Version *
The package memran/marwa-db contains the following files
Loading the files please wait ....