drift_devtools library

Public API for sending a local DB file to the Drift Studio VS Code extension.

Usage (in your app):

import 'package:drift_devtools/drift_devtools.dart';

// only call in debug or behind a flag
await sendDbFileToDevTools('/data/data/com.example/databases/app.db');

Properties

importLibrary Future<void> Function()?
getter/setter pair

Functions

sendDbFileToDevTools(String dbPath, {String host = '10.0.2.2', int port = 38947, bool showLogs = true, bool keepConnection = false}) Future<DevToolsClient?>
Connects to the extension dev server and sends the DB file at dbPath. No-op in release builds. Sends the DB file at dbPath to the Drift Studio dev server.
sendDriftDbToDevTools(dynamic generatedDb, {String? dbPath, String dbName = 'app.db', String? extractor(dynamic generatedDb)?, String host = '10.0.2.2', int port = 38947}) Future<void>
Attempt to detect and send a Drift database file to the extension.
sendNamedDbToDevTools(String dbName, {String host = '10.0.2.2', int port = 38947, bool showLogs = true}) Future<void>
Convenience wrapper that attempts to find the typical sqflite DB path using the provided dbName. If you know the path, call sendDbFileToDevTools(dbPath) directly.