{"id":21344493,"url":"https://github.com/s00d/rocksdb-client-php","last_synced_at":"2026-01-18T22:34:02.458Z","repository":{"id":243845211,"uuid":"813619323","full_name":"s00d/rocksdb-client-php","owner":"s00d","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-21T04:55:09.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T16:29:23.927Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s00d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-11T12:24:22.000Z","updated_at":"2024-06-21T04:54:47.000Z","dependencies_parsed_at":"2024-06-21T22:26:03.773Z","dependency_job_id":null,"html_url":"https://github.com/s00d/rocksdb-client-php","commit_stats":null,"previous_names":["s00d/rocksdb-client-php"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/s00d/rocksdb-client-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Frocksdb-client-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Frocksdb-client-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Frocksdb-client-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Frocksdb-client-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s00d","download_url":"https://codeload.github.com/s00d/rocksdb-client-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Frocksdb-client-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28552786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T01:19:18.053Z","updated_at":"2026-01-18T22:34:02.436Z","avatar_url":"https://github.com/s00d.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Packagist Version](https://img.shields.io/packagist/v/s00d/rocksdb-client-php?style=for-the-badge)](https://packagist.org/packages/s00d/rocksdb-client-php)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/s00d/rocksdb-client-php?style=for-the-badge)](https://packagist.org/packages/s00d/rocksdb-client-php)\n[![Packagist License](https://img.shields.io/packagist/l/s00d/rocksdb-client-php?style=for-the-badge)](https://github.com/s00d/rocksdb-client-php/blob/master/LICENSE)\n[![GitHub Repo stars](https://img.shields.io/github/stars/s00d/rocksdb-client-php?style=for-the-badge)](https://github.com/s00d/rocksdb-client-php)\n\n# RocksDB Client PHP\n\nA PHP client for interacting with RocksDB server.\n\n## Overview\n\nThis package is a part of the [RocksDBFusion](https://github.com/s00d/RocksDBFusion) project. Before integrating this client into your application, you need to run the RocksDB server provided by RocksDBFusion.\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require s00d/rocksdb-client-php\n```\n\n## Workflow\nBelow is the diagram illustrating how the client interacts with the RocksDB server:\n\n```mermaid\nsequenceDiagram\n    participant PhpClient\n    participant TCP\n    participant RocksDBServer\n    participant RocksDBDatabase\n\n    PhpClient-\u003e\u003eTCP: Open socket (stream_socket_client)\n    TCP-\u003e\u003eRocksDBServer: Send request (e.g., GET, PUT, DELETE)\n    RocksDBServer-\u003e\u003eRocksDBDatabase: Perform operation\n    RocksDBDatabase-\u003e\u003eRocksDBServer: Return data/result\n    RocksDBServer-\u003e\u003eTCP: Send data/result\n    TCP-\u003e\u003ePhpClient: Receive data/result\n```\n\n## Configuration\n\n### Laravel Integration\n\n1. **Add the service provider**:\n\n   In your `config/app.php` file, add the service provider to the `providers` array:\n\n   ```php\n   'providers' =\u003e [\n       // Other Service Providers\n\n       s00d\\RocksDB\\RocksDBServiceProvider::class,\n   ],\n   ```\n\n   And the alias to the `aliases` array:\n\n   ```php\n   'aliases' =\u003e [\n       // Other Facades\n\n       'RocksDB' =\u003e s00d\\RocksDB\\Facades\\RocksDB::class,\n   ],\n   ```\n\n2. **Publish the configuration file**:\n\n   ```bash\n   php artisan vendor:publish --provider=\"s00d\\RocksDB\\RocksDBServiceProvider\"\n   ```\n\n   This will create a `config/rocksdb.php` configuration file where you can set the connection details.\n\n3. **Update your `.env` file**:\n\n   Add your RocksDB connection details to the `.env` file:\n\n   ```env\n   ROCKSDB_HOST=127.0.0.1\n   ROCKSDB_PORT=12345\n   ROCKSDB_TOKEN=null\n   ```\n\n4. **Usage**:\n\n   Now you can use the RocksDB client in your Laravel application:\n\n   ```php\n   use RocksDB;\n\n   // Put a value\n   RocksDB::put('key', 'value');\n\n   // Get a value\n   $value = RocksDB::get('key');\n\n   // Delete a key\n   RocksDB::delete('key');\n\n   // Other available methods...\n   ```\n\n### Direct Usage (Without Laravel)\n\nIf you want to use the client without Laravel, you can directly instantiate the `RocksDBClient` class.\n\n1. **Create an instance**:\n\n   ```php\n   use s00d\\RocksDB\\RocksDBClient;\n\n   $client = new RocksDBClient('127.0.0.1', 12345);\n\n   // If you have a token\n   // $client = new RocksDBClient('127.0.0.1', 12345, 'your-token');\n   ```\n\n2. **Usage**:\n\n   ```php\n   // Put a value\n   $client-\u003eput('key', 'value');\n\n   // Get a value\n   $value = $client-\u003eget('key');\n\n   // Delete a key\n   $client-\u003edelete('key');\n\n   // Other available methods...\n   ```\n\n## Server Setup\n\nThis package is a client for the RocksDB server, which is part of the [RocksDBFusion](https://github.com/s00d/RocksDBFusion) project. Before using this client, ensure the RocksDB server is running. You can set up and run the server by following the instructions in the [RocksDBFusion](https://github.com/s00d/RocksDBFusion) repository.\n\n## Methods\n\n### put\n\nStores a key-value pair in the database.\n\n```php\nRocksDB::put('key', 'value', 'optional_column_family');\n```\n\n### get\n\nRetrieves the value of a key from the database.\n\n```php\n$value = RocksDB::get('key', 'optional_column_family', 'default_value');\n```\n\n### delete\n\nDeletes a key from the database.\n\n```php\nRocksDB::delete('key', 'optional_column_family');\n```\n\n### merge\n\nMerges a value with an existing key.\n\n```php\nRocksDB::merge('key', 'value', 'optional_column_family');\n```\n\n### listColumnFamilies\n\nLists all column families in the database.\n\n```php\n$columnFamilies = RocksDB::listColumnFamilies('path_to_db');\n```\n\n### createColumnFamily\n\nCreates a new column family.\n\n```php\nRocksDB::createColumnFamily('new_column_family');\n```\n\n### dropColumnFamily\n\nDrops an existing column family.\n\n```php\nRocksDB::dropColumnFamily('column_family');\n```\n\n### compactRange\n\nCompacts the database within a range.\n\n```php\nRocksDB::compactRange('start_key', 'end_key', 'optional_column_family');\n```\n\n### Transactions\n\n#### Begin Transaction\n\nBegins a new transaction.\n\n```php\n$txnId = RocksDB::beginTransaction();\n```\n\n#### Commit Transaction\n\nCommits a transaction.\n\n```php\nRocksDB::commitTransaction($txnId);\n```\n\n#### Rollback Transaction\n\nRolls back a transaction.\n\n```php\nRocksDB::rollbackTransaction($txnId);\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/s00d/rocksdb-client-php/blob/master/LICENSE) file for details.\n\n## Links\n\n- [GitHub Repository](https://github.com/s00d/rocksdb-client-php)\n- [Packagist Package](https://packagist.org/packages/s00d/rocksdb-client-php)\n- [RocksDBFusion](https://github.com/s00d/RocksDBFusion)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs00d%2Frocksdb-client-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs00d%2Frocksdb-client-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs00d%2Frocksdb-client-php/lists"}