A Rust library for SQL schema definition and discovery across MySQL, PostgreSQL, and SQLite databases.
SeaSchema is a Rust library that provides type definitions and utilities for managing SQL database schemas. It enables developers to programmatically represent, discover, and export database structures like tables, columns, indexes, and foreign keys from live MySQL, PostgreSQL, or SQLite databases. This bridges the gap between database metadata and Rust applications, facilitating tasks like code generation and migration scripting.
Rust developers building database tooling, ORM layers, or applications that require programmatic interaction with SQL database schemas, such as those working on migration systems, schema introspection tools, or code generators.
Developers choose SeaSchema for its uniform, type-safe API that works across multiple SQL databases (MySQL, PostgreSQL, SQLite), offering precise schema discovery and export capabilities. Its integration with SeaQuery for generating SQL statements and optional Serde support for JSON serialization provides flexibility for building robust database-related tooling.
🌿 SQL schema definition and discovery
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a consistent API for schema discovery across MySQL, PostgreSQL, and SQLite, as demonstrated in the README with examples for each database type, reducing vendor-specific code.
Uses comprehensive Rust structs like TableDef and ColumnInfo that closely map to SQL schema elements, ensuring compile-time safety and accurate representation, as shown in the detailed film_actor table example.
Enables programmatic introspection of live databases and exports schemas to SeaQuery statements or raw SQL, facilitating migration scripts and code generation, evidenced by the discovery module and writer utilities.
Supports JSON serialization/deserialization via the with-serde feature, allowing easy storage or sharing of schema definitions, as mentioned in the architecture section.
Only covers MySQL, PostgreSQL, and SQLite, excluding other common SQL databases like SQL Server or Oracle, which limits its use in heterogeneous environments.
Full schema export to SeaQuery statements requires the SeaQuery library, adding an extra dependency and complexity if not already part of the project's toolchain.
The detailed type system and discovery process may introduce unnecessary complexity for applications that only need basic schema access without advanced manipulation or code generation.