Skip to content

TriCoreDB for Dart

0.1.0

The official Dart / Flutter client: SQL, documents, cache, vectors and graphs over one native connection.

Install

dart
dart pub add tricoredb
pubspec.yaml
dependencies:
  tricoredb: ^0.1.0

Requirements

  • Dart 3.3 or later (Flutter 3.19+)
  • Any platform with dart:io: server, desktop, CLI and mobile
  • A TriCoreDB server, 0.1.0-rc.1 or later (install one)

Highlights

  • No dependencies: dart:io and dart:convert, TLS included
  • Works in Flutter apps on mobile and desktop
  • Transactions, connection pool, TLS and mutual TLS

Quick start

main.dart
import 'package:tricoredb/tricoredb.dart';

Future<void> main() async {
  final db = await TriCore.connect(
    host: '127.0.0.1',
    port: 8427,
    user: 'admin',
    secret: 'your-password',
  );

  await db.execute('CREATE TABLE IF NOT EXISTS people (id INT PRIMARY KEY, name TEXT, score DOUBLE)');
  await db.execute('INSERT INTO people VALUES (?, ?, ?)', [1, 'ada', 9.5]);

  final rows = await db.query('SELECT name, score FROM people WHERE id = ?', [1]);
  print(rows.value(0, 'name')); // ada

  await db.close();
}

TLS

This example connects without TLS, which matches the development container. The default image requires TLS. The README shows how to connect with a CA certificate, and documents every call.