Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 637bda0

Browse filesBrowse files
sqlite: enable Percentile extension
PR-URL: #61295 Refs: #60618 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 9bcfbeb commit 637bda0
Copy full SHA for 637bda0

3 files changed

+16-1Lines changed: 16 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deps/sqlite/sqlite.gyp‎

Copy file name to clipboardExpand all lines: deps/sqlite/sqlite.gyp
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'SQLITE_ENABLE_FTS5',
2222
'SQLITE_ENABLE_GEOPOLY',
2323
'SQLITE_ENABLE_MATH_FUNCTIONS',
24+
'SQLITE_ENABLE_PERCENTILE',
2425
'SQLITE_ENABLE_PREUPDATE_HOOK',
2526
'SQLITE_ENABLE_RBU',
2627
'SQLITE_ENABLE_RTREE',
Collapse file

‎deps/sqlite/unofficial.gni‎

Copy file name to clipboardExpand all lines: deps/sqlite/unofficial.gni
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ template("sqlite_gn_build") {
1515
"SQLITE_ENABLE_FTS5",
1616
"SQLITE_ENABLE_GEOPOLY",
1717
"SQLITE_ENABLE_MATH_FUNCTIONS",
18+
"SQLITE_ENABLE_PERCENTILE",
1819
"SQLITE_ENABLE_PREUPDATE_HOOK",
1920
"SQLITE_ENABLE_RBU",
2021
"SQLITE_ENABLE_RTREE",
Collapse file

‎test/parallel/test-sqlite.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-sqlite.js
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ suite('SQL APIs enabled at build time', () => {
204204
);
205205
});
206206

207+
test('percentile is enabled', (t) => {
208+
const db = new DatabaseSync(':memory:');
209+
db.exec(`
210+
CREATE TABLE t1 (x INTEGER);
211+
INSERT INTO t1 (x) VALUES (1), (2), (3), (4), (5);
212+
`);
213+
214+
t.assert.deepStrictEqual(
215+
db.prepare('SELECT percentile(x, 50) AS p50 FROM t1;').get(),
216+
{ __proto__: null, p50: 3 },
217+
);
218+
});
219+
207220
test('dbstat is enabled', (t) => {
208221
const db = new DatabaseSync(nextDb());
209222
t.after(() => { db.close(); });
@@ -244,7 +257,7 @@ suite('SQL APIs enabled at build time', () => {
244257
);
245258
});
246259

247-
test('fts3 parenthesis', (t) => {
260+
test('fts3 parenthesis is enabled', (t) => {
248261
const db = new DatabaseSync(':memory:');
249262
db.exec(`
250263
CREATE VIRTUAL TABLE t1 USING fts3(content TEXT);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.