Skip to main content

coffeeql 0.4.0 copy "coffeeql: ^0.4.0" to clipboard
coffeeql: ^0.4.0 copied to clipboard

CoffeeQL SDK for Dart and Flutter — One syntax. Any database. (PostgreSQL, MongoDB, MySQL, Redis)

CoffeeQL Dart SDK #

pub package License: MIT

One syntax. Any database.

CoffeeQL SDK for Dart and Flutter. Query PostgreSQL, MongoDB, MySQL, and Redis using a single unified query syntax.


🚀 Quickstart #

1. Add dependency #

Add coffeeql to your pubspec.yaml:

dependencies:
  coffeeql: ^0.4.0

Or run:

dart pub add coffeeql

2. Connect and Query #

import 'package:coffeeql/coffeeql.dart';

void main() async {
  final db = CoffeeQL(
    server: 'http://localhost:3080',
    adapters: {
      'users[]': 'postgresql://user:pass@localhost:5432/mydb',
      'products{}': 'mongodb://localhost:27017/mydb',
      'session:{}': 'redis://localhost:6379',
    },
  );

  await db.connect();

  // Read
  final users = await db.query('users[].where(plan = "pro").cup(10)');
  print(users); // -> [{'name': 'Khushvi', 'plan': 'pro'}, ...]

  // Insert
  await db.pour('users[]', {'name': 'Alice', 'plan': 'pro'});

  // Update
  await db.refill('users[]', 'id = 1', {'plan': 'enterprise'});

  // Delete
  await db.spill('users[]', 'id = 99');

  // Raw Database Command
  final raw = await db.raw('users[]', 'SELECT * FROM users LIMIT 5');

  // Explain execution plan
  final plan = await db.explain('users[].cup(5)');
  print(plan.rendered);

  await db.disconnect();
}

📦 Features #

  • Language Parity: Full CRUD, .raw(), and .explain() support matching Python and Node SDKs.
  • Flutter & Server-Side Dart: Runs in Flutter mobile/desktop/web apps as well as Dart backend services.
  • Strong Typing: Clean ResultSet, ExplainPlan, and AdapterInfo models.
  • Fail-Safe Connection: Connects through self-hosted coffeeql-server binary with connection pooling and timeouts.

📄 License #

MIT © CoffeeQL

0
likes
140
points
106
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

CoffeeQL SDK for Dart and Flutter — One syntax. Any database. (PostgreSQL, MongoDB, MySQL, Redis)

Homepage
Repository (GitHub)

License

unknown (license)

Dependencies

http

More

Packages that depend on coffeeql