moor_generator: Support the math extension

This commit is contained in:
Simon Binder 2021-03-13 14:56:06 +01:00
parent 3cf3be27ae
commit cf9ea89681
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
4 changed files with 10 additions and 0 deletions

View File

@ -100,6 +100,8 @@ We currently support the following extensions:
Functions like `highlight` or `bm25` are available as well.
- `moor_ffi`: Enables support for functions that are only available when using `moor_ffi`. This contains `pow`, `sqrt` and a variety
of trigonometric functions. Details on those functions are available [here]({{ "../Other engines/vm.md#moor-only-functions" }}).
- `math`: Assumes that sqlite3 was compiled with [math functions](https://www.sqlite.org/lang_mathfunc.html).
This module is largely incompatible with the `moor_ffi` module.
## Recommended options

View File

@ -129,4 +129,10 @@ enum SqlModule {
// note: We're ignoring the warning because we can't change the json key
// ignore: constant_identifier_names
moor_ffi,
/// Enables support for [built in math functions][math funs] when analysing
/// sql queries.
///
/// [math funs]: https://www.sqlite.org/lang_mathfunc.html
math,
}

View File

@ -133,4 +133,5 @@ const _$SqlModuleEnumMap = {
SqlModule.json1: 'json1',
SqlModule.fts5: 'fts5',
SqlModule.moor_ffi: 'moor_ffi',
SqlModule.math: 'math',
};

View File

@ -44,6 +44,7 @@ class MoorSession {
if (options.hasModule(SqlModule.fts5)) const Fts5Extension(),
if (options.hasModule(SqlModule.json1)) const Json1Extension(),
if (options.hasModule(SqlModule.moor_ffi)) const MoorFfiExtension(),
if (options.hasModule(SqlModule.math)) const BuiltInMathExtension(),
],
);