I’m trying to create query using create query builder function, but it keeps telling me whenever i try to search for a column that it’s not found, and i’m pretty sure that the column exists because when i print the table entity to the console, the column is there with the value i’m trying to search for, but it keeps telling me no such column
I’m using ionic-orm to connect to sqlite offline DB on phone storage
TS:
onShowFilter(event: MouseEvent){
const popover = this.popOver.create(SearchFilterPage);
popover.present({ev: event});
popover.onDidDismiss((searchObj) => {
let connection = getConnection();
let equipmentRepository = connection.getRepository(Equipments);
console.log(searchObj);
let searchResult = equipmentRepository.createQueryBuilder('equipment')
.where('equipment._id='+searchObj._id)
.andWhere('equipment.serial_number='+searchObj.serial_number)
.andWhere('equipment.standard='+searchObj.standard)
.andWhere('equipment.inspection_location='+searchObj.inspection_location)
.andWhere('equipment.equipment_type='+searchObj.test_type)
.andWhere('equipment.created_at='+searchObj.created_at)
.andWhere('equipment.authenticator='+searchObj.authenticator)
.andWhere('equipment.due_date='+searchObj.due_date)
.andWhere('equipment.inspection_date='+searchObj.inspection_date)
.getResults();
console.log(searchResult);
searchResult.then(res => {
console.log(res);
this.equipments = res;
searchObj data is right and i can get it fro search filter component successfully, i can search with _id, standard and serial_number but when i try any other column it tells me no such column!
I opened the DB and found out that the column i’m trying to search exists and with the values i’m searching for.
I tried dropping DB and creating tables from the beginning but i can see the same thing, same error.
for any questions or any info feel free to ask.