Use when the goal is exposing Drizzle-backed data through rstore in Nuxt: generate collections and API routes from schema, add a new Drizzle table to the rstore API, fix `Collection "<name>" is not allowed` errors, fetch/filter/paginate data, support create/update/delete flows, enable realtime or offline sync, and enforce table-level server access rules with `allowTables`; pair with `rstore-nuxt` for Nuxt integration and `rstore-vue` for collection/query/form behavior.
Generate rstore collections and API/runtime behavior from Drizzle schema metadata, then add realtime/offline and hook-based server controls as needed.
Use this skill with the @rstore/nuxt skill for Nuxt module/runtime behavior and with the @rstore/vue skill for underlying collection/query/form semantics.
| Area | Documentation |
|---|---|
| Nuxt + Drizzle plugin overview | https://rstore.akryum.dev/plugins/nuxt-drizzle |
| Query and filter model | https://rstore.akryum.dev/guide/data/query |
| Relations behavior | https://rstore.akryum.dev/guide/schema/relations |
| Realtime subscriptions | https://rstore.akryum.dev/guide/data/live |
| Offline behavior | https://rstore.akryum.dev/guide/data/offline |
| Plugin hooks and extension points | https://rstore.akryum.dev/guide/plugin/hooks |
| Related package skills | rstore-nuxt skill (@rstore/nuxt), rstore-vue skill (@rstore/vue) |
| Skill-local API references | ./references/index.md |
| Primitive | Purpose |
|---|---|
rstoreDrizzle.drizzleConfigPath | Locates Drizzle config file loaded by the module |
drizzleConfig.schema | Must be a single importable schema file path |
drizzleImport | Defines server-side drizzle getter import used by generated handlers |
#build/$rstore-drizzle-collections | Generated collections with inferred keys, meta, and relations |
apiPath | Base REST route for generated CRUD handlers |
ws | Enables websocket realtime handler and client plugin |
offline | Enables offline sync plugins and sync config template values |
rstoreDrizzleHooks / hooksForTable / allowTables | Server extension and access-control APIs |
export default defineNuxtConfig({
modules: ['@rstore/nuxt-drizzle'],
rstoreDrizzle: {
drizzleImport: {
name: 'useDrizzle',
from: '~~/server/utils/drizzle',
},
apiPath: '/api/rstore',
},
})
Also provide the server import the module expects by default:
// server/utils/drizzle.ts
export function useDrizzle() {
// return your drizzle instance
}
drizzle.config.ts exists and exports a config with string schema.drizzleImport if not using ~~/server/utils/drizzle with useDrizzle.findOptions.where and supported drizzle params.ws and/or offline only when required by product behavior.hooksForTable, allowTables, rstoreDrizzleHooks).allowTables, register the new table in the same allowTables([...]) list — once initialized the allow-list is permanent and unlisted tables throw Collection "<name>" is not allowed..rstore-nuxt skill.rstore-vue skill.findOptions.where over the deprecated params.where.findOptions.include for relation loading; relation include objects support where, orderBy, columns, limit, and nested include.params.limit, offset, columns, orderBy, and keys to shape Drizzle-backed queries.params.with only as a low-level Drizzle override; when both are provided, params.with takes precedence over findOptions.include.SuperJSON, so keep them serializable.createdAt and updatedAt string values into Date objects through collection defaults.fetchRelations translates included relations into follow-up equality queries against the generated target collections.findFirst and findMany reuses the same where and orderBy semantics client-side.ws: true (or object form) enables websocket handler registration and client subscription plugin wiring.where; exact filter shape impacts topic reuse.realtimeReconnectEventHook, which makes liveQuery refresh.offline enables offline plugin generation and sync config wiring.updatedAt comparison values.offline.serializeDateValue exists for non-default date comparison serialization.hooksForTable(table, hooks) to scope API hooks to a specific Drizzle table.rstoreDrizzleHooks.hook(...) when the extension needs to work across multiple tables.*.before hooks can call transformQuery(({ where, extras }) => ...) to add constraints before execution.allowTables([...]) to deny access to unlisted generated collections.realtime.filter hook to reject websocket updates for a peer when row-level rules apply.schema in drizzle config throws.value1::value2; mismatches here cause lookup/update issues.params.where is deprecated; use findOptions.where.allowTables flips the default from "all tables exposed" to "deny by default". After the first call, every new Drizzle table you add to the schema must also be added to allowTables — otherwise endpoints throw Collection "<name>" is not allowed. at runtime.| Topic | Description | Reference |
|---|---|---|
| API index | Full map of Nuxt-Drizzle API/config references | api-index |
| rstoreDrizzle.drizzleConfigPath | Drizzle config lookup path | api-drizzle-config-path |
| rstoreDrizzle.drizzleImport | Server drizzle getter import contract | api-drizzle-import |
| rstoreDrizzle.apiPath | Generated REST base path | api-api-path |
| rstoreDrizzle.ws | Enable websocket realtime integration | api-ws |
| rstoreDrizzle.ws.apiPath | Override websocket endpoint path | api-ws-api-path |
| rstoreDrizzle.offline | Enable offline sync integration | api-offline |
| rstoreDrizzle.offline.serializeDateValue | Customize offline sync date serialization | api-offline-serialize-date-value |
| findOptions.include | Primary relation include option | api-find-options-include |
rstore-nuxtrstore-vue| findOptions.where | Primary drizzle filter option | api-find-options-where |
| params.where (deprecated) | Legacy filter location | api-params-where |
| params.limit | Limit rows in list queries | api-params-limit |
| params.offset | Offset rows in list queries | api-params-offset |
| params.with | Low-level Drizzle relation override | api-params-with |
| params.columns | Selected column projection | api-params-columns |
| params.orderBy | Sort order format and behavior | api-params-order-by |
| params.keys | Key-constrained list fetches | api-params-keys |
| filterWhere | Local cache condition evaluator | api-filter-where |
| rstoreDrizzleHooks | Global server/realtime hook bus | api-rstore-drizzle-hooks |
| hooksForTable | Table-scoped hook registration helper | api-hooks-for-table |
| allowTables | Collection allow-list access control | api-allow-tables |
| publishRstoreDrizzleRealtimeUpdate | Publish manual realtime updates for direct Drizzle writes | api-publish-rstore-drizzle-realtime-update |
| Base @rstore/nuxt skill | Nuxt module/runtime integration semantics | rstore-nuxt skill |
| Base @rstore/vue skill | Underlying collection/query/form semantics | rstore-vue skill |