◐ Shell
clean mode source ↗

sqlite: enable Percentile extension · nodejs/node@be4d2f3

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);