litebase/litebase-php
最新稳定版本:v0.5.7
Composer 安装命令:
composer require litebase/litebase-php
包简介
Litebase PHP SDK
README 文档
README
A PHP SDK for interacting with Litebase, an open source distributed database built on SQLite, distributed file systems, and object storage.
Installation
You can install the package via composer:
composer require litebase/litebase-php
Usage
use Litebase\Configuration; use Litebase\LitebasePDO; $pdo = new LitebasePDO([ 'host' => 'localhost', 'port' => 8888, 'token' => 'your_api_token', 'database' => 'your_database_name/main', ]); $statement = $pdo->prepare('SELECT * FROM users WHERE id = ?'); $statement->execute([1]); $result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { print_r($row); } // Use transactions $pdo = $pdo->beginTransaction(); try { $statement = $pdo->prepare('INSERT INTO users (name, email) VALUES (?, ?)'); $statement->execute(['John Doe', 'john@example.com']); $statement = $pdo->prepare('INSERT INTO logs (user_id, action) VALUES (?, ?)'); $statement->execute([$pdo->lastInsertId(), 'user_created']); $pdo->commit(); } catch (\Exception $e) { $pdo->rollBack(); throw $e; }
Contributing
Please see CONTRIBUTING for details.
Testing
You can run the tests:
composer test
Integration tests require a running Litebase Server. When running integration tests, a server will be automatically started using Docker. You can run the tests with:
composer test-integration
Code of Conduct
Please see CODE OF CONDUCT for details.
Security
All security related issues should be reported directly to security@litebase.com.
License
Litebase is open-sourced software licensed under the MIT License.
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-07