DatabaseStorage class Null safety

A class that simplifies storage of data in a database

Complex interactions can be accomplished by directly calling methods on db

Inheritance
Mixed in types
Implementers

Constructors

DatabaseStorage(String name, [int version = 1])

Properties

db Database
The database connection to handle data storage operations
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isReady bool
The current ready status of the database
read-only
name String
Name of the database
final, inherited
path String
The path to the database on disk
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
schema Map<String, List<String>>
The database schema as a map of the table name to the column names
final, inherited
tableNames List<String>
List of table names currently in database
read-only, inherited
version int
The current version of the database
final, inherited

Methods

addColumn(String table, String columnName, String dataType) Future<void>
Adds a column with columnName and dataType to a table in the database
inherited
addItem(DatabaseItem item) Future
Adds an item to the database [...]
inherited
addTable(String tableName, {DatabaseItem? item}) Future<void>
Adds a table to the database
inherited
close() Future<void>
Closes the connection to the database
deleteItem(String table, String id) Future<int>
Deletes an item from the database table with id indicated
inherited
deleteTable(String tableName) → dynamic
Deletes the table with tableName from the database
inherited
ensureDbOpen() Future<void>
Ensures that a databse connection is open before using db
override
getItem(String table, String id) Future<Map<String, dynamic>?>
Gets an item from the database table with id indicated
inherited
getItems(String table) Future<List<Map<String, dynamic>>>
Gets all items from the database table
inherited
loadTableSchema() Future<void>
Loads the table schema from the database
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
open() Future<void>
Opens the connection to the database and saves connection to db
remove() Future<void>
Removes the database from the disk [...]
toString() String
A string representation of this object. [...]
inherited
updateItem(DatabaseItem item) Future<int>
Deletes an item from the database
inherited
updateTableSchema(String table, List<String> columns) → dynamic
Updates the schema
inherited
verifySchema(DatabaseItem item) → dynamic
Verifies the database schema for the current item
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited