Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/Nozbe/WatermelonDB
/ functions
Functions
970 in github.com/Nozbe/WatermelonDB
⨍
Functions
970
◇
Types & classes
272
↓ 476 callers
Function
it
(name, test)
src/adapters/__tests__/commonTests.js:38
↓ 191 callers
Method
write
* Schedules a Writer * * Writer is a block of code, inside of which you can modify the database * (call `Collection.create`, `Model.update`,
src/Database/index.js:252
↓ 131 callers
Function
invariant
(condition: any, errorMessage?: string)
src/utils/common/invariant/index.js:7
↓ 118 callers
Method
batch
(operations: BatchOperation[], callback: ResultCallback<void>)
src/adapters/type.js:50
↓ 117 callers
Function
mockDatabase
({ schema = testSchema, migrations = undefined } = {})
src/__tests__/testModels.js:112
↓ 105 callers
Method
query
(query: SerializedQuery, callback: ResultCallback<CachedQueryResult>)
src/adapters/type.js:38
↓ 96 callers
Method
get
* Returns a `Collection` for a given table name
src/Database/index.js:72
↓ 84 callers
Method
create
* Creates a new record. * Pass a function to set attributes of the new record. * * Note: This method must be called within a Writer {@link Da
src/Collection/index.js:146
↓ 72 callers
Method
find
(table: TableName<any>, id: RecordId, callback: ResultCallback<CachedFindResult>)
src/adapters/type.js:35
↓ 62 callers
Function
expectToRejectWithMessage
( promise: Promise<mixed>, message: string | RegExp, )
src/__tests__/utils/expectToRejectWithMessage/index.js:3
↓ 62 callers
Function
matchTest
( options: $Exact<{ name: string, query: QueryBuilders.Clause[], matching: Array<{ id: string, .
src/__tests__/databaseTests.js:10
↓ 62 callers
Function
mockTaskRaw
(raw)
src/adapters/__tests__/helpers.js:148
↓ 61 callers
Method
update
* Modifies the record. * Pass a function to set attributes of the new record. * * Updates `updateAt` field (if available) * * Note: Thi
src/Model/index.js:110
↓ 60 callers
Function
makeDatabase
()
src/sync/impl/__tests__/helpers.js:6
↓ 59 callers
Function
taskQuery
(...conditions)
src/adapters/__tests__/helpers.js:145
↓ 51 callers
Function
log
(text: string = '')
src/diagnostics/diagnoseSyncConsistency/impl.js:269
↓ 50 callers
Function
synchronize
(args: SyncArgs)
src/sync/index.js:123
↓ 48 callers
Method
log
(...messages: any[])
src/utils/common/logger/index.js:16
↓ 48 callers
Function
tableSchema
({ name, columns: columnArray, unsafeSql, }: TableSchemaSpec)
src/Schema/index.js:138
↓ 47 callers
Function
log
(text: string = '')
src/diagnostics/diagnoseDatabaseStructure/impl.js:160
↓ 46 callers
Method
call
(methodName: SqliteDispatcherMethod, args: any[], callback: ResultCallback<any>)
src/adapters/sqlite/type.js:88
↓ 41 callers
Function
prepareCreateFromRaw
(collection, dirtyRaw)
src/sync/impl/__tests__/helpers.js:29
↓ 40 callers
Method
count
(query: SerializedQuery, callback: ResultCallback<number>)
src/adapters/type.js:47
↓ 38 callers
Method
prepareCreate
* Prepares a new record to be created * * Use this to batch-execute multiple changes at once. * @see {Collection#create} * @see {Database#
src/Collection/index.js:161
↓ 36 callers
Function
sanitizedRaw
(dirtyRaw: DirtyRaw, tableSchema: TableSchema)
src/RawRecord/index.js:71
↓ 34 callers
Function
fetchLocalChanges
(db: Database)
src/sync/impl/fetchLocal.js:52
↓ 32 callers
Function
makeLocalChanges
(database)
src/sync/impl/__tests__/helpers.js:73
↓ 30 callers
Function
schemaMigrations
(migrationSpec: SchemaMigrationsSpec)
src/Schema/migrations/index.js:85
↓ 29 callers
Method
subscribe
(props: PropsInput, triggeredFromProps: any[])
src/react/withObservables/index.js:182
↓ 29 callers
Function
toPromise
(withCallback: (ResultCallback<T>) => void)
src/utils/fp/Result/index.js:8
↓ 28 callers
Function
addColumns
({ table, columns, unsafeSql, }: $Exact<{ table: TableName<any>, columns: ColumnSchema[], unsafeSq
src/Schema/migrations/index.js:144
↓ 28 callers
Function
expectSyncedAndMatches
(collection, id, match)
src/sync/impl/__tests__/helpers.js:40
↓ 28 callers
Function
makeDatabase
()
src/Model/test.js:86
↓ 28 callers
Method
serialize
()
src/Query/index.js:306
↓ 27 callers
Method
read
* Schedules a Reader * * In a Reader, you're guaranteed that no Writer is running at the same time. Therefore, you can * run many queries or
src/Database/index.js:270
↓ 26 callers
Function
arrayDifference
(previousList: T[], nextList: T[])
src/utils/fp/arrayDifference/index.js:5
↓ 25 callers
Method
_setRaw
(rawFieldName: ColumnName, rawValue: Value)
src/Model/index.js:437
↓ 25 callers
Function
encoded
(clauses, countMode)
src/adapters/sqlite/encodeQuery/test.js:34
↓ 22 callers
Method
getLocal
(key: string, callback: ResultCallback<?string>)
src/adapters/type.js:75
↓ 22 callers
Function
makeChangeSet
(set)
src/sync/impl/__tests__/helpers.js:58
↓ 21 callers
Method
_getRaw
(rawFieldName: ColumnName)
src/Model/index.js:432
↓ 21 callers
Method
markAsDeleted
* Marks this record as deleted (it will be deleted permanently after sync) * * Note: This method must be called within a Writer {@link Database#
src/Model/index.js:170
↓ 21 callers
Method
testClone
(options?: $Shape<SQLiteAdapterOptions> = {})
src/adapters/sqlite/index.js:106
↓ 21 callers
Method
warn
(...messages: any[])
src/utils/common/logger/index.js:20
↓ 20 callers
Method
add
(record: Record)
src/Collection/RecordCache.js:36
↓ 20 callers
Function
emptyPull
(timestamp = 1500)
src/sync/impl/__tests__/helpers.js:132
↓ 20 callers
Function
expectSortedEqual
(actual, expected)
src/adapters/__tests__/helpers.js:165
↓ 20 callers
Method
unsafeResetDatabase
(callback: ResultCallback<void>)
src/adapters/type.js:69
↓ 19 callers
Method
batch
@see {Database#batch}
src/Database/WorkQueue.js:48
↓ 19 callers
Function
expectError
(promise)
src/Model/test.js:460
↓ 19 callers
Method
fetch
* Fetches the list of records matching this query * * Tip: For convenience, you can also use `await query`
src/Query/index.js:125
↓ 19 callers
Method
subscribe
(subscriber: (T) => void, debugInfo?: any)
src/utils/subscriptions/SharedSubscribable/index.js:30
↓ 19 callers
Method
then
( onFulfill?: (value: number) => Promise<U> | U, onReject?: (error: any) => Promise<U> | U, )
src/Query/index.d.ts:25
↓ 18 callers
Function
isObj
(maybeObject: T)
src/utils/fp/isObj/index.js:3
↓ 17 callers
Method
observe
()
src/react/withObservables/index.js:15
↓ 16 callers
Method
destroyPermanently
* Permanently deletes this record from the database * * Note: Do not use this when using Sync, as deletion will not be synced. * * Note: T
src/Model/index.js:203
↓ 16 callers
Method
error
(...messages: any[])
src/utils/common/logger/index.js:24
↓ 16 callers
Function
getRaw
(collection, id)
src/sync/impl/__tests__/helpers.js:34
↓ 16 callers
Method
prepareUpdate
* Prepares record to be updated * * Use this to batch-execute multiple changes at once. * Note: Prepared changes must be executed by **synchr
src/Model/index.js:125
↓ 16 callers
Function
testApplyRemoteChanges
(db, set, extraContext = {})
src/sync/impl/__tests__/applyRemote.test.js:21
↓ 16 callers
Function
validateTable
(tableName: TableName<any>, schema: AppSchema)
src/adapters/common.js:42
↓ 15 callers
Function
check
(value)
src/Database/LocalStorage/test.js:48
↓ 15 callers
Method
extend
(...args: Clause[])
src/Query/index.js:92
↓ 15 callers
Function
logError
(errorMessage: string)
src/utils/common/logError/index.js:10
↓ 15 callers
Function
prepare
(collection, raw)
src/Model/test.js:917
↓ 15 callers
Function
stepsForMigration
({ migrations: schemaMigrations, fromVersion, toVersion, }: $Exact<{ migrations: SchemaMigrations, f
src/Schema/migrations/stepsForMigration.js:8
↓ 14 callers
Function
cleanFolder
(dir)
scripts/make.mjs:58
↓ 14 callers
Function
encodeValue
(value: Value)
src/adapters/sqlite/encodeValue/index.js:12
↓ 14 callers
Function
encoded
(clauses)
src/adapters/lokijs/worker/encodeQuery/test.js:30
↓ 14 callers
Method
experimentalSubscribe
* Notifies `subscriber` on every change (update/delete) of this record * * Notification contains a flag that indicates whether the change is due
src/Model/index.js:407
↓ 14 callers
Method
getDeletedRecords
(tableName: TableName<any>, callback: ResultCallback<RecordId[]>)
src/adapters/type.js:53
↓ 14 callers
Function
joinTest
( options: $Exact<{ name: string, query: QueryBuilders.Clause[], extraRecords: { ['project
src/__tests__/databaseTests.js:982
↓ 14 callers
Method
set
(record: T)
src/Relation/index.js:86
↓ 13 callers
Function
allPass
(predicates: Array<(T) => boolean>)
src/utils/fp/allPass/index.js:3
↓ 13 callers
Function
checkName
(name: T)
src/utils/fp/checkName/index.js:28
↓ 13 callers
Function
createTable
(tableSchemaSpec: TableSchemaSpec)
src/Schema/migrations/index.js:139
↓ 13 callers
Method
fetchCount
* Fetches the number of records matching this query * * Tip: For convenience you can also use `await query.count`
src/Query/index.js:169
↓ 13 callers
Method
pipe
* `query.pipe(fn)` is a FP convenience for `fn(query)`
src/Query/index.js:116
↓ 13 callers
Function
resolvePath
(...paths)
scripts/make.mjs:33
↓ 13 callers
Method
setLocal
(key: string, value: string, callback: ResultCallback<void>)
src/adapters/type.js:78
↓ 12 callers
Function
appSchema
({ version, tables: tableList, unsafeSql }: AppSchemaSpec)
src/Schema/index.js:85
↓ 12 callers
Function
areRecordsEqual
(left: T, right: T)
src/utils/fp/areRecordsEqual/index.js:4
↓ 12 callers
Function
expectDoesNotExist
(collection, id)
src/sync/impl/__tests__/helpers.js:47
↓ 11 callers
Method
callReader
* Calls a Reader so that it runs as part of the current Reader (or Writer) instead of deadlocking. * * Specifically, the passed block should imm
src/Database/WorkQueue.js:25
↓ 11 callers
Function
countAll
(collections)
src/sync/impl/__tests__/helpers.js:8
↓ 11 callers
Method
get
(tableName: TableName<T>)
src/Database/CollectionMap/index.js:33
↓ 11 callers
Function
pipe
(...fns: ((any) => any)[])
src/utils/fp/pipe/index.js:23
↓ 11 callers
Function
test
(input, column, output)
src/sync/helpers.test.js:15
↓ 11 callers
Method
unsafeQueryRaw
(query: SerializedQuery, callback: ResultCallback<any[]>)
src/adapters/type.js:44
↓ 11 callers
Function
waitForNextQuery
()
src/observation/subscribeToQueryWithColumns/test.js:33
↓ 10 callers
Function
anyPass
(predicates: Array<(T) => boolean>)
src/utils/fp/anyPass/index.js:3
↓ 10 callers
Method
destroyDeletedRecords
( tableName: TableName<any>, recordIds: RecordId[], callback: ResultCallback<void>, )
src/adapters/type.js:56
↓ 10 callers
Function
getLastPulledAt
(database: Database)
src/sync/impl/index.js:17
↓ 10 callers
Method
prepareCreateFromDirtyRaw
* Prepares a new record to be created, based on a raw object. * * Don't use this unless you know how RawRecords work in WatermelonDB. See docs f
src/Collection/index.js:174
↓ 10 callers
Function
sanitize
(raw)
src/adapters/sqlite/encodeBatch/test.js:27
↓ 10 callers
Function
sort
(list)
src/Model/test.js:919
↓ 10 callers
Method
unsubscribe
()
flow-typed/npm/rxjs_v6.x.js:19
↓ 9 callers
Function
allDeletedRecords
(collections)
src/sync/impl/__tests__/helpers.js:21
↓ 9 callers
Function
allPromises
(action: (T) => Promise<U>, promises: T[])
src/utils/fp/allPromises/index.js:3
↓ 9 callers
Method
callWriter
* Calls another Writer so that it runs as part of the current Writer instead of deadlocking. * * Specifically, the passed block should immediate
src/Database/WorkQueue.js:45
next →
1–100 of 970, ranked by callers