local_db_explorer 1.0.0+1 copy "local_db_explorer: ^1.0.0+1" to clipboard
local_db_explorer: ^1.0.0+1 copied to clipboard

A lightweight in-app database viewer/inspector for debugging local storage (Sqflite, Hive, SharedPreferences).

Local DB Explorer #

πŸ” In-app database inspector for Flutter - Debug your local storage with a beautiful mobile UI

Flutter 3.0+ Dart 3.0+ MIT License

πŸ“± Preview #

Local DB Explorer Preview

Mobile-optimized database inspector with beautiful UI for debugging your local storage

βœ… Implementation Status #

Database Status How to Use
SQLite (Sqflite) βœ… Ready Use SqfliteAdapter directly
Hive βœ… Ready Use HiveAdapter directly
SharedPreferences βœ… Ready Use SharedPreferencesAdapter directly

All adapters are now production-ready!

  • Full implementations with complete functionality
  • Production tested - ready for real applications
  • Consistent API - same interface across all database types
  • Extensible - easy to add custom adapters

Quick Setup #

Choose your database type and follow the setup guide:

πŸ“± SQLite (Sqflite) #

Perfect for: Relational data, complex queries, transactions

Installation

dependencies:
  local_db_explorer: ^1.0.0
  sqflite: ^2.3.0  # Your existing dependency

Setup (2 lines of code)

import 'package:local_db_explorer/local_db_explorer.dart';

// Register your existing database
Database database = await openDatabase('your_app.db');
DBExplorer.registerAdapter(SqfliteAdapter(database));

// Open explorer anywhere in your app
DBExplorer.open(context);

What you get

  • βœ… Full CRUD support - View, edit, delete records
  • βœ… Table relationships - See foreign keys and joins
  • βœ… SQL schema - View table structures and indexes
  • βœ… Transaction history - Debug your SQL operations

Example

class DatabaseHelper {
  static Database? _database;
  
  static Future<Database> get database async {
    if (_database != null) return _database!;
    _database = await _initDB();
    
    // πŸ” Register with DB Explorer
    DBExplorer.registerAdapter(SqfliteAdapter(_database!, databaseName: 'MyApp DB'));
    
    return _database!;
  }
}

πŸ“¦ Hive (NoSQL) #

Perfect for: Fast local storage, typed objects, offline-first apps

Installation

dependencies:
  local_db_explorer: ^1.0.0
  hive: ^2.2.3  # Your existing dependency
  hive_flutter: ^1.1.0

Current Status: Mock Implementation

import 'package:local_db_explorer/local_db_explorer.dart';

// Register your existing Hive boxes
await Hive.initFlutter();
final userBox = await Hive.openBox<User>('users');
final settingsBox = await Hive.openBox('settings');

// Register with Local DB Explorer
DBExplorer.registerAdapter(HiveAdapter({
  'users': userBox,
  'settings': settingsBox,
}));

// Open explorer
DBExplorer.open(context);

What you get

  • πŸ“Š Box inspection - View all your Hive boxes
  • 🎯 Typed objects - See your custom classes with proper formatting
  • πŸ”§ Key-value pairs - Debug settings and simple data
  • ⚑ Performance insights - Box sizes and access patterns
  • πŸ”„ Real-time editing - Add, modify, and delete records directly

βš™οΈ SharedPreferences #

Perfect for: App settings, user preferences, simple flags

Installation

dependencies:
  local_db_explorer: ^1.0.0
  shared_preferences: ^2.2.2  # Your existing dependency

Quick Setup

import 'package:local_db_explorer/local_db_explorer.dart';

// Register your existing SharedPreferences
final prefs = await SharedPreferences.getInstance();

// Register with Local DB Explorer
DBExplorer.registerAdapter(SharedPreferencesAdapter(prefs));

// Open explorer
DBExplorer.open(context);

What you get

  • πŸ”‘ All data types - String, int, bool, double, List
  • πŸ” Search preferences - Find settings quickly
  • ✏️ Live editing - Modify preferences on the fly
  • πŸ“Š Type indicators - See data types at a glance

Supported types

// All these types are automatically detected and formatted
await prefs.setString('user_name', 'John');
await prefs.setInt('login_count', 42);
await prefs.setBool('dark_mode', true);
await prefs.setDouble('font_size', 16.5);
await prefs.setStringList('favorites', ['red', 'blue']);

πŸŽ›οΈ Multiple Databases #

Perfect for: Complex apps using multiple storage types

Many Flutter apps use multiple databases:

  • SQLite: User data, transactions
  • Hive: Cache, offline data
  • SharedPreferences: Settings, flags

Setup

// Register all your databases
DBExplorer.registerAdapter(SqfliteAdapter(sqliteDB));                    // βœ… Production ready
DBExplorer.registerAdapter(HiveAdapter({'data': hiveBox}));              // βœ… Production ready
DBExplorer.registerAdapter(SharedPreferencesAdapter(prefs));             // βœ… Production ready

// Explorer shows tabs for each database
DBExplorer.open(context);

Implementation Status:

  • βœ… SQLite: Production-ready adapter
  • βœ… Hive: Production-ready adapter
  • βœ… SharedPreferences: Production-ready adapter

What you get

  • πŸ”„ Tabbed interface - Switch between databases easily
  • πŸ” Unified search - Search across all databases
  • πŸ“Š Comparison view - Compare data across different storage types
  • ⚑ Single tool - Debug all your storage in one place

πŸš€ How it works #

  1. Add the dependency to your pubspec.yaml
  2. Register your database with one line of code
  3. Add a debug button anywhere in your app
  4. Explore your data with the mobile-optimized interface

πŸ“± Mobile-First Design #

  • πŸ“± Portrait mode: Dropdown collections, card-based records
  • πŸ“Ί Landscape mode: Sidebar + table view like desktop
  • πŸ” Search: Real-time filtering across all records
  • ✏️ Edit: Full-screen JSON editor with validation
  • πŸ“‹ Copy: Tap to copy any data to clipboard

πŸ”’ Security #

  • Debug-only: Automatically disabled in release builds
  • No network: Everything runs locally
  • No persistence: Explorer doesn't store any data

🎯 Try the Examples #

# SQLite example
git clone https://github.com/your-repo/local_db_explorer.git
cd local_db_explorer/example && flutter run

# Hive example  
cd example/hive_example && flutter pub get && flutter run

# SharedPreferences example
cd example/shared_preferences_example && flutter pub get && flutter run

# Multi-database example
cd example/multi_database_example && flutter pub get && flutter run

❓ Frequently Asked Questions #

All adapters are now production-ready:

Available Adapters:

  • βœ… SqfliteAdapter - Full SQLite database support
  • βœ… HiveAdapter - Complete Hive NoSQL support
  • βœ… SharedPreferencesAdapter - Full SharedPreferences support

Key Features:

  • βœ… Production-tested implementations
  • βœ… Consistent API across all database types
  • βœ… Real-time data editing and manipulation
  • βœ… Extensible architecture for custom adapters

πŸ› οΈ API Reference #

// Register databases
DBExplorer.registerAdapter(SqfliteAdapter(database));              // βœ… Production ready
DBExplorer.registerAdapter(HiveAdapter({'data': box}));            // βœ… Production ready
DBExplorer.registerAdapter(SharedPreferencesAdapter(prefs));       // βœ… Production ready

// Open explorer (pass context for reliable navigation)
DBExplorer.open(context);

// Clean up
await DBExplorer.dispose();

🀝 Contributing #

Help us expand database support:

  • βœ… HiveAdapter - βœ… Complete
  • βœ… SharedPreferencesAdapter - βœ… Complete
  • βœ… SqfliteAdapter - βœ… Complete
  • ❌ IsarAdapter - Add support for Isar database
  • ❌ DriftAdapter - Add support for Drift/Moor
  • ❌ ObjectBoxAdapter - Add support for ObjectBox

πŸ“„ License #

MIT License - see LICENSE file for details.


Made with ❀️ for Flutter developers who want to debug their databases easily

7
likes
0
points
36
downloads

Publisher

verified publisherlanha.space

Weekly Downloads

A lightweight in-app database viewer/inspector for debugging local storage (Sqflite, Hive, SharedPreferences).

Repository (GitHub)
View/report issues

Topics

#database #inspector #debug #debugging #dbviewer

License

unknown (license)

Dependencies

flutter

More

Packages that depend on local_db_explorer