Overview
Vulcan provides Avro schemas, encoders, and decoders between Scala types and types used by the official Apache Avro library. The aims are reduced boilerplate code and improved type safety, compared to when directly using the Apache Avro library. In particular, the following features are supported.
Schemas, encoders, and decoders for many standard library types.
Ability to easily create schemas, encoders, and decoders for custom types.
Derivation of schemas, encoders, and decoders for
case class
es andsealed trait
s.
Documentation is kept up-to-date, currently documenting v1.11.1 on Scala 2.13.
Getting Started
To get started with sbt, simply add the following line to your build.sbt
file.
libraryDependencies += "com.github.fd4s" %% "vulcan" % "1.11.1"
Published for Scala 2.12, 2.13 and 3.3. For changes, refer to the release notes.
For Scala 2.12, enable partial unification by adding the following line to build.sbt
.
scalacOptions += "-Ypartial-unification"
Modules
Following are additional provided modules.
Enumeratum
For enumeratum support, add the following line to your build.sbt
file.
libraryDependencies += "com.github.fd4s" %% "vulcan-enumeratum" % "1.11.1"
Generic
For generic derivation support, add the following line to your build.sbt
file.
libraryDependencies += "com.github.fd4s" %% "vulcan-generic" % "1.11.1"
Refined
For refined support, add the following line to your build.sbt
file.
libraryDependencies += "com.github.fd4s" %% "vulcan-refined" % "1.11.1"
External Modules
Following is an incomplete list of third-party integrations.
Signatures
Stable release artifacts are signed with the 7AD5 92B5 B105 24E3
key.
Compatibility
Backwards binary-compatibility for the library is guaranteed between minor and patch versions.
Version 1.a.b
is backwards binary-compatible with 1.c.d
for any a > c
or a = c
and b > d
.
Please note binary-compatibility is not guaranteed between milestone releases.
Snapshot Releases
To use the latest snapshot release, add the following lines to your build.sbt
file.
resolvers += Resolver.sonatypeRepo("snapshots")
libraryDependencies += "com.github.fd4s" %% "vulcan" % "1.11.1+13-a9683946-SNAPSHOT"
Dependencies
Refer to the table below for dependencies and version support across modules.
Module | Dependencies | Scala |
---|---|---|
vulcan | Apache Avro 1.11.4, Cats 2.12.0 | Scala 2.12, 2.13 and 3.3 |
vulcan-enumeratum | Enumeratum 1.7.5 | Scala 2.12 and 2.13 |
vulcan-generic | Magnolia 0.17.0, Shapeless 2.3.12 | Scala 2.12, 2.13 and 3.3 |
vulcan-refined | Refined 0.11.2 | Scala 2.12, 2.13 and 3.3 |
Inspiration
Library is heavily inspired by ideas from avro4s.
License
Licensed under the Apache License 2.0. Refer to the license file.