Skip to content

Adapters Overview

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:

All adapters provide:

  • Framework Integration - Native middleware and plugin patterns
  • Request Context - Automatic user context and tenant isolation
  • Authentication - Built-in auth helpers and security middleware
  • Error Handling - Framework-specific error responses
  • TypeScript Support - Full type safety with framework types
  • Performance Optimizations - Framework-specific caching and query optimization

Drizzle Cube adapters follow a consistent pattern:

// Initialize your semantic layer
const cubes = [usersCube, ordersCube, productsCube];
const semanticLayer = createSemanticLayer({ cubes });
// Create framework-specific adapter
const adapter = createExpressAdapter(semanticLayer, {
// Framework-specific configuration
auth: (req) => ({ userId: req.user.id }),
errorHandler: (error, req, res, next) => { /* handle errors */ }
});
// Mount to your framework
app.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.

  1. Choose your framework from the adapters above
  2. Install the adapter package via npm
  3. Follow the documentation for setup instructions
  4. Check out the examples for complete implementation patterns

Each adapter includes comprehensive documentation with setup guides, configuration options, and integration examples.