0

I encounter an error when I want to retrieve data from my expo-sqlite database

Row too big to fit into CursorWindow requiredPos=0, totalRows=1

Data are images in base64 format, I am using react native and expo.

Is it possible to increase this memory parameter? Or recover the data another way? but I don't know in advance the size of what I'm going to fetch exactly, and here there is one row but other functions fetch more rows at a time

export function getLastReponseJustificationPhoto(auditId,idAuditSite,idQuestionSite) {
        return new Promise((resolve, reject) => {
            db.transaction(tx => {
                tx.executeSql(
                    "SELECT * FROM JustificationsReponsesAudit WHERE auditId = ? AND questionId = ? AND idAuditSite = ? AND idQuestionSite = ? ORDER BY id DESC LIMIT 1",
                    [auditId, idQuestionSite, idAuditSite, idQuestionSite],
                    (_, { rows }) => {
                        resolve(rows);
                    },
                    (_, error) => {
                        alert('ERROR')
                        console.log(error)
                    },
                )
            })
        }
    )
}

The table in question is very simple, the other elements are some id and this column with the base64.

Table "JustificationsReponsesAudit"

"JustificationsReponsesAudit("
         "id INTEGER PRIMARY KEY NOT NULL,"
         "auditId INTEGER,"
         "questionId INTEGER,"
         "idAuditSite INTEGER,"
         "idQuestionSite INTEGER,"
         "justificationImage TEXT," // -> base64
         "justificationInitialeId INTEGER,"
         "type TEXT" // -> Very short text
 ")",
            

I see that it is sometimes advisable to divide your data but I don't see how to divide such a long character string, it seems complicated to me, especially since I don't know its exact length each time. I would like to avoid that.

No error on IOS, only on Android

Thank you.

Camille
  • 1
  • 4

0 Answers0