margelo / margelo/react-native-nitro-sqlite
High memory usage & unexpected logging just by importing NitroSQLite.executeAsync
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 565
- Forks
- 53
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 18
Description
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 🙏
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the import-only behavior in an Expo/React Native dev build using the shown selectTracks function and NitroSQLite.executeAsync. Trace whether importing the function triggers the reported memory spike or logging, and consider the issue resolved when the cause of both behaviors is identified and verified without calling selectTracks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, sql, sqlite
- Domain
- databases, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100