RestApiDbExecutor class
DbExecutor que persiste chamando uma API REST do Flenx (alvo Dart OU
PHP — é só apontar a URL). Usa o envelope padrão {success, data, meta} e o
contrato CRUD por tabela:
GET <base>/<tabela>?limit&offset&orderBy&desc→ lista (data + meta.total)GET <base>/<tabela>/<id>→ um registroPOST <base>/<tabela>→ cria (data.id)PUT <base>/<tabela>/<id>→ atualizaDELETE <base>/<tabela>/<id>→ remove
Credenciais: API_BASE_URL e (opcional) API_TOKEN (Bearer).
- Implemented types
Constructors
- RestApiDbExecutor({required String baseUrl, String? token, Client? client})
-
RestApiDbExecutor.fromEnv(Map<
String, String> env, {Client? client}) -
factory
Properties
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
valuesemtablee 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