Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TanStack/db
/ functions
Functions
3,143 in github.com/TanStack/db
⨍
Functions
3,143
◇
Types & classes
808
↓ 9,955 callers
Function
expect
( actual: unknown, message?: string, )
packages/tauri-db-sqlite-persistence/e2e/app/src/runtime-vitest.ts:296
↓ 2,224 callers
Method
from
* Specify the source table or subquery for the query * * @param source - An object with a single key-value pair where the key is the table alias
packages/db/src/query/builder/index.ts:175
↓ 1,247 callers
Function
createCollection
( options: CollectionConfig<any, string | number, any, UtilsRecord> & { schema?: StandardSchemaV1 }, )
packages/db/src/collection/index.ts:254
↓ 1,206 callers
Method
select
( callback: ( refs: RefsForContext<TContext>, ) => SelectObject | ScalarSelectValue, )
packages/db/src/query/builder/index.ts:578
↓ 1,093 callers
Function
createLiveQueryCollection
( configOrQuery: | (LiveQueryCollectionConfig<TContext, TResult> & { utils?: TUtils }) | ((
packages/db/src/query/live-query-collection.ts:155
↓ 919 callers
Method
where
* Filter rows based on a condition * * @param callback - A function that receives table references and returns an expression * @returns A Que
packages/db/src/query/builder/index.ts:449
↓ 812 callers
Method
get
* Finds a pair in the tree and returns the associated value. * @param defaultValue a value to return if the key was not found. * @returns the va
packages/db/src/utils/btree.ts:155
↓ 812 callers
Method
preload
* Preload the collection data by starting sync if not already started * Multiple concurrent calls will share the same promise
packages/db/src/collection/index.ts:473
↓ 678 callers
Function
eq
(left: BasicExpression<any>, right: BasicExpression<any>)
packages/db/tests/query/subset-dedupe.test.ts:27
↓ 518 callers
Method
map
* Create a new array with the results of calling a function for each entry in the collection
packages/db/src/collection/index.ts:557
↓ 464 callers
Method
has
* Returns true if the key exists in the B+ tree, false if not. * Use get() for best performance; use has() if you need to * distinguish between
packages/db/src/utils/btree.ts:189
↓ 430 callers
Method
commit
* Commit the transaction and execute the mutation function * @returns Promise that resolves to this transaction when complete * @example * //
packages/db/src/transactions.ts:493
↓ 418 callers
Method
map
* Apply a function to all records in the collection.
packages/db-ivm/src/multiset.ts:36
↓ 412 callers
Method
insert
* Inserts `child` at index `i`. * This does not mark `child` as shared, so it is the responsibility of the caller * to ensure that either child
packages/db/src/utils/btree.ts:843
↓ 411 callers
Method
orderBy
* Sort the query results by one or more columns * * @param callback - A function that receives table references and returns the field to sort by
packages/db/src/query/builder/index.ts:629
↓ 394 callers
Function
mockSyncCollectionOptions
(config: MockSyncCollectionConfig<T>)
packages/db/tests/utils.ts:222
↓ 380 callers
Method
fn
* Functional variants of the query builder * These are imperative function that are called for ery row. * Warning: that these cannot be optimize
packages/db/src/query/builder/index.ts:850
↓ 377 callers
Method
set
* Adds or overwrites a key-value pair in the B+ tree. * @param key the key is used to determine the sort order of * data in the tree.
packages/db/src/utils/btree.ts:173
↓ 323 callers
Method
sendData
(collection: MultiSet<T> | MultiSetArray<T>)
packages/db-ivm/src/d2.ts:140
↓ 320 callers
Method
values
* Returns an iterator for the map's values in sorted order * * @returns An iterator for the map's values
packages/db/src/SortedMap.ts:195
↓ 315 callers
Function
ref
(path: string | Array<string>)
packages/db/tests/query/predicate-utils.test.ts:20
↓ 311 callers
Method
cleanup
* Clean up the collection by stopping sync and clearing data * This can be called manually or automatically by garbage collection
packages/db/src/collection/index.ts:989
↓ 307 callers
Function
eq
(left: any, right: any)
packages/db/src/query/builder/functions.ts:146
↓ 301 callers
Method
run
()
packages/db-ivm/src/d2.ts:59
↓ 271 callers
Function
stripVirtualProps
( value: T, )
packages/db/tests/utils.ts:17
↓ 268 callers
Method
delete
* Removes a single key-value pair from the B+ tree. * @param key Key to find * @returns true if a pair was found and removed, false otherwise.
packages/db/src/utils/btree.ts:199
↓ 248 callers
Method
pipe
(...operators: Array<PipedOperator<any, any>>)
packages/db-ivm/src/d2.ts:132
↓ 245 callers
Function
createPropRef
(alias: string, prop: string)
packages/db/tests/query/optimizer.test.ts:19
↓ 224 callers
Function
val
(value: any)
packages/db/tests/query/predicate-utils.test.ts:24
↓ 220 callers
Method
join
* Join another table or subquery to the current query * * @param source - An object with a single key-value pair where the key is the table alia
packages/db/src/query/builder/index.ts:262
↓ 215 callers
Method
newInput
()
packages/db-ivm/src/d2.ts:28
↓ 213 callers
Function
waitFor
(fn: () => void, timeout = 2000, interval = 20)
packages/vue-db/tests/useLiveQuery.test.ts:86
↓ 209 callers
Method
filter
* Filter out records for which a function f(record) evaluates to False.
packages/db-ivm/src/multiset.ts:45
↓ 208 callers
Method
stateWhenReady
* Gets the current state of the collection as a Map, but only resolves when data is available * Waits for the first sync commit to complete before
packages/db/src/collection/index.ts:835
↓ 198 callers
Method
subscribeChanges
* Subscribe to changes in the collection * @param callback - Function called when items change * @param options - Subscription options including
packages/db/src/collection/index.ts:936
↓ 196 callers
Function
hash
(input: any)
packages/db-ivm/src/hashing/hash.ts:51
↓ 195 callers
Method
forEach
* Executes a callback function for each key-value pair in the map in sorted order * * @param callbackfn - Function to execute for each entry
packages/db/src/SortedMap.ts:208
↓ 190 callers
Function
gt
(left: BasicExpression<any>, right: BasicExpression<any>)
packages/db/tests/query/subset-dedupe.test.ts:19
↓ 181 callers
Method
finalize
()
packages/db-ivm/src/d2.ts:41
↓ 180 callers
Function
output
( fn: (data: MultiSet<T>) => void, )
packages/db-ivm/src/operators/output.ts:35
↓ 179 callers
Method
add
* Adds a value to the index
packages/db/src/indexes/basic-index.ts:79
↓ 172 callers
Function
gt
(left: any, right: any)
packages/db/src/query/builder/functions.ts:159
↓ 172 callers
Method
mutate
* Execute collection operations within this transaction * @param callback - Synchronous function containing collection operations to group together
packages/db/src/transactions.ts:296
↓ 164 callers
Method
unsubscribe
()
packages/db/src/collection/subscription.ts:723
↓ 163 callers
Function
createTransaction
( config: TransactionConfig<T>, )
packages/db/src/transactions.ts:157
↓ 160 callers
Method
limit
* Limit the number of rows returned by the query * `orderBy` is required for `limit` * * @param count - Maximum number of rows to return *
packages/db/src/query/builder/index.ts:738
↓ 154 callers
Method
loadSubset
* Requests the sync layer to load more data. * @param options Options to control what data is being loaded * @returns If data loading is asynchr
packages/db/src/collection/sync.ts:483
↓ 151 callers
Method
getInner
()
packages/db-ivm/src/multiset.ts:218
↓ 147 callers
Method
cleanup
()
packages/db-sqlite-persistence-core/src/persisted.ts:1141
↓ 147 callers
Function
queryCollectionOptions
( config: QueryCollectionConfig< Record<string, unknown>, (context: QueryFunctionContext<any>) => an
packages/query-db-collection/src/query.ts:565
↓ 145 callers
Function
join
( other: IStreamBuilder<KeyValue<K, V2>>, type: JoinType = `inner`, )
packages/db-ivm/src/operators/join.ts:255
↓ 140 callers
Method
waitFor
* Wait for an event to be emitted * @param event - Event name to wait for * @param timeout - Optional timeout in milliseconds * @returns Prom
packages/db/src/event-emitter.ts:66
↓ 133 callers
Function
compileExpression
( expr: BasicExpression, isSingleRow: boolean = false, )
packages/db/src/query/compiler/evaluators.ts:89
↓ 132 callers
Method
get
(key: string)
packages/query-db-collection/e2e/offline-refresh.e2e.test.ts:77
↓ 132 callers
Method
get
* This method returns all values for a given key. * @param key - The key to get the values for. * @returns An array of value tuples [value, mult
packages/db-ivm/src/indexes.ts:237
↓ 127 callers
Function
getQueryIR
( builder: BaseQueryBuilder | QueryBuilder<any> | InitialQueryBuilder, )
packages/db/src/query/builder/index.ts:1387
↓ 126 callers
Function
count
(arg: ExpressionLike)
packages/db/src/query/builder/functions.ts:643
↓ 126 callers
Method
update
* Updates a value in the index
packages/db/src/indexes/basic-index.ts:149
↓ 125 callers
Method
groupBy
* Group rows by one or more columns for aggregation * * @param callback - A function that receives table references and returns the field(s) to
packages/db/src/query/builder/index.ts:705
↓ 122 callers
Function
getConfig
()
packages/query-db-collection/e2e/query.e2e.test.ts:251
↓ 121 callers
Function
deepEquals
(a: any, b: any)
packages/db/src/utils.ts:29
↓ 118 callers
Method
getResult
(compare?: (a: T, b: T) => number)
packages/db-ivm/tests/test-utils.ts:130
↓ 115 callers
Function
createValue
(value: any)
packages/db/tests/query/optimizer.test.ts:23
↓ 113 callers
Function
electricCollectionOptions
( config: ElectricCollectionConfig<T, any>, )
packages/electric-db-collection/src/electric.ts:608
↓ 105 callers
Method
get
(platform: RuntimePlatform)
packages/expo-db-sqlite-persistence/tests/helpers/expo-emulator-runtime.ts:198
↓ 102 callers
Method
toString
* This method returns a string representation of the index. * @param indent - Whether to indent the string representation. * @returns A string r
packages/db-ivm/src/indexes.ts:182
↓ 99 callers
Function
gt
(left: BasicExpression, right: BasicExpression)
packages/db/tests/query/predicate-utils.test.ts:36
↓ 99 callers
Function
waitForQueryData
( query: Collection<T>, options: { minSize?: number timeout?: number } = {}, )
packages/db-collection-e2e/src/utils/helpers.ts:122
↓ 98 callers
Function
toArray
( query: QueryBuilder<TContext>, )
packages/db/src/query/builder/functions.ts:752
↓ 96 callers
Function
ref
(path: string | Array<string>)
packages/db/tests/query/subset-dedupe.test.ts:11
↓ 93 callers
Method
join
* This method joins two indexes. * @param other - The index to join with the current index. * @returns A multiset of the joined values.
packages/db-ivm/src/indexes.ts:440
↓ 88 callers
Function
localOnlyCollectionOptions
( config: LocalOnlyCollectionConfig<T, TSchema, TKey>, )
packages/db/src/local-only.ts:174
↓ 88 callers
Method
update
* Update the value for a key using a function.
packages/db-ivm/src/utils.ts:36
↓ 86 callers
Function
beforeEach
(callback: AsyncCallback)
packages/tauri-db-sqlite-persistence/e2e/app/src/runtime-vitest.ts:367
↓ 85 callers
Method
status
* Gets the current status of the collection
packages/db/src/collection/index.ts:412
↓ 82 callers
Method
clear
Releases the tree so that its size is 0.
packages/db/src/utils/btree.ts:144
↓ 82 callers
Function
flushPromises
()
packages/db/tests/effect.test.ts:58
↓ 81 callers
Method
on
* Subscribe to an event * @param event - Event name to listen for * @param callback - Function to call when event is emitted * @returns Unsub
packages/db/src/event-emitter.ts:17
↓ 81 callers
Function
persistedCollectionOptions
( options: | PersistedSyncWrappedOptions<T, TKey, TSchema, TUtils> | PersistedLocalOnlyOptions<T, TK
packages/db-sqlite-persistence-core/src/persisted.ts:2599
↓ 77 callers
Function
createEq
(left: any, right: any)
packages/db/tests/query/optimizer.test.ts:27
↓ 76 callers
Function
val
(value: T)
packages/db/tests/query/subset-dedupe.test.ts:15
↓ 74 callers
Method
applyCommittedTx
(collectionId: string, tx: PersistedTx)
packages/db-sqlite-persistence-core/src/sqlite-core-adapter.ts:1162
↓ 72 callers
Method
has
* This method checks if the index has a given key. * @param key - The key to check. * @returns True if the index has the key, false otherwise.
packages/db-ivm/src/indexes.ts:202
↓ 70 callers
Function
func
(name: string, args: Array<any>)
packages/electric-db-collection/tests/sql-compiler.test.ts:17
↓ 70 callers
Function
sum
(arg: T)
packages/db/src/query/builder/functions.ts:651
↓ 70 callers
Method
waitFor
* @returns A promise which will resolve once the specified operation has been seen.
packages/powersync-db-collection/src/PendingOperationStore.ts:30
↓ 69 callers
Function
createChangeProxy
( target: T, parent?: { tracker: ChangeTracker<Record<string | symbol, unknown>> prop: string | sy
packages/db/src/proxy.ts:628
↓ 68 callers
Method
createIndex
* Creates an index on a collection for faster queries. * Indexes significantly improve query performance by allowing constant time lookups * and
packages/db/src/collection/index.ts:598
↓ 67 callers
Function
childItems
* Extracts child collection items as a sorted plain array for comparison.
packages/db/tests/query/includes.test.ts:92
↓ 67 callers
Function
coalesce
( ...args: T )
packages/db/src/query/builder/functions.ts:349
↓ 64 callers
Function
eq
(left: BasicExpression, right: BasicExpression)
packages/db/tests/query/predicate-utils.test.ts:32
↓ 64 callers
Function
serialize
(value: unknown)
packages/electric-db-collection/src/pg-serializer.ts:12
↓ 64 callers
Function
useLiveQuery
( configOrQueryOrCollection: any, deps: Array<unknown> = [], )
packages/react-db/src/useLiveQuery.ts:316
↓ 62 callers
Method
currentStateAsChanges
* Returns the current state of the collection as an array of changes * @param options - Options including optional where filter * @returns An ar
packages/db/src/collection/index.ts:888
↓ 61 callers
Method
addMessage
(message: MultiSet<T>)
packages/db-ivm/tests/test-utils.ts:126
↓ 61 callers
Method
findOne
* Specify that the query should return a single result * @returns A QueryBuilder that returns the first result * * @example * ```ts * /
packages/db/src/query/builder/index.ts:803
↓ 60 callers
Method
keys
* Returns an iterator for the map's keys in sorted order * * @returns An iterator for the map's keys
packages/db/src/SortedMap.ts:186
↓ 59 callers
Method
startSyncImmediate
* Start sync immediately - internal method for compiled queries * This bypasses lazy loading for special cases like live query results
packages/db/src/collection/index.ts:465
↓ 58 callers
Function
isWhereSubset
( subset: BasicExpression<boolean> | undefined, superset: BasicExpression<boolean> | undefined, )
packages/db/src/query/predicate-utils.ts:21
↓ 58 callers
Function
localStorageCollectionOptions
( config: LocalStorageCollectionConfig<any, any, string | number>, )
packages/db/src/local-storage.ts:350
next →
1–100 of 3,143, ranked by callers