Commit 853786b2 authored by nanahira's avatar nanahira

readme

parent 62d28c7f
...@@ -22,12 +22,14 @@ Those decorators would all decorate the following, with the SAME settings. ...@@ -22,12 +22,14 @@ Those decorators would all decorate the following, with the SAME settings.
@Entity() @Entity()
export class User extends IdBase() { export class User extends IdBase() {
@Index() @Index()
@QueryLike() // queries as 'where name LIKE :name%'
@StringColumn(5, { @StringColumn(5, {
required: true, required: true,
description: 'User name', description: 'User name',
}) })
name: string; name: string;
@QueryEqual() // queries as 'where age = :age'
@IntColumn('int', { unsigned: true, description: 'User age', default: 20 }) @IntColumn('int', { unsigned: true, description: 'User age', default: 20 })
age: number; age: number;
...@@ -59,9 +61,14 @@ export class User extends IdBase() { ...@@ -59,9 +61,14 @@ export class User extends IdBase() {
this.name = this.name.toUpperCase(); // Do something after create before sending to user. this.name = this.name.toUpperCase(); // Do something after create before sending to user.
} }
override async beforeGet() {} override async beforeGet() {
override async afterGet() {} }
override async beforeUpdate() {}
override async afterGet() {
}
override async beforeUpdate() {
}
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment