Skip to content

High memory usage & unexpected logging just by importing NitroSQLite.executeAsync #185

@PwGawzynski

Description

@PwGawzynski

Hi! 👋
I’m experiencing a strange issue when using NitroSQLite in my Expo / React Native app (dev build).

I have a simple function like this:

export const selectTracks = async (limit: number, offset: number) => {
  return NitroSQLite.executeAsync(
    'tracks',
    'SELECT track_id FROM "Tracks" LIMIT ? OFFSET ?;',
    [limit, offset],
  ).then(({ rows }) => rows.item(0));
};

The problem is that no matter where I put this function — even if I don’t call selectTracks at all — just importing the file causes a huge memory spike. On top of that, I see a massive console output like this, even though I’m not using any console.log anywhere:

{"insertId": 0, "rows": {"_array": [[Object], [Object], [Object], ... ]}}

Is it possible that NitroSQLite is somehow loading the entire database into memory when I use select ?
Or is there any internal logging happening automatically?

Any help would be greatly appreciated 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions