Content-Length: 313909 | pFad | https://github.com/nodejs/node/commit/b6c2e91365

C1 sqlite: enable SQL math functions · nodejs/node@b6c2e91 · GitHub
Skip to content

Commit b6c2e91

Browse files
cjihrigaduh95
authored andcommitted
sqlite: enable SQL math functions
This commit enables SQLite math functions. Fixes: #56435 PR-URL: #56447 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ccb2ddb commit b6c2e91

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

deps/sqlite/sqlite.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
1414
},
1515
'defines': [
16+
'SQLITE_ENABLE_MATH_FUNCTIONS',
1617
'SQLITE_ENABLE_SESSION',
1718
'SQLITE_ENABLE_PREUPDATE_HOOK'
1819
],

deps/sqlite/unofficial.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ template("sqlite_gn_build") {
88
config("sqlite_config") {
99
include_dirs = [ "." ]
1010
defines = [
11+
"SQLITE_ENABLE_MATH_FUNCTIONS",
1112
"SQLITE_ENABLE_SESSION",
1213
"SQLITE_ENABLE_PREUPDATE_HOOK",
1314
]

test/parallel/test-sqlite.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,11 @@ test('PRAGMAs are supported', (t) => {
103103
{ __proto__: null, journal_mode: 'wal' },
104104
);
105105
});
106+
107+
test('math functions are enabled', (t) => {
108+
const db = new DatabaseSync(':memory:');
109+
t.assert.deepStrictEqual(
110+
db.prepare('SELECT PI() AS pi').get(),
111+
{ __proto__: null, pi: 3.141592653589793 },
112+
);
113+
});

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/nodejs/node/commit/b6c2e91365

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy