fedaco 3.0.0-alpha.1
Install from the command line:
Learn more about npm packages
$ npm install @gradii/fedaco@3.0.0-alpha.1
Install via package.json:
"@gradii/fedaco": "3.0.0-alpha.1"
About this version
No short description right now. can play fedaco here https://github.com/gradii/play-fedaco
- setup a connection
const db = new DatabaseConfig(); db.addConnection({ 'driver' : 'sqlite', 'database': ':memory:' }); db.bootFedaco(); db.setAsGlobal();
- define a model
@Table({ tableName: 'user' }) class User extends Model { @PrimaryColumn id; @Column() email; @Column() name; @Column() age; @CreatedAtColumn() created_at; @UpdateAtColumn() updated_at; }
- fetch data
const list = await User.createQuery().get();
const schemaBuilder = Model.getConnectionResolver()
.connection(connectionName)
.getSchemaBuilder();
;
await schemaBuilder().create('users', table => {
table.increments('id');
table.string('email').withUnique();
table.string('name');
table.string('age');
});
- wrapped driver. unify all driver query api
- compile query builder to sql
- decorate to define model
- soft delete
- use relationship to link model
- relation can set dynamic constrain
- sqlite and mysql support
- [ ] postgres full support
- [ ] mssql full support
- [ ] migration