https://github.com/corviz/database-layer
Standalone library for database interaction
https://github.com/corviz/database-layer
database php8 query-builder
Last synced: about 2 months ago
JSON representation
Standalone library for database interaction
- Host: GitHub
- URL: https://github.com/corviz/database-layer
- Owner: Corviz
- License: mit
- Created: 2022-07-20T16:15:29.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-17T18:32:19.000Z (over 2 years ago)
- Last Synced: 2025-01-11T23:47:06.587Z (4 months ago)
- Topics: database, php8, query-builder
- Language: PHP
- Homepage: https://corviz.github.io/database-layer
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Corviz - Database Layer
Corviz database layer provides a simple yet powerful interface to run your database operations.
We use [Hydrahon](https://clancats.io/hydrahon/master/) query builder as it's base components, extending it with a Model.
It means that all operations included in their library will be avaliable for your models as well.## Installation
```
composer require corviz/database-layer
```## Features
- Simple to use query builder
- Database interface (binding, native queries, transactions, db function execution, etc...)
- Base model that features mutators, accessors and CRUD operations...
- Mass objects creationAnd more coming soon!
### Have a taste:
Example 1 - Fetch active users:
```php
$users = User::query()->where('active', true)->get();foreach ($users as $user) {
echo $user->id, ' - ', $user->email;
}
```Example 2 - Create and save a contact:
```php
$contact = new Contact();
$contact->name = 'John';
$contact->phone = '+1 (999) 999-9999';
$contact->insert();
```Example 3 - Create messages in the messages table:
```php
Message::create([
[
'message' => 'This is an warning message',
'level' => 'warning'
],
[
'message' => 'This is an info message',
'level' => 'info'
]
]);
```[See complete documentation...](https://corviz.github.io/database-layer/)