WatermelonDB is a cross-platform high-level layer for dealing with data, but can be plugged in to any underlying database, depending on platform needs. The adapter merely performs simple CRUD (create/read/update/delete) operations. WatermelonDB comes with two concrete implementations: 1) SQLiteAdapter is an adapter for React Native, based on SQLite 2) LokiJSAdapter is an adapter for the web, based around LokiJS
Questions tagged [watermelondb]
41 questions
0
votes
0 answers
can not fetch relational data in watermelondb
i have modles Staff.js and RanchOwner.js.
Staff has One to many relation with ranch_owners , i want to fetch all ranch owners related to staff
Staff.js
import { Model } from '@nozbe/watermelondb';
import { field, date, relation } from…

web pakistan
- 444
- 1
- 4
- 16
0
votes
0 answers
How to get getter value in functions other than JSX
I'm using watermelondb for local storage in react js. there are multiple columns which i can access directly but one colum role_id i don't want to fetch it as role_id i want to convert it into role. for which in model of watermelon db i am use get()…

web pakistan
- 444
- 1
- 4
- 16
0
votes
0 answers
Editing data not working on iOS with WatermelonDB realsed version
Description:
I am encountering an issue with WatermelonDB where I am unable to edit data on iOS using the released version of React Native.
Expected behavior:
The record should be updated with the new data.
Actual behavior:
The record is not…

Leul Ayalew
- 113
- 2
- 10
0
votes
0 answers
nextjs, watermelonDb TypeError: LokiWebWorker is not a constructor
I am creating a nextjs chat app with watermelonDb as the offline db on the client side. I am new to nextjs. I am getting this error when I have useWebWorker: true in the adapter instantiation. When I have the useWebWorker:false everything works…

Sarath Sai
- 1
- 1
0
votes
0 answers
Upgrading WatermelonDB, gives "error: cannot find type 'RCTBridge' in scope"
I'm trying upgrade my react-native app to my iOS. so I update all depencency include WatermelonDB. so I follow the instruction in here
this is my env
XCode 14.2
"react": "18.2.0",
"react-native": "0.71.4",
"@nozbe/watermelondb":…

newbie
- 929
- 17
- 35
0
votes
1 answer
WatermelonDB function hasUnsyncedChanges
I am using WatermelonDB in my RN app. I am trying to display a button if WatermelonDB has unsynced changes. WatermelonDB has a function called hasUnsyncedChanges that returns a boolean. I can get the function to console.log true/false. But unsure…

doobe01
- 1
- 2
0
votes
1 answer
useEffect() and array of deeply nested objects
I am trying to call useEffect() whenever arrayWithDeeplyNestedObjects changes. export default compose(... is part of an offline first database (watermelonDB) and updates arrayWithDeeplyNestedObjects when there is a change in the database. One could…

four-eyes
- 10,740
- 29
- 111
- 220
0
votes
0 answers
The following build commands failed: SwiftCompile normal x86_64 Compiling\ DatabaseBridge.swift (in target 'WatermelonDB' from project 'Pods')
I inherited a React Native project (previous developer is not reachable anymore) and building the iOS App with npx react-native run-ios always fails with:
** BUILD FAILED **
The following build commands failed:
SwiftCompile normal x86_64…

Daniel
- 329
- 2
- 11
0
votes
0 answers
watermelondb warning - multiple readers/writers
I'm getting the following warning and I don't know what can be the cause for it
Anyone ran into this warning?
Thanks
I'm working on rocketchat instance and this warning is just keep popup once in a while
0
votes
1 answer
How to get the actual data inside ._raw from fetch() query result in WatermelonDB?
I do have a single query like this:
const rows = await db.active.collections
.get('messages')
.query(
Q.where('status', messagesStatus.ERROR)
).fetch()
the results is like this:
[
{
__changes: Object,
isEditing:…

Prieyudha Akadita S
- 390
- 4
- 14
0
votes
1 answer
Error: Cannot call database.adapter.underlying Adapter while the database is being reset watermelondb
Exception com.facebook.react.common.JavascriptException: Error: Cannot call database.adapter.underlyingAdapter while the database is being reset
I can see multiple crashes in the play store with the above stack trace, I am using watermelon DB in…

pradeep_ch
- 124
- 8
0
votes
1 answer
Error: record.prepareUpdate was called on ${this.table}#${this.id} but wasn't sent to batch() synchronously -- this is bad
I'm on react native and I'm unsure how to use prepareUpdate is it okay to do the following?
const oldChannel = await getChannel('asdf')
const prepareChannel = (x: Channel) => {
x._raw.id = 'asdf'
x.parent!.id = 'test'
}
const preparedChannel =…

david_adler
- 9,690
- 6
- 57
- 97
0
votes
1 answer
Where can I find the ios/podfile in an expo project
I am trying to get watermelondb working in my expo project with sdk 45. I am using expo-dev-client and building with Expo Application Services (EAS). I have figured out that I need to install this plugin and that I need the to apply this patch to…

BruceHill
- 6,954
- 8
- 62
- 114
0
votes
1 answer
React Native WatermelonDB Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
So I installed WatermelonDB for React Native and wanted to use it. I did everything exactly like in the installation guide but it seems like it didn't work.
This is the error I get:
This are my dependecies:
"dependencies": {
…

Henrik
- 828
- 8
- 34
0
votes
1 answer
`.pipe()` not executing `debounceTime`
I'm trying to debounce() an Observable with pipe() and chaining .subscribe() but for some reason the function in the subscribe is still being called over a dozen times in one go.
What I'm trying to do is pipe the withChangesForTables and debounce…

Ryker
- 446
- 3
- 14