( options: LoadSubsetOptions, compileOptions?: CompileSQLiteOptions, )
| 43 | * ``` |
| 44 | */ |
| 45 | export function compileSQLite( |
| 46 | options: LoadSubsetOptions, |
| 47 | compileOptions?: CompileSQLiteOptions, |
| 48 | ): SQLiteCompiledQuery { |
| 49 | const { where, orderBy, limit } = options |
| 50 | |
| 51 | const params: Array<unknown> = [] |
| 52 | const result: SQLiteCompiledQuery = { params } |
| 53 | |
| 54 | if (where) { |
| 55 | result.where = compileExpression(where, params, compileOptions) |
| 56 | } |
| 57 | |
| 58 | if (orderBy) { |
| 59 | result.orderBy = compileOrderBy(orderBy, params, compileOptions) |
| 60 | } |
| 61 | |
| 62 | if (limit !== undefined) { |
| 63 | result.limit = limit |
| 64 | } |
| 65 | |
| 66 | return result |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Quote SQLite identifiers to handle column names correctly. |
no test coverage detected