daredis 0.1.0 copy "daredis: ^0.1.0" to clipboard
daredis: ^0.1.0 copied to clipboard

A Redis client for Dart with connection pooling, cluster support, dedicated Pub/Sub and transaction sessions, and typed helper APIs.

example/example.dart

import 'package:daredis/daredis.dart';

/// Minimal standalone example for a local Redis server.
Future<void> main() async {
  final client = Daredis(
    options: const ConnectionOptions(
      host: '127.0.0.1',
      port: 6379,
    ),
  );

  await client.connect();

  try {
    const key = 'example:greeting';

    await client.set(key, 'hello from daredis');
    final value = await client.get(key);

    print('Stored value: $value');

    await client.hSet('example:user:1', 'name', 'alice');
    await client.hSet('example:user:1', 'city', 'shanghai');
    final user = await client.hGetAll('example:user:1');

    print('User hash: $user');
  } finally {
    await client.close();
  }
}
0
likes
0
points
568
downloads

Publisher

unverified uploader

Weekly Downloads

A Redis client for Dart with connection pooling, cluster support, dedicated Pub/Sub and transaction sessions, and typed helper APIs.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on daredis