feat: regular expression and array filters, GET procedures; 0.3.0
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@crudy/restloom-sqlite",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"type": "module",
|
||||
"description": "SQLite dialect for restloom",
|
||||
"keywords": [
|
||||
@@ -36,7 +36,7 @@
|
||||
"prepack": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@crudy/restloom": "^0.2.0"
|
||||
"@crudy/restloom": "^0.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"better-sqlite3": ">=12"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SqlRenderer, type CatalogColumn } from '@crudy/restloom';
|
||||
import { RestError, SqlRenderer, type CatalogColumn } from '@crudy/restloom';
|
||||
|
||||
/** SQLite: JSON through json_object and json_group_array, booleans as 0 and 1, positional placeholders. */
|
||||
export class SqliteRenderer extends SqlRenderer {
|
||||
@@ -28,6 +28,10 @@ export class SqliteRenderer extends SqlRenderer {
|
||||
return insensitive ? `lower(${expr}) LIKE lower(${pattern}) ESCAPE '\\'` : `${expr} LIKE ${pattern} ESCAPE '\\'`;
|
||||
}
|
||||
|
||||
regex(): string {
|
||||
throw new RestError(400, 'unsupported', 'regular expressions');
|
||||
}
|
||||
|
||||
isBoolean(expr: string, value: boolean): string {
|
||||
return `${expr} = ${value ? 1 : 0}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user