Drivers
A driver is the knowledge of one backend’s query dialect, in two halves:
- a request strategy that turns builder state into a query string
- a response strategy that turns that backend’s envelope into a
PaginatedCollection
Plus a response options object naming where pagination metadata lives in the body.
import { STRAPI_DRIVER } from '@qubeejs/core';
STRAPI_DRIVER.createRequestStrategy('query');STRAPI_DRIVER.createResponseStrategy();STRAPI_DRIVER.createResponseOptions({});Capabilities
Section titled “Capabilities”Each request strategy declares eight booleans describing what its backend can express. The builder consults them on every call, so unsupported features throw at the call site.
STRAPI_DRIVER.createRequestStrategy('query').capabilities;// { filters: true, operatorFilters: true, sort: true, select: true,// fields: false, includes: true, search: false, embedded: false }The capability matrix lists all eighteen side by side.
Choosing at build time
Section titled “Choosing at build time”If you know your backend, import its constant and let the rest tree-shake:
import { POSTGREST_DRIVER } from '@qubeejs/core';Choosing at runtime
Section titled “Choosing at runtime”If you do not, the registry maps every id to its definition:
import { DRIVERS, DriverEnum } from '@qubeejs/core';
const driver = DRIVERS[DriverEnum.POSTGREST];const fromString = DRIVERS['postgrest']; // also fineThe registry is a closed Record, so adding a DriverEnum member without registering it is a
compile error rather than a runtime surprise.
