Data Provider System
The provider system in the@repo/data
package offers a collection of data providers that implement the CrudProvider interface for various data sources. This allows you to interact with different backends using a consistent API.
Available Providers
The package includes providers for various data sources:- Supabase: For PostgreSQL databases with Supabase
- Firebase: For Firebase Realtime Database and Firestore
- REST API: For RESTful APIs
- GraphQL: For GraphQL APIs
- Mock: For testing and development
Supabase Provider
The Supabase provider allows you to connect to a PostgreSQL database using Supabase.Configuration
Usage
Advanced Features
The Supabase provider supports advanced features like:- Relations: Automatically fetch related data
- RLS Policies: Work with Row Level Security policies
- Full-text Search: Use Supabase’s full-text search capabilities
- Realtime: Subscribe to realtime updates
Firebase Provider
The Firebase provider allows you to connect to Firebase Realtime Database or Firestore.Configuration
Usage
Advanced Features
The Firebase provider supports advanced features like:- Subcollections: Work with nested collections
- Transactions: Perform atomic operations
- Realtime Updates: Subscribe to realtime updates