Contributing Guidelines
Relevant source files
The following files were used as context for generating this wiki page:
SeaSchema is a community-driven library designed to manage database schemas for MySQL, Postgres, and SQLite. It provides type definitions for schema representation and utilities for schema discovery from live databases. Contributions are encouraged to help build the future of Rust's database ecosystem.
Contributors are invited to participate through starring the repository, commenting, sharing, and submitting code contributions. The project maintains a Discord server for community interaction and coordination.
Sources: README.md:1-25, README.md:162-168
Code Quality and Linting
To maintain a high standard of code quality, the project utilizes clippy for static analysis. Before submitting a contribution, developers should ensure their code adheres to the project's linting rules.
The project provides a dedicated script, build-tools/rustclippy.sh, which automates the process of running clippy across the entire workspace, including the core library, the derive macro, and all test suites. This script is designed to automatically fix issues where possible using the --fix flag.
Linting Execution Flow
The following diagram illustrates the automated linting process performed by the development tools.
This diagram shows how the script iterates through primary manifests and nested test configurations to apply fixes.
Sources: build-tools/rustclippy.sh:1-21
Development Workflow and Requirements
SeaSchema is built using the Rust 2024 edition and requires a minimum supported Rust version (MSRV) of 1.85.0. The project is organized as a workspace with several specialized members.
Workspace Structure
| Member | Description |
|---|---|
. (Root) | The core sea-schema library. |
sea-schema-derive | Procedural macros for the Name trait. |
tests/discovery/* | Integration tests for schema discovery (MySQL, Postgres, SQLite). |
tests/writer/* | Integration tests for SQL generation from schema definitions. |
tests/live/* | Real-world tests against live database instances. |
Sources: Cargo.toml:1-18, Cargo.toml:24-25
Synchronous Version Maintenance
The project maintains a separate synchronous version of the library called sea-schema-sync. Contributors modifying the core asynchronous library must be aware that the sync version is generated by transforming the source code.
The transformation is managed by build-tools/make-sync.sh, which performs the following operations:
- Copies source files from
srctosea-schema-sync/src. - Removes
asyncand.awaitkeywords usingsed. - Replaces
sqlxspecific types and errors withrusqliteequivalents. - Removes
async_traitattributes andSyncbounds. - Updates
Cargo.tomldependencies to reflect the synchronous stack.
This flow ensures that the synchronous library remains in lock-step with the primary asynchronous implementation.
Sources: build-tools/make-sync.sh:1-32
Documentation and Changelog
All notable changes must be documented in CHANGELOG.md. The project adheres to Semantic Versioning and follows the Keep a Changelog format.
When submitting a pull request, contributors should categorize their changes under the following headings:
- Features: New capabilities.
- Bug Fixes: Corrections to existing logic.
- Enhancements: Improvements to existing features.
- Breaking Changes: Changes that require version bumps and migration notes.
- Upgrades: Dependency version updates.
Sources: CHANGELOG.md:1-8, CHANGELOG.md:13-35
Licensing and Submissions
Contributions to SeaSchema are dual-licensed under the Apache License, Version 2.0 and the MIT License. By submitting a contribution, you agree that your work will be licensed under these terms without any additional conditions.
| License | File Reference |
|---|---|
| Apache-2.0 | LICENSE-APACHE |
| MIT | LICENSE-MIT |
Sources: README.md:151-160
Summary
Contributing to SeaSchema involves adhering to the Rust 2024 edition standards, ensuring code quality through rustclippy.sh, and supporting the project's unique dual-architecture (Async and Sync) by validating changes against the make-sync.sh transformation process. All contributions help maintain a robust toolset for SQL schema discovery and definition in the Rust ecosystem.