d_rocket 1.2.2 copy "d_rocket: ^1.2.2" to clipboard
d_rocket: ^1.2.2 copied to clipboard

Dart/Flutter data-layer framework: @Serializable codegen, @RestClient with retry, deferred LINQ, and a code-first SQLite ORM with migrations. See README for platform support.

example/lib/main.dart

// example/lib/main.dart
//
// Minimal example of using d_rocket's SQLite ORM.
// Opens an in-memory database, runs a migration, and
// queries a typed set.
//
// To run:
//   cd example
//   flutter pub get
//   dart run main.dart
//
// The `@Table` annotated entity is normally
// generated via `d_rocket_builder`. For this minimal
// example we use a hand-written stub that satisfies
// the same contract.

import 'package:d_rocket/d_rocket.dart';

part 'main.g.dart';

/// A minimal Table stub (codegen would emit this).
class Book extends Record {
  Book({this.id = 0, required this.title, required this.authorId});
  @PrimaryKey()
  final int id;
  final String title;
  final int authorId;
}

Future<void> main() async {
  // .d: a real app would call `initializeD()` (codegen-emitted)
  // to register all serializers, then construct a
  // `DbContext` for the production SQLite provider.
  // For this example we just print the version of the
  // framework on the active platform.
  print('d_rocket example: hand-written Book record defined.');
  print('See packages/d_rocket/lib for the full API and the');
  print('README for the codegen flow with d_rocket_builder.');
}
2
likes
150
points
537
downloads

Documentation

Documentation
API reference

Publisher

verified publishertorogoz.tech

Weekly Downloads

Dart/Flutter data-layer framework: @Serializable codegen, @RestClient with retry, deferred LINQ, and a code-first SQLite ORM with migrations. See README for platform support.

Repository (GitHub)
View/report issues

Topics

#linq #orm #sqlite #codegen #framework

License

MIT (license)

Dependencies

flutter, http, meta, sqlite3

More

Packages that depend on d_rocket