supabase_typegen library

Generates typed Supabase table definitions, row extension types and column tokens from a database schema.

Classes

ColumnDescription
Description of a single table column.
EnumDescription
Description of a Postgres enum type.
ForeignKeyDescription
The target of a foreign key column.
RelationshipDescription
A foreign key from sourceTable to targetTable.
SchemaDescription
Description of a single database schema, the input to the code generator.
TableDescription
Description of a table or view.

Enums

ColumnTypeKind
The Dart-relevant type of a column, derived from the Postgres type at parse time so that later stages never have to compare type name strings.

Functions

camelCase(String name) String
Converts name to camelCase, for example created_at to createdAt.
generateDartCode(SchemaDescription schema, {String importUri = 'package:postgrest/postgrest.dart'}) String
Generates a Dart source file with typed table definitions, row extension types, insert and update value types, column tokens and Postgres enums for schema.
memberIdentifier(String name) String
Converts name to a valid Dart member identifier in camelCase.
parseGeneratorMetadata(Map<String, dynamic> document, {String schemaName = 'public'}) SchemaDescription
Parses a GeneratorMetadata document, the introspection contract of @supabase/postgrest-typegen, into a SchemaDescription for schemaName.
pascalCase(String name) String
Converts name to PascalCase, for example author_stats to AuthorStats.