schema-xsd

XSD schema definitions for describing database structures.

Overview

This library provides an XML Schema Definition (XSD) file that establishes a common vocabulary for database-as-code tooling:

Supported databases: H2, PostgreSQL, SQLite, SQL Server.

The library is available as both a Maven artifact (XSDs bundled as JAR resources) and a Rust crate (XSD content embedded as compile-time string constants).

Usage

Java / Maven

Gradle:

implementation("com.stano:schema-xsd:1.0.0")

Maven:

<dependency>
    <groupId>com.stano</groupId>
    <artifactId>schema-xsd</artifactId>
    <version>1.0.0</version>
</dependency>

Access the XSD files from the JAR classpath:

InputStream schema = getClass().getResourceAsStream("/schema.xsd");

Rust

Cargo.toml:

[dependencies]
schema-xsd = "1.0.0"

Usage:

use schema_xsd::SCHEMA_XSD;

// Constant is &'static str containing the full XSD content
println!("{}", SCHEMA_XSD);

Schema Overview

schema.xsd

Defines a <database> root element containing:

License

Licensed under either of MIT or Apache 2.0 at your option.