row_row_row 0.1.4
row_row_row: ^0.1.4 copied to clipboard
A command-line tool to generate Dart models for Supabase table rows based on the OpenAPI spec.
Changelog #
All notable changes to this project will be documented in this file.
0.1.4 Enhanced Usability and Data Type Handling #
- Added
copyWithmethod to all generated row classes for easier object modification. - Removed nullable
?for dynamic value typings. - Improved JSON conversion with additional type support in
fromJsonfactory:- Added support for
Map.from()for dynamic maps. - Added support for
List<String>.from()for string lists. - Added support for
List<int>.from()with type conversion. - Added support for
List<double>.from()with type conversion. - Added support for
List<Map>.from()for lists of maps.
- Added support for
- Added support for more PostgreSQL data types:
characterandcharacter varyingmapped toString.smallintmapped toint.- Array variants of these types also supported.
0.1.3 Enum Type Detection & Generation, Cleaning & Enum Improvements #
- Added support for detecting and generating Dart enums from PostgreSQL enum types.
- Enum names are now derived from the database enum type name (instead of the column name).
- Created a new
enumsdirectory for the generated enum files with naming pattern<EnumName>.enum.dart. - Added helper methods in generated enum classes:
toValuegetter to convert enum to database string value.fromValuestatic method to convert database string value to enum.tryFromValuestatic method for safe conversion with null handling.
- Table row classes now use the proper enum types for columns that use enum types.
- Added optional
--clean/-cflag to delete all existing generated files before generation. - Improved enum file naming to be more consistent with Dart conventions:
- Changed file naming pattern to use snake_case (
user_type.enum.dartinstead of camelCase). - Fixed redundant enum naming that could lead to names like
UserTypeEnum.enum.dart.
- Changed file naming pattern to use snake_case (
- Fixed implementation of
_toSnakeCasefor proper conversion from camelCase and PascalCase. - Fixed missing function
_getJsonCastTypethat was causing errors. - Removed redundant duplicate functions and code.
- Improved error handling in the code generation process.
- Added more descriptive logging during the generation process.
0.1.2 Command Name Improvement #
- Changed the command name from
list-tables-viewstogeneratefor improved usability. - Updated documentation to reflect the new command.
0.1.1 Package Usability Improvements #
- Updated package configuration to support usage from other projects.
- Fixed executable configuration in
pubspec.yaml. - Updated README with clearer installation and usage instructions:
- Added instructions for using as a dependency.
- Added instructions for global activation.
- Clarified command usage patterns for all installation methods.
0.1.0 Initial Release #
- Initial version of the Supabase row generator.
- Connects to Supabase via Service Role Key using
.envfile. - Fetches schema by parsing the OpenAPI specification from
/rest/v1/. - Generates Dart model classes (
<TableName>Row) inlib/row_row_row_generated/tables/. - Generated classes include:
camelCasefields corresponding tosnake_casecolumns.constconstructor with required/optional named parameters.fromJsonfactory constructor.toJsonmethod.- Static
fieldrecord mapping Dart fields to DB column names.
- Generates a schema report text file in
lib/row_row_row_generated/db_schema_report/. - Provides CLI options:
--dart-format/-fto optionally format generated code.--help/-hto display usage.