Dartabase
Database (Rails like) migration and model (ORM CRUD) and code generator (Scaffolding) tool working with MYSQL and PGSQL in Dart without having to write SQL
Install / Use
/learn @HannesRammer/DartabaseREADME
Dartabase Tools
Model depends on Migration
Dartabase Migration 1.x.x
Dartabase Migration is for simple version controlled database structure manipulation for MySQL or PGSQL without having to write SQL
create migration
migration view
migration view reverting to older version
scaffolding
- generate classes, server and client files from database with a single click
Dartabase Model 1.x.x
Dartabase Models is for simple data manipulation and builds on Migration for MySQL or PGSQL without having to write SQL
eg. if you have a class named WebLanguage
class WebLanguage extends Model{
num id;// database column autogenerated by migration
String name;
bool is_cool;
DateTime created_at;// database column autogenerated by migration
DateTime updated_at;// database column autogenerated by migration
}
to update a single database object:
WebLanguage WLDB = new WebLanguage();
WebLanguage webLanguage = await WLDB.findBy("name","javascript");
if(webLanguage != null){
webLanguage.name = "dart";
webLanguage.is_cool = true;
webLanguage.save();
}
available methods are
Future save()
Future findBy(String column,var value)
Future findById(var id)
Future findAllBy(String column, var value)
Future findAll()
Future delete()
relations:
Future receive(object)
Future hasOne(object)
Future hasMany(object)
Future hasOneWith(object,String column,String value)
Future hasManyWith(object,String column,String value)
Future remove(object)
ENJOY & BE NICE ;)
