DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/powersync-db-collection/functions/compileSQLite.md
compileSQLite
ts
function compileSQLite(options, compileOptions?): SQLiteCompiledQuery;Defined in: sqlite-compiler.ts:45
Compiles TanStack DB LoadSubsetOptions to SQLite query components.
Parameters#
options#
LoadSubsetOptions
compileOptions?#
Returns#
Example#
ts
const compiled = compileSQLite({
where: { type: 'func', name: 'gt', args: [
{ type: 'ref', path: ['price'] },
{ type: 'val', value: 100 }
]},
orderBy: [{ expression: { type: 'ref', path: ['price'] }, compareOptions: { direction: 'desc', nulls: 'last' } }],
limit: 50
})
// Result: { where: '"price" > ?', orderBy: '"price" DESC', limit: 50, params: [100] }