TypeError: col.shouldDisableInsert is not a function

... (I use postgres)
1 Reply
Erkoze
ErkozeOP5d ago
I see TypeError: col.shouldDisableInsert is not a function every time i tried to insert a record to db
await this._drizzleService.db.insert(messages).values({
chatId: '0193ecd7-1385-5e5a-b722-83998e15a998',
content: 'Hello its a test',
authorId: 1
});
await this._drizzleService.db.insert(messages).values({
chatId: '0193ecd7-1385-5e5a-b722-83998e15a998',
content: 'Hello its a test',
authorId: 1
});
It worked before, but after i add new field to messages, i can't I also updated drizzle packages to latest versions i deleted new relation field after this error occured, but problem is still exist and i don't know what i can do... Hello everyone If anyone else encounters such an error I used:
const select: TMessageFindByIdSelect = getTableColumns(messages);

const query = db.select(select)
...
const select: TMessageFindByIdSelect = getTableColumns(messages);

const query = db.select(select)
...
//FIX THIS LINE:
const select: TMessageFindByIdSelect = getTableColumns(messages); //DELETE

//TO:
const select: TMessageFindByIdSelect = {
...getTableColumns(messages)
};
//FIX THIS LINE:
const select: TMessageFindByIdSelect = getTableColumns(messages); //DELETE

//TO:
const select: TMessageFindByIdSelect = {
...getTableColumns(messages)
};
And it works now)

Did you find this page helpful?