Express Adapter
Section titled “ Express Adapter”Full-featured adapter for Express.js with middleware support, request context, and authentication helpers.
Drizzle Cube adapters integrate seamlessly with popular web frameworks, providing framework-specific optimizations while maintaining consistent semantic layer functionality.
Choose the adapter that matches your web framework:
Full-featured adapter for Express.js with middleware support, request context, and authentication helpers.
High-performance adapter optimized for Fastify’s plugin system with built-in schema validation.
Lightweight adapter for Hono framework, perfect for Cloudflare Workers and edge computing environments.
Full-stack adapter with App Router support, server components integration, and optimized client-side caching.
All adapters provide:
Drizzle Cube adapters follow a consistent pattern:
// Initialize your semantic layerconst cubes = [usersCube, ordersCube, productsCube];const semanticLayer = createSemanticLayer({ cubes });
// Create framework-specific adapterconst adapter = createExpressAdapter(semanticLayer, { // Framework-specific configuration auth: (req) => ({ userId: req.user.id }), errorHandler: (error, req, res, next) => { /* handle errors */ }});
// Mount to your frameworkapp.use('/api/cube', adapter);
Need support for a different framework? Check out our guide on building custom adapters to integrate Drizzle Cube with any web framework.
Each adapter includes comprehensive documentation with setup guides, configuration options, and integration examples.