Memory Adapter
The Memory adapter stores all data in-memory, making it perfect for development, testing, and prototyping. Data is lost when the application restarts.
Installation
The Memory adapter is included in the core package and requires no additional dependencies:
Configuration
The Memory adapter accepts minimal configuration:
Usage Examples
Basic CRUD Operations
Best Practices
- Use for development only - The memory adapter is not suitable for production use as data is lost on restart
- Test with realistic data volumes - Pre-populate with a representative data set to test performance
- Reset between tests - Create a new instance for each test to ensure a clean environment
Limitations
- No persistence across application restarts
- Not suitable for production environments
- Limited query capabilities compared to SQL-based adapters
- No support for complex joins or transactions
When to Use
- During development and prototyping
- For automated testing
- For demos and examples
- When you need a lightweight, zero-configuration database
Related Resources
SQLite Adapter
The SQLite adapter provides a lightweight, file-based database solution perfect for small to medium applications, local development, and embedded systems.
Kysely Adapter
The Kysely adapter provides type-safe SQL query building with support for multiple databases including PostgreSQL, MySQL, and SQLite.