Chcę wstawić nagranie do programu SQL Server przy użyciu typeorm, gdzie kolumna jest typu bigint. Mam istotę "Koty" z typ identyfikatora: bigint.
import { Column, Entity } from 'typeorm';
@Entity('Cats')
export class CatsEntity {
@Column({ type: 'bigint', name: 'CatID' })
public id: string;
@Column('int', { primary: true, name: 'CatDB' })
public db: number;
@Column('varchar', { name: 'Name' })
public name: string;
@Column('datetime', { name: 'DDB_LAST_MOD' })
public ddbLastMod: Date;
}
I dto, co mam w kontrolerze:
export class InsertCatsDto {
public id: string;
public db: number;
public name: string;
}
Zapisywanie odbywa się w kontrolerze:
@Post('/cats')
public async insertEobResponse(@Body() insertCatsDto: InsertCatsDto): Promise<any> {
const cats = new CatsEntity();
cats.id = insertCatsDto.id;
cats.db = insertCatsDto.db;
cats.name = insertCatsDto.name;
cats.ddbLastMod = new Date();
return this.catsRepository.insert(cats);
}
Ale gdy wysyłam zapytanie z identyfikatorem w postaci wiersza przez listonosza, otrzymuję następujący błąd:
Nie jestem pewien, że po prostu coś mi umknęło, czy trzeba dokonać jakiś konwersja wartości, czy jest to prawdziwy problem z typeorm.