FirestoreDbExecutor class

DbExecutor que persiste no Firebase Firestore (via REST). Mesma interface dos demais. Como o Firestore é NoSQL, há um pequeno mapeamento: cada documento vira um Map com a chave id (o id do documento) somada aos campos. insert devolve o id como int quando numérico (senão 0 — use o id retornado nas listagens).

Credenciais: FIREBASE_PROJECT_ID e FIREBASE_TOKEN (OAuth/access token).

Implemented types

Constructors

FirestoreDbExecutor({required String projectId, required String token, Client? client})
FirestoreDbExecutor.fromEnv(Map<String, String> env, {Client? client})
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
projectId String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
final

Methods

count(String table) Future<int>
Conta registros de table.
override
deleteById(String table, Object id) Future<bool>
Remove por id; retorna se afetou algo.
override
findById(String table, Object id) Future<Map<String, Object?>?>
Busca por id.
override
insert(String table, Map<String, Object?> values) Future<int>
Insere values em table e retorna o id gerado.
override
list(String table, {required int limit, required int offset, String orderBy = 'id', bool desc = true}) Future<List<Map<String, Object?>>>
Lista registros paginados.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateById(String table, Object id, Map<String, Object?> values) Future<bool>
Atualiza por id; retorna se afetou algo.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited