is react) that has typeorm as database manager?
i am trying typeorm docs but no success. i have two problems.
first let's just send how i use typeorm:
1. i tried sample from typeorm docs.
2. then i added my own config to DataSource.
export const AppDataSource = new DataSource({
//same as docs except this
entities: [Photo],
synchronize: false,
migrationsRun: true,
migrations: ["path/to/migrations/folder/*{.ts,.js}"]
})
3. then using that like this
const photoRepository = AppDataSource.getRepository(Photo);
const photo = new Photo();
photoRepository.save(photo);
4. i get this:
Error: No metadata for "Photo" was found.
Show us the class Photo
same as docs
Обсуждают сегодня