Thank you for your interest in contributing to the Prisma Flutter Connector!
- Dart SDK (3.0.0 or higher)
- Flutter SDK (optional, only for Flutter app examples)
- Node.js (20.x or higher, for Prisma CLI migrations)
- Prisma CLI:
npm install -g prisma - Docker (for PostgreSQL integration tests)
- Git
- Fork and clone the repository
git clone https://github.com/teetangh/prisma-flutter-connector.git
cd prisma-flutter-connector- Install dependencies
dart pub get- Run analyzer
dart analyzeRun the pure-Dart unit test suite directly:
# Run unit tests
dart test test/unit/
# Or via Makefile:
make test-unit
make test-postgres
make test-sqliteAlternatively, use the test runner scripts:
# Run entire test suite
./scripts/test-runner.sh
# Run only unit tests
./scripts/test-runner.sh --only-unit
# Run only integration tests
./scripts/test-runner.sh --only-integration
# Test specific database
./scripts/test-database.sh postgres
./scripts/test-database.sh sqliteSee the test README for detailed instructions on manual testing setup.
The project uses modular GitHub Actions workflows for maintainability and clear diagnostics:
.github/workflows/unit-tests.yml- Pure-Dart unit tests.github/workflows/lint.yml- Code quality (formatting + analyzer).github/workflows/postgres-integration.yml- PostgreSQL integration tests.github/workflows/sqlite-integration.yml- SQLite integration tests.github/workflows/supabase-integration.yml- Supabase integration tests.github/workflows/publish.yml- Release workflow to pub.dev
- Lint - Code formatting and analyzer checks
- Unit Tests - Fast pure-Dart tests without external dependencies
- Integration Tests:
- PostgreSQL (GitHub Actions service container)
- SQLite (file-based, no service needed)
- Supabase (requires GitHub secrets, conditional)
Supabase integration tests require credentials stored as GitHub repository secrets.
- Go to https://supabase.com
- Create a new project
- Wait for the project to finish provisioning
-
Project URL:
- Navigate to Project Settings → API
- Copy the "Project URL" (e.g.,
https://xxxxx.supabase.co)
-
Anon Key:
- Navigate to Project Settings → API
- Copy the "anon" key under "Project API keys"
-
Database URL (Session pooler):
- Navigate to Project Settings → Database
- Scroll to "Connection string" section
- Select "Transaction" mode
- Copy the connection string (starts with
postgresql://postgres.your-project:...pooler.supabase.com:6543) - Replace
[YOUR-PASSWORD]with your database password
-
Direct URL (Direct connection):
- Navigate to Project Settings → Database
- Scroll to "Connection string" section
- Select "Session" mode or "Direct connection"
- Copy the connection string (starts with
postgresql://postgres:...@db.your-project.supabase.co:5432) - Replace
[YOUR-PASSWORD]with your database password
-
Go to your GitHub repository
-
Navigate to Settings → Secrets and variables → Actions
-
Click "New repository secret"
-
Add the following secrets:
-
Name:
SUPABASE_URL- Value: Your Supabase project URL
-
Name:
SUPABASE_ANON_KEY- Value: Your Supabase anon key
-
Name:
SUPABASE_DATABASE_URL- Value: Your Supabase pooled connection string (Transaction mode)
-
Name:
SUPABASE_DIRECT_URL- Value: Your Supabase direct connection string (Session mode)
-
-
Once all four secrets are added, the Supabase integration tests will run automatically
You can manually trigger workflows from the GitHub Actions tab:
- Go to the "Actions" tab in your GitHub repository
- Select the workflow you want to run:
- Unit Tests - Run only unit tests
- PostgreSQL Integration Tests - Run only PostgreSQL tests
- SQLite Integration Tests - Run only SQLite tests
- Supabase Integration Tests - Run only Supabase tests
- Code Quality - Run linting and analysis
- Click "Run workflow"
- Select the branch and click "Run workflow"
Use Dart's standard formatting:
dart format .Follow the rules defined in analysis_options.yaml:
dart analyzeExclude generated files from version control:
**/*.g.dart(json_serializable)**/*.freezed.dart(Freezed)**/generated/**(Prisma-generated code)
prisma-flutter-connector/
├── lib/
│ ├── src/
│ │ ├── generator/ # AST-based code_builder generators (Cb*) & PrismaParser
│ │ └── runtime/ # Pure-Dart SQL compiler, QueryExecutor, adapters, errors
│ ├── prisma_flutter_connector.dart
│ ├── runtime.dart
│ └── runtime_server.dart
├── test/
│ ├── unit/ # Pure-Dart unit tests
│ └── integration/ # Integration tests (PostgreSQL, SQLite, Supabase)
├── example/ # Example applications
├── bin/
│ └── generate.dart # CLI code generator
└── .github/
└── workflows/ # CI/CD workflows
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Add tests for new functionality
- Run tests and analyzer:
dart test test/unit/ && dart analyze - Format code:
dart format . - Commit with descriptive message
- Push and create a pull request
- Create a bugfix branch:
git checkout -b fix/issue-123 - Write a failing test that reproduces the bug
- Fix the bug
- Ensure all tests pass (
dart test test/unit/) - Commit and create a pull request
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changestest:Adding or updating testsrefactor:Code refactoringchore:Maintenance tasks
Example:
feat: add support for PostgreSQL array types
- Parse array types in Prisma schema
- Generate List<T> types in Dart models
- Add unit tests for array operations
- Update documentation if needed
- Add tests for new features
- Ensure all CI checks pass
- Request review from maintainers
- Address feedback promptly
- Squash commits if requested
Reviewers will check:
- Code quality and style
- Test coverage
- Documentation updates
- Breaking changes (require major version bump)
- Performance implications
- Issues: GitHub Issues
- Discussions: GitHub Discussions
By contributing, you agree that your contributions will be licensed under the same license as the project.