Message from JavaScript discussions

October 2020

— Same

— 

Mostly I use database clients to visualize / inspect stuff, if I feel like I need clearer overview than CLI / library can easily provide

— I use TypeORM to define and create tables, so I don't really make major changes other than manual small fixes to individual rows inside DBeaver

Message permanent page

— I need to try this *_*

— Active Record or Repository?

— Yes, now that you are fluent in TypeScript, TypeORM will be very sexy

— Repository, but it really doesn't matter

— Entity()
export class User {

PrimaryGeneratedColumn()
id: number;

Column()
firstName: string;

Column()
lastName: string;

Column()
age: number;

}


createConnection({
...,
entities: [ User ],
synchronize: true,
logging: true
});

Message permanent page

— This is really the crux of TypeORM

— synchronize: true for development

— Yep i already fantasized about using it

— It'll scan your class, and apply whatever changes are needed to the actual DB (creating tables, adding / removing / changing column types)

Message permanent page