MCPcopy Index your code
hub / github.com/TanStack/db / tableExists

Function tableExists

packages/powersync-db-collection/tests/powersync.test.ts:535–547  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

533 const meta = collectionOptions.utils.getMeta()
534
535 const tableExists = async (): Promise<boolean> => {
536 const result = await db.writeLock(async (tx) => {
537 return tx.get<{ count: number }>(
538 `
539 SELECT COUNT(*) as count
540 FROM sqlite_temp_master
541 WHERE type='table' AND name = ?
542 `,
543 [meta.trackedTableName],
544 )
545 })
546 return result.count > 0
547 }
548
549 const collection = createCollection(collectionOptions)
550 await collection.stateWhenReady()

Callers 1

powersync.test.tsFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…