firevel / firequent
基于 Firestore 的 Eloquent 的有限实现。
0.7.2
2020-08-27 13:01 UTC
Requires
- google/cloud-firestore: ^1.14.1
- google/protobuf: ^v3.13.0
- grpc/grpc: ^1.30.0
- laravel/framework: ^5.8||^6.0||^7.0
README
Laravel Eloquent 用于 Firestore。
概述
Firequent 是一个针对 Google Firestore 修改的 Laravel Eloquent 版本,用于在 Google App Engine 内运行。Firestore 能够处理非常高的负载,并且速度非常快,但它提供的功能比传统的 SQL 数据库要少得多。
已知限制
- 没有增量 ID。而是 1000000000000000 到 9007199254740991 范围内的随机整数 (原因)
- Firestore 是 NoSQL 数据库,因此不支持模式/迁移。
- 仅支持简单的 where() 查询 (更多信息)
- 不支持关系(即将推出!)
- 不支持分页(你应该避免使用 count(),因为 Firestore 不支持计数)
- 了解更多
使用方法
- 在您的 Google 控制台中激活 Firestore(原生模式)
- 在您的模型文件中,将
use Illuminate\Database\Eloquent\Model;
替换为use Firevel\Firequent\Model;
- 如果您在 Google App Engine 之外运行应用程序,您需要在 .env 文件中设置 GOOGLE_APPLICATION_CREDENTIALS (更多信息)
- Firestore 是 NoSQL 数据库,不需要迁移。模式会自动从属性生成。