feat: regular expression and array filters, GET procedures; 0.3.0

This commit is contained in:
2026-11-02 02:09:06 +01:00
parent 8735abfe79
commit 215d1c2f7e
30 changed files with 171 additions and 44 deletions
+10
View File
@@ -34,3 +34,13 @@ for (const page of PAGES) {
}
});
}
describe('mysql regular expressions', { skip: !url && 'RESTLOOM_MYSQL_URL is not set' }, () => {
test('imatch ignores case, match does not', async () => {
await admin.query(fixture);
const rest = createREST({ db: mysql(pool), expose: { schemas: ['demo'] } });
const get = async (qs) => (await rest.handle({ method: 'GET', path: '/users', query: new URLSearchParams(qs), headers: {}, context: undefined })).body;
assert.deepEqual(await get('select=id&name=imatch.^(ada|LINUS)$'), [{ id: 1 }, { id: 3 }]);
assert.deepEqual(await get('select=id&name=match.^(ada|LINUS)$'), []);
});
});