simple_mysql_orm library

Classes

Column
Holds a column definition as returned by 'show columns from
Dao<E>
DaoTenant<E extends EntityTenant<E>>
Db
DbPool
A pool of database connections.
Entity<T>
EntityTenant<T>
MySqlConnectonManager
Row
Tenant
Transaction<R>
Transactionable
TransactionTestScope
Use the TransactionTestScope
TypeDetails

Extensions

DateExtension on Date
KeyEx on Key
TimeExtension on Time
TypeEx on Type

Functions

addForeignKey({required String databaseName, required String foreignKeyName, required String table, required String column, required String foreignTable, required String foreignColumn}) Future<void>
Add a foreign key to a table.
createDatabase(String databaseName) Future<void>
dropDatabase(String databaseName) Future<void>
dropForeignKey({required String databaseName, required String foreignKeyName, required String table}) Future<void>
drops a foreign key from the table
dropIndex({required String databaseName, required String indexName, required String table}) Future<void>
Drops an index from databaseName.
existsDatabase(String databaseName) Future<bool>
Returns try if the schema databaseName exists.
hasForeignKey(String foreignKeyName) Future<bool>
check if a database has a foreign key. Foreign key names are global.
restoreDatabase({required String databaseName, required String pathToBackup, required bool thisWillDestroyMyDb}) Future<void>
Restores a database from a .sql file created by mysqldump.
tquery(String sql) Future<List<Row>>
Lets you run a query outside the scope of a Dao.
withNoConstraints<R>({required Future<R> action()}) Future<R>
Allows you to update the database with foreign key constraints disabled.
withTenant<T>({required int tenantId, required Future<T> action()}) Future<T>
SMO lightly supports the concept of a multi-tenant system.
withTenantByPass<R>({required Future<R> action()}) Future<R>
Allows a DaoTenant to access the db withouth passing in a tenant id. Use this method with CARE.
withTransaction<R>({required Future<R> action(), TransactionNesting nesting = TransactionNesting.nested, bool useTransaction = true, DbPool? dbPool, String? debugName}) Future<R>
Obtains a connection and starts a MySQL transaction.