A Scala wrapper for Java VelocyPack.
The objective is to allow seamless use with Scala case classes without the need to write boilerplate and error-prone Velocypack serializer/deserializer conversions yourself.
The library is composed by these modules:
- core: encapsulates common behaviours and provides basic vpack formats
- macros: case class format generation using Scala macros
To use velocypack4s in your project add the following in your build.sbt file:
libraryDependencies += "org.scalamari" %% "velocypack4s-macros" % "0.0.1"
Simple serialization/deserialization with velocypack4s:
import org.scalamari.velocypack4s.core._
import org.scalamari.velocypack4s.macros._
import com.arangodb.velocypack._
case class Foo(bar: String)
val fooSerializer: VPackSerializer[Foo] = serializer[Foo]
val fooDeserializer: VPackDeserializer[Foo] = deserializer[Foo]
object Module extends VPackModule {
override def setup[C <: VPackSetupContext[C]](context: C): Unit = {
context.registerSerializer(classOf[Foo], fooSerializer)
context.registerDeserializer(classOf[Foo], fooDeserializer)
}
}
The content of the README file is generated from modules/docs/src/main/tut/README.md
To edit the README file:
- Edit
modules/docs/src/main/tut/README.md
- Run
sbt tut
- Commit both files.
- backward/forward compatibility tests