supafreeze 2.1.1
supafreeze: ^2.1.1 copied to clipboard
Generate Freezed models from Supabase database schema automatically. Supports incremental generation, smart caching, and build_runner integration.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.1.0 - 2026-03-11 #
Added #
- PostgreSQL enum auto-generation (
generate_enums)- Queries
pg_enumcatalog viaexecute_sqlRPC to fetch enum type definitions - Generates Dart enum files with
toJson()/fromJson()for JSON serialization - Freezed model fields use generated Dart enum types instead of
String - Configurable output directory via
enum_output(default:{output}/enums) - Falls back to OpenAPI spec detection when
execute_sqlis not available - Handles special characters in enum values (hyphens, digits, reserved words)
- Generates barrel file
enums.dartfor convenient imports
- Queries
EnumGeneratorclass for Dart enum code generationSupafreezeConfig.generateEnumsandSupafreezeConfig.enumOutputsettings
Changed #
- Bumped
supabase_schema_coredependency to^1.4.0
2.0.3 - 2026-02-18 #
Fixed #
- Generated models now use
abstract classinstead ofclassfor freezed 3.x compatibility with Dart 3.10+
2.0.2 - 2026-02-18 #
Fixed #
- Widened
analyzerconstraint to>=9.0.0 <11.0.0(supports latest stable) - Added example file for pub.dev scoring
2.0.1 - 2026-02-18 #
Fixed #
- Added comprehensive
ignore_for_filedirectives to suppress lint warnings in generated code
1.0.6 - 2025-12-10 #
Fixed #
- Added CHANGELOG.md entries for all versions to satisfy pub.dev validation
1.0.5 - 2025-12-10 #
Fixed #
- Fixed Dart formatting issues for pub.dev static analysis compliance
- All source files now pass
dart formatcheck
1.0.4 - 2025-12-10 #
Fixed #
- Formatted Dart sources to satisfy pub.dev static analysis checks
- Bumped package version to align with latest release tag
1.0.2 - 2025-12-10 #
Fixed #
- Loosened analyzer range to stay compatible with build_runner/freezed toolchains while still allowing latest releases
- Updated example dependencies to resolve build_runner formatting errors caused by analyzer incompatibility
1.0.1 - 2025-12-10 #
Changed #
- Renamed Supabase environment variable to
SUPABASE_DATA_API_URLin docs and validations for clarity
1.0.0 - 2024-12-10 #
Added #
- Initial release
- Fetch table schema from Supabase via OpenAPI spec
- Generate Freezed models with
fromJson/toJson - build_runner integration (runs before freezed/json_serializable)
- Per-table incremental caching with SHA256 hashes
- Automatic file cleanup when tables are deleted
- Configuration via
supafreeze.yaml - Variable resolution from dart-define, .env, and environment variables
- Fetch modes:
always,if_no_cache,never - Table filtering with
include/excludeoptions - Optional barrel file generation
- Comprehensive PostgreSQL to Dart type mapping
- Property sorting (required first, grouped by type)
- snake_case to camelCase conversion with
@JsonKeyannotations - Support for nullable fields, primary keys, and default values
- Relation embedding - Auto-detect FK from
*_idcolumns and embed related models - Per-table relation configuration with
relationsoption - Dart reserved word escaping for field and class names
- Custom enum type detection from OpenAPI spec
- CLI tool (
dart run supafreeze:supafreeze) for manual schema sync --forceflag to regenerate all models regardless of cache