CoffeeQL Dart SDK

pub package License: Proprietary

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

Proprietary — Copyright © 2026 Khushvi Bamrolia. All rights reserved. See LICENSE and coffeeql.dev/terms.

Libraries

coffeeql
CoffeeQL Client Library for Dart and Flutter. One syntax. Any database.