supabase_annotations 1.1.3 copy "supabase_annotations: ^1.1.3" to clipboard
supabase_annotations: ^1.1.3 copied to clipboard

Code generator for Supabase/PostgreSQL database schemas from Dart classes. Supports RLS policies, indexes, foreign keys, migration, and table partitioning.

example/README.md

Supabase Annotations Examples #

This directory contains examples demonstrating how to use the supabase_annotations package to generate database schemas from Dart model classes.

Examples #

Simple Test (simple_test.dart) #

A basic example showing how to create a simple user table with RLS policies.

Comprehensive Example (comprehensive_example.dart) #

A complete example demonstrating advanced features including:

  • Complex data types
  • Foreign key relationships
  • Custom indexes
  • RLS policies
  • Validation rules

Advanced Features (advanced_features.dart) #

An example showcasing the most advanced features of the package including:

  • Custom constraints
  • Partitioning strategies
  • Complex relationships
  • Performance optimizations

Running the Examples #

  1. Navigate to the example directory:

    cd example
    
  2. Get dependencies:

    dart pub get
    
  3. Run the code generator:

    dart run build_runner build
    
  4. Check the generated .schema.sql files to see the resulting database schemas.

Generated Files #

Each example generates a corresponding .schema.sql file containing the PostgreSQL DDL statements for creating the database tables, indexes, and policies defined in the Dart models.

2
likes
150
points
440
downloads

Publisher

verified publisherahmetaydin.dev

Weekly Downloads

Code generator for Supabase/PostgreSQL database schemas from Dart classes. Supports RLS policies, indexes, foreign keys, migration, and table partitioning.

Repository (GitHub)
View/report issues

Topics

#supabase #postgresql #database #schema #code-generation

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, collection, logging, meta, path, recase, source_gen, yaml

More

Packages that depend on supabase_annotations