SQLite query hanging

I have an SQLite query which is calling neither the success nor failure function. It just hangs.

Does anyone have an idea for debugging this?

Hey @dweb0,

Can you let us know which SDK version you are running, on what Platform this is occurring on and share the relevant code that contains the SQLite call and any associated logic?

A friendly reminder that providing as much relevant information and context as possible is the best way to get the most out of our support!

Cheers,
Adam

Android. SDK 34.

The code isn’t doing anything remarkable.

export const CREATE_SITLOG =
  'create table if not exists sitlog (id integer primary key not null, start_time text, end_time text, elapsed_time int);';
export const SELECT_ALL = 'select * from sitlog';
export const INSERT_OR_IGNORE =
  'insert or ignore into sitlog (start_time, end_time, elapsed_time) values (?,?,?)';

export const executeSingularTx = async (
  sql: any,
  params: any = []
): Promise<any> => {
  console.log(sql, params);
  return new Promise((resolve, reject) =>
    db.transaction((tx: any) => {
      console.log('In transaction');
      tx.executeSql(
        sql,
        params,
        (tx: any, { rows }: any) => {
          console.log('Resolved');
          return resolve(rows._array);
        },
        (tx: any, error: any) => {
          console.log('Error');
          console.log(tx, error);
          reject(error);
        }
      );
    })
  );
};

The CREATE_SITLOG query works. INSERT_OR_IGNORE hangs (I see ‘In transaction’ but nothing else). I use the executeSingularTx function to run the queries.

@adamjnav

Hello?

I can add that this code was working in Expo v31.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.