Core Dart
Using Supabase Codegen in pure Dart or server-side applications.
Core Dart
The supabase_codegen package is the base library for generating type-safe models in pure Dart projects. It's ideal for server-side Dart, CLI tools, or any non-Flutter/non-Serverpod environment.
Setup
SQL Functions
Ensure your Supabase database has the necessary helper functions. Run:
dart run supabase_codegen:add_codegen_functions
Then apply the migration with the Supabase CLI.
Environment File
Create a .env file in your project root:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
Initialization
Create your configuration file:
dart run supabase_codegen:init