_common library

Classes

DartCompositeTypeMappers
Merges multiple TypeMappers instances into a single one whose tables are the union of the delegates'. Earlier delegates take precedence on regex conflicts because mapper lookup is first-match-wins and addAll keeps the first inserted entry per key when merging into the buffer in order.
DartCoreTypeMappers
DartFirestoreTypeMappers
Firestore-specific type mappers. Currently covers cloud_firestore's Timestamp only; future PG_/SQLITE_-style dialect families will live in sibling classes (DartPostgresTypeMappers, DartSqliteTypeMappers, etc.) and be composed alongside DartCoreTypeMappers at generation time.
DartPostgresTypeMappers
Postgres-flavoured prefix vocabulary. Two flavours of entry live here:
DartSqliteTypeMappers
SQLite-flavoured prefix vocabulary.
DartStrictTypeMappers
Per-field opt-in mappers that emit json_serializable-style direct as casts instead of the defensive letOrNull chain used by DartCoreTypeMappers. Throws a TypeError on shape mismatch (caught by the generated fromJsonOrNull try/catch and turned into a null model).

Functions

extractInsightsFromFile(String filePath, AnalysisContextCollection analysisContextCollection) Future<List<ClassInsight<GenerateDartModel>>>
Analyzes the Dart file at filePath using analysisContextCollection, and and extracts class insights from it.
generateDartModels(List<String> args, {required String defaultTemplatePathOrUrl}) Future<void>
generateDartModelsAi(List<String> args) Future<void>
Broker-agnostic version of generateDartModelsGemeni. Pick the provider at the CLI with --broker openai|anthropic|gemini. API keys come from --api-key or, when absent, from the broker-specific env var via EnvKeyResolver. The model id defaults to the first model the broker lists for the resolved key, so common cases work with zero flags.
generateDbml(List<String> args, {String defaultOutputPath = 'schema.dbml'}) Future<void>
Walks every Dart file under inputPath, extracts each @GenerateDartModel annotation, and writes one DBML file describing the schema as a single Table per model plus trailing Ref: lines for the foreign keys captured in references:.