mirror of https://github.com/nodejs/node.git
sqlite: enable SQL math functions
This commit enables SQLite math functions. Fixes: https://github.com/nodejs/node/issues/56435 PR-URL: https://github.com/nodejs/node/pull/56447 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>pull/45096/merge
parent
d0ff34f4b6
commit
338d70b752
|
@ -13,6 +13,7 @@
|
|||
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
||||
},
|
||||
'defines': [
|
||||
'SQLITE_ENABLE_MATH_FUNCTIONS',
|
||||
'SQLITE_ENABLE_SESSION',
|
||||
'SQLITE_ENABLE_PREUPDATE_HOOK'
|
||||
],
|
||||
|
|
|
@ -8,6 +8,7 @@ template("sqlite_gn_build") {
|
|||
config("sqlite_config") {
|
||||
include_dirs = [ "." ]
|
||||
defines = [
|
||||
"SQLITE_ENABLE_MATH_FUNCTIONS",
|
||||
"SQLITE_ENABLE_SESSION",
|
||||
"SQLITE_ENABLE_PREUPDATE_HOOK",
|
||||
]
|
||||
|
|
|
@ -103,3 +103,11 @@ test('PRAGMAs are supported', (t) => {
|
|||
{ __proto__: null, journal_mode: 'wal' },
|
||||
);
|
||||
});
|
||||
|
||||
test('math functions are enabled', (t) => {
|
||||
const db = new DatabaseSync(':memory:');
|
||||
t.assert.deepStrictEqual(
|
||||
db.prepare('SELECT PI() AS pi').get(),
|
||||
{ __proto__: null, pi: 3.141592653589793 },
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue