dorm_firebase_database 2.0.0-dev.5 copy "dorm_firebase_database: ^2.0.0-dev.5" to clipboard
dorm_firebase_database: ^2.0.0-dev.5 copied to clipboard

A Firebase Realtime Database engine for dORM applications that need persistent, remotely synchronized data.

dorm_firebase_database #

dorm_firebase_database on pub.dev dorm_firebase_database pub points dorm_firebase_database popularity dorm_firebase_database likes dorm_firebase_database documentation dORM repository License Dart CI

dorm_firebase_database is the Flutter engine for Firebase Realtime Database. It uses FirebaseInstance from this package and the Firebase SDK configured by the application.

Backend and runtime #

This package requires Flutter and firebase_database. Firebase initialization, authentication, emulator selection, and security rules remain application configuration.

Install #

Run these commands in a Flutter project:

flutter pub add dorm_framework
flutter pub add dorm_firebase_database
flutter pub add firebase_core
flutter pub add firebase_database
flutter pub add --dev dorm_generator
flutter pub add --dev build_runner

Initialize Firebase with the platform configuration required by the Flutter application before creating the engine.

Create the engine and Dorm facade #

import 'package:firebase_core/firebase_core.dart';
import 'package:dorm_firebase_database/dorm_firebase_database.dart';

await Firebase.initializeApp();

const FirebaseInstance instance = FirebaseInstance();
final Engine engine = Engine(instance);
final dorm = Dorm(engine);

The application initializes and owns Firebase. The engine does not create or close the Firebase app. Pass path when the dORM data should live below a configured Realtime Database path.

Use repositories #

final User user = await dorm.users.repository.put(
  Creation.auto(
    dependency: const UserDependency(),
    data: UserData(name: 'Ada'),
  ),
);

final stream = dorm.users.repository.pullAll(const BaseFilter.empty());

Firebase generates simple String push-key identities before persistence. Creation.explicit can provide a String identity. Composite identities are not supported by this engine.

pull and pullAll use Firebase listeners and emit later changes received from the Realtime Database.

Identities, filters, pages, and relationships #

The engine translates the portable value, text, date, range, ordering, and limit operations to the query forms supported by Realtime Database. The backend does not provide general boolean query composition. Relationship resolution uses the generated readable operations and may issue more than one backend read.

Transactions #

The package does not implement the portable TransactionalDorm capability. Firebase-specific operations and security rules remain application concerns. Use FirebaseDatabaseMigrationAdapter from dorm_migrations for ordered data migrations. Structural field operations are no-ops; backfills read and update existing records in pages with checkpoints. The adapter uses a persistent lease but does not provide one transaction for an entire migration. See the migration guide for the safe workflow.

Streams #

pull and pullAll use Firebase listeners and emit later changes received from the Realtime Database.

Schema, errors, and limitations #

The Firebase SDK, Firebase project, emulator, authentication, and security rules are configured outside this package. Provider failures are exposed through the portable DormDatabaseException contract; inspect cause and providerCode when Firebase-specific details are needed. The engine accepts String identities and does not provide automatic composite-key generation.

Run the example #

See the package example for Firebase initialization, emulator configuration, generation, and Flutter commands.

0
likes
160
points
233
downloads

Documentation

API reference

Publisher

verified publisherenzosantos.dev

Weekly Downloads

A Firebase Realtime Database engine for dORM applications that need persistent, remotely synchronized data.

Homepage
Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

dorm_framework, dorm_migrations, firebase_auth, firebase_core, firebase_database, flutter, http, rxdart

More

Packages that depend on dorm_firebase_database