cth166

Results 7 comments of cth166

I tried a simple User Model which username is unique. And I add two records `{username:'#test'}` and `{username:'#Test'}`. It works fine. Then I add `{username:'#test'}` again. It throw an error....

give a @PrimaryKey in other filed

> src/db/models/index.ts export { User } from "./User"; ... > src/index.ts import { Sequelize } from 'sequelize-typescript'; import * as allModels from './models' const models = Object.entries(allModels).map(([_, model]) => model)...

There is no need to care about what's your model's name in sequelize.models. You should use User.findAll() and User.bulkCreate directly. instead of adding `sequelize.models` before them. Actually, if you bundle...

modelManager is never mentioned in the documentation. ```js import { Sequelize } from 'sequelize-typescript'; const sequelize = new Sequelize("postgres://dns", { logging: false, pool: { max: 10, min: 3, idle: 30000,...

"sequelize": "^6.33.0", "sequelize-typescript": "^2.1.5", my code works well. Executing (default): SELECT `id`, `createdAt`, `updatedAt`, `user-name` AS `username` FROM `User` AS `c` WHERE `c`.`id` = '1'; Let me add,in parenthesis, you...