Skip to Content
Getting StartedInstall & Connect

kalam_link Setup

kalam_link is the live SQL client. For a Flutter app with a local cache and offline writes, start at Kalam Sync instead.

Point it at a server that is already running. Server install, Docker, and first-user bootstrap live in the server quick start and kalam init.

Install

pubspec.yamlYAML
dependencies:kalam_link: ^0.8.0
BASH
flutter pub add kalam_link

Initialize once

DART
import 'package:flutter/widgets.dart';import 'package:kalam_link/kalam_link.dart'; Future<void> main() async {  WidgetsFlutterBinding.ensureInitialized();  await KalamClient.init();  runApp(const MyApp());}

Do not await KalamClient.connect() before runApp(). Connect after the first frame, from a service or widget.

Connect and query

DART
final client = await KalamClient.connect(  url: 'http://localhost:2900',  authProvider: () async => Auth.basic('root', 'kalamdb123'),); final result = await client.query('SELECT CURRENT_USER()');if (!result.success) {  throw StateError('${result.error}');}print(result.rows.first);

Production apps should return Auth.jwt(...) from authProvider. See Authentication.

Rows are Map<String, KalamCellValue>. Use asString(), asInt(), asBool(), and asFile().

Live rows

DART
final tasks = client.liveTable<Map<String, KalamCellValue>>('app.tasks'); final sub = tasks.listen((rows) {  print('rows=${rows.length}');}); await sub.cancel();await client.dispose();

Use live() for a custom SELECT ... FROM ... WHERE .... Do not put ORDER BY or LIMIT in live SQL.

Raw insert/update/delete events: Realtime Subscriptions.

Next

SDK release checks and troubleshooting

For SDK contributors, run bash test-offline.sh in link/sdks/dart/link. This runs all top-level offline tests, including declared Flutter platform folders, Android arm64-v8a/x86_64 library presence and ELF architecture, and iOS archive size. test.sh adds running-server integration coverage. publish.sh blocks on offline test failures; device builds and package archive inspection are separate checks.

If a newly published version is unavailable from a stale local hosted cache, run flutter pub cache add kalam_link --version <published-version>, then flutter pub get. First confirm publication completed and your constraint permits the version. The currently declared Flutter plugin platforms are Android and iOS; native build artifacts alone do not establish desktop or web support.