Reference

Types

All public TypeScript types exported from drizzle-resource.

All types are exported from the package root:

import type {
  
QueryRequest
,
QueryResponse
,
// ... } from "drizzle-resource";

Request types

QueryRequest

The full shape of a query request. See Query Contract → Request Shape.

import type { 
QueryRequest
} from "drizzle-resource";
type
QueryRequestExample
=
QueryRequest
;

QueryPagination

import type { 
QueryPagination
,
QueryPaginationInput
} from "drizzle-resource";
type
NormalizedPagination
=
QueryPagination
;
type
TransportPagination
=
QueryPaginationInput
;

QueryFacetRequest

import type { 
QueryFacetRequest
} from "drizzle-resource";
type
QueryFacetRequestExample
=
QueryFacetRequest
;

ResourceQueryExecutionOptions

Trusted server-side limits for one direct resource execution. These options are not part of the transport request.

import type { 
ResourceQueryExecutionOptions
} from "drizzle-resource";
const
exportExecution
= {
maxPageSize
: 5_000,
} satisfies
ResourceQueryExecutionOptions
;

Response types

QueryResponse<TRow>

import type { 
QueryResponse
} from "drizzle-resource";
type
QueryResponseExample
<
TRow
> =
QueryResponse
<
TRow
>;

QueryIdsResponse<TId>

import type { 
QueryIdsResponse
} from "drizzle-resource";
type
QueryIdsResponseExample
<
TId
= unknown> =
QueryIdsResponse
<
TId
>;

QueryPageInfo

import type { 
QueryCursorPageInfo
,
QueryOffsetPageInfo
,
QueryPageInfo
} from "drizzle-resource";
type
AnyPageInfo
=
QueryPageInfo
;
type
CursorPageInfo
=
QueryCursorPageInfo
;
type
OffsetPageInfo
=
QueryOffsetPageInfo
;

QueryFacetResult

import type { 
QueryFacetResult
} from "drizzle-resource";
type
QueryFacetResultExample
=
QueryFacetResult
;

QueryFacetsResponse

import type { 
QueryFacetsResponse
} from "drizzle-resource";
type
QueryFacetsResponseExample
=
QueryFacetsResponse
;

Filter types

QueryFilterCondition<TField>

import type { 
QueryFilterCondition
} from "drizzle-resource";
type
QueryFilterConditionExample
<
TField
extends string = string> =
QueryFilterCondition
<
TField
>;

QueryFilterGroup<TField>

import type { 
QueryFilterGroup
} from "drizzle-resource";
type
QueryFilterGroupExample
<
TField
extends string = string> =
QueryFilterGroup
<
TField
>;

QueryFilterNode<TField>

import type { 
QueryFilterNode
} from "drizzle-resource";
type
QueryFilterNodeExample
<
TField
extends string = string> =
QueryFilterNode
<
TField
>;

QueryFilters<TField>

import type { 
QueryFilters
} from "drizzle-resource";
type
QueryFiltersExample
<
TField
extends string = string> =
QueryFilters
<
TField
>;

QueryFilterOperator

import type { 
QueryFilterOperator
} from "drizzle-resource";
type
QueryFilterOperatorExample
=
QueryFilterOperator
;

QueryFilterInput<TField>

Flexible input type accepted by the filter builder methods:

import type { 
QueryFilterInput
} from "drizzle-resource";
type
QueryFilterInputExample
<
TField
extends string = string> =
QueryFilterInput
<
TField
>;

Configuration types

ResourceQuerySearchConfig<TField>

type 
ResourceQuerySearchConfig
<
TField
> = {
allowed
?:
TField
[];
defaults
?:
TField
[];
};

ResourceQuerySortConfig<TField>

type 
ResourceQuerySortConfig
<
TField
> = {
defaults
?:
Array
<{
key
:
TField
;
dir
: "asc" | "desc" }>;
disabled
?:
TField
[];
};

ResourceQueryFiltersConfig<TField>

type 
ResourceQueryFiltersConfig
<
TField
> = {
hidden
?:
TField
[];
disabled
?:
TField
[];
};

ResourceQueryFacetsConfig<TField>

type 
ResourceQueryFacetsConfig
<
TField
> = {
allowed
?:
TField
[];
};

ResourceQueryDefaultsConfig

type 
ResourceQueryDefaultsConfig
= {
pagination
?: {
mode
?: "offset" | "cursor";
pageIndex
?: number;
pageSize
?: number;
count
?: "none" | "exact";
}; };

Engine types

QueryEngine<...>

Returned by createQueryEngine(...). The generic parameters are inferred from your database, schema, and relations.

QueryResource<...>

The type of a defined resource, returned by engine.defineResource(...). Exposes query, findById, queryIds, queryRows, and queryFacets. Its $infer.query, $infer.findById, and $infer.profiles members expose operation and profile row types without executing a query.

ResourceHydrationConfig<TAvailable, TProfiles>

Defines named relation subsets and the default profiles for query and findById. Profile keys, inline load overrides, and returned row shapes stay inferred from the resource's relation capability graph.

QueryFieldPath<TSchema, TRelations, TRoot, TWith>

The union of every dotted field path for a resource root and relation tree. Sort keys, filter keys and facet keys are checked against it.

Copyright © 2026