मैं सम्मिलित करना चाहते हैं रिकॉर्ड में SQL सर्वर का उपयोग कर typeorm जहां स्तंभ प्रकार bigint. मैं 'बिल्लियों' संस्था के साथ आईडी के प्रकार: 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;
}
और डीटीओ, कि मैं पाने में नियंत्रक:
export class InsertCatsDto {
public id: string;
public db: number;
public name: string;
}
बचत में किया जाता है नियंत्रक:
@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);
}
लेकिन जब मैं भेजने का अनुरोध आईडी के साथ के रूप में एक स्ट्रिंग के माध्यम से डाकिया मैं निम्नलिखित त्रुटि मिलती है:
मैं नहीं हूँ यकीन है कि अगर मैं कर रहा हूँ बस कुछ याद आ रही है या की जरूरत बनाने के लिए कुछ परिवर्तन के मूल्यों या अगर यह एक वास्तविक समस्या के साथ typeorm.