Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namankumar80510/dikkidatabase
https://github.com/namankumar80510/dikkidatabase
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/namankumar80510/dikkidatabase
- Owner: namankumar80510
- License: mit
- Created: 2024-11-05T10:32:23.000Z (13 days ago)
- Default Branch: main
- Last Pushed: 2024-11-05T10:36:35.000Z (13 days ago)
- Last Synced: 2024-11-05T11:02:08.747Z (13 days ago)
- Language: PHP
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dikki Database - A NoSQL Database in PHP
This is an experimental and simple NoSQL database written in PHP. It is designed to be used in read-heavy (small to medium size) sites where the read performance is more important than the write performance.
## Documentation [WIP]
### Installation
```bash
composer require dikki/database
```### Usage
```php
users->save(['name' => 'John', 'age' => 30]);
$user = $db->users->find($id);
$db->users->delete($id);// Get all documents in a collection
$allUsers = $db->users->all();// Create an index
$db->users->createIndex('age_index', ['age']);// Query using an index
$youngUsers = $db->users->query('age_index', ['age' => [18, 25]]);// Magic findBy methods
$johnsUsers = $db->users->findByName('John');// Batch operations
$db->users->beginBatch();
$db->users->save(['name' => 'User 1']);
$db->users->save(['name' => 'User 2']);
$db->users->endBatch();
```