Crate degauss[][src]

Expand description

DeGauss

Your friendly neighborhood Avro schema compatibility checker.

cicd Crates.io Docs.rs codecov


Usage

degauss can be used to check the compatibility of schemas and help with schema evolution.

Let’s consider a scenario, we have a schema which is registered on kafka.

cat schema_v1.avsc

{
"type": "record",
"name": "movie",
"fields": [
{
        "name": "movie_id",
        "type": "long"
    },
    {
        "name": "title",
        "type": "string"
    },
    {
        "name": "release_year",
        "type": "long"
    }
]
}

Another user wants to evolve this schema but wants to make sure if the new schema adheres to the compatibility guarantees for the given topic. The resulting v2 of this schema could look like:

 cat schema_v2.avsc

 {
 "type": "record",
 "name": "movie",
 "fields": [
 {
         "name": "movie_id",
         "type": "long"
     },
     {
         "name": "title",
         "type": "string"
     }
 ]
 }

The person can simply use degauss to check this.

degauss -s older_schema.avsc current_schema.avsc --compat forward # or choose from several compatibilities

Modules

Errors to be used with the library, converts to and from other dependencies’ errors.

Helper traits to assist the Schema object. This can be used to read a file and convert it to avro_rs::Schema object.

A lightweight schema registry client to interact with Kafka Schema Registry.