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
nameto camelCase, for examplecreated_attocreatedAt. -
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
nameto a valid Dart member identifier in camelCase. -
parseGeneratorMetadata(
Map< String, dynamic> document, {String schemaName = 'public'}) → SchemaDescription -
Parses a
GeneratorMetadatadocument, the introspection contract of@supabase/postgrest-typegen, into a SchemaDescription forschemaName. -
pascalCase(
String name) → String -
Converts
nameto PascalCase, for exampleauthor_statstoAuthorStats.