drift_db_viewer

v2.1.0

A package to view your drift database in your own app with filtering and without the need of exporting your db file.

Package archive: https://pubdev.letsnova.ru/api/archives/drift_db_viewer/2.1.0.tar.gz

Installdart pub add drift_db_viewer

Readme

drift_db_viewer

pub package

This package allows us to view our database in our development app without the need of exporting your database file. Filtering is done at database level

Example

Example

Setup

Add dependency to pubspec

pub package

dependencies:
                  drift_db_viewer: <latest-version>
                

Use it

Push a new route. The child will be the DriftDbViewer and pass your database to this screen.

final db = MyDatabase(); //This should be a singleton
                Navigator.of(context).push(MaterialPageRoute(builder: (context) => DriftDbViewer(db)));
                

Drift Config

Using named columns

When using named columns you should add a @JsonKey to the column otherwise we won't be able to hide this table

class Todos extends Table {
                  IntColumn get id => integer().autoIncrement()();
                
                  TextColumn get title => text().withLength(min: 6, max: 32)();
                
                  @JsonKey('body') //This is required for the drift_db_viewer.
                  TextColumn get content => text().named('body')();
                
                  IntColumn get category => integer().nullable()();
                }
                

Changelog

2.1.0

Fix

  • Deprecation warnings

2.0.0

Breaking

  • Drift v2 support

1.0.3

Version bump

  • Updated drift to 1.3.0

1.0.2

Fixed

  • Imports

Version bump db_viewer

Including:

1.0.1

Version bump db_viewer

Including:

1.0.0

Added

  • Because moor changed to drift this is the new implementation of the moor_db_viewer that supports drift
  • This is the initial release