mirror of https://github.com/AMT-Cheif/drift.git
moor_generator: Support the math extension
This commit is contained in:
parent
3cf3be27ae
commit
cf9ea89681
|
@ -100,6 +100,8 @@ We currently support the following extensions:
|
||||||
Functions like `highlight` or `bm25` are available as well.
|
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
|
- `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" }}).
|
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
|
## Recommended options
|
||||||
|
|
||||||
|
|
|
@ -129,4 +129,10 @@ enum SqlModule {
|
||||||
// note: We're ignoring the warning because we can't change the json key
|
// note: We're ignoring the warning because we can't change the json key
|
||||||
// ignore: constant_identifier_names
|
// ignore: constant_identifier_names
|
||||||
moor_ffi,
|
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,
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,4 +133,5 @@ const _$SqlModuleEnumMap = {
|
||||||
SqlModule.json1: 'json1',
|
SqlModule.json1: 'json1',
|
||||||
SqlModule.fts5: 'fts5',
|
SqlModule.fts5: 'fts5',
|
||||||
SqlModule.moor_ffi: 'moor_ffi',
|
SqlModule.moor_ffi: 'moor_ffi',
|
||||||
|
SqlModule.math: 'math',
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,6 +44,7 @@ class MoorSession {
|
||||||
if (options.hasModule(SqlModule.fts5)) const Fts5Extension(),
|
if (options.hasModule(SqlModule.fts5)) const Fts5Extension(),
|
||||||
if (options.hasModule(SqlModule.json1)) const Json1Extension(),
|
if (options.hasModule(SqlModule.json1)) const Json1Extension(),
|
||||||
if (options.hasModule(SqlModule.moor_ffi)) const MoorFfiExtension(),
|
if (options.hasModule(SqlModule.moor_ffi)) const MoorFfiExtension(),
|
||||||
|
if (options.hasModule(SqlModule.math)) const BuiltInMathExtension(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue