(database: IDatabase, table: string)
| 280 | |
| 281 | /** Get next sync version for a table */ |
| 282 | export async function nextSyncVersion(database: IDatabase, table: string): Promise<number> { |
| 283 | const rows = await database.select<{ max_v: number | null }>( |
| 284 | `SELECT MAX(sync_version) as max_v FROM ${table}`, |
| 285 | ); |
| 286 | return (rows[0]?.max_v || 0) + 1; |
| 287 | } |
| 288 | |
| 289 | export async function nextUpdatedAt( |
| 290 | database: IDatabase, |
no outgoing calls
no test coverage detected