import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import Table from "@entity-access/entity-access/dist/decorators/Table.js"; @Table("Configuration") export default class Configuration { @Column({ key: true, dataType: "Char", length: 200}) name: string; // @Column({ nullable: true }) // username: string; // @Column({ nullable: true }) // @IgnoreJsonProperty // password: string; // @JsonProperty() // savePassword: string; // @Column({ default: () => Sql.date.now()}) // dateUpdated: DateTime; // decryptedPassword: string; public get value(): T { return (this.configValue && JSON.parse(this.configValue)) || null; } public set value(v: T) { this.configValue = JSON.stringify(v, undefined, 4); } @Column({ dataType: "Char", columnName: "value", nullable: true}) private configValue: string; }