drift_hrana 1.0.0 copy "drift_hrana: ^1.0.0" to clipboard
drift_hrana: ^1.0.0 copied to clipboard

Use a remote libsql server with your drift database.

Drift Hrana Version

This package wraps package:hrana to access remote libsql or Turso databases from drift, a database library for Dart and Flutter applications.

To use this package, you need to run an sqld server somewhere, e.g. with

docker run -p 8080:8080 -ti -e SQLD_NODE=primary ghcr.io/tursodatabase/libsql-server:latest

Then, the HranaDatabase class from package:drift_hrana/drift_hrana.dart can be used to connect your database to such a server:

import 'package:drift/drift.dart';
import 'package:drift_hrana/drift_hrana.dart';

@DriftDatabase(...)
class AppDatabase extends _$AppDatabase {
  AppDatabase(super.e);

  @override
  int get schemaVersion => 1;
}

void main() async {
  final database = AppDatabase(HranaDatabase(
    Uri.parse('ws://localhost:8080/'),
    jwtToken: null,
  ));
}
4
likes
0
pub points
68%
popularity

Publisher

verified publishersimonbinder.eu

Use a remote libsql server with your drift database.

Repository (GitHub)
View/report issues

Topics

#database #turso #libsql #sqld #hrana

License

unknown (license)

Dependencies

drift, hrana

More

Packages that depend on drift_hrana