Typesafe DSL for Xodus based on the new context receivers
Inspired by Xodus-DNQ
Goals:
- Typesafe
- Lightweight
- Better Output(smaller Java Bytecode output)
See Example
store.executeInTransaction {
with(it) {
val newEntity = TestGeneratedEntity(
name = "test",
uid = "testUid",
email = "test@eridani.club",
age = 23,
gender = "Male",
bio = "Hi, this is dsl testing."
)
}
}
store.executeInTransaction {
with(it) {
val testEntities = TestGeneratedEntity.query {
(name eq "test") or (name startWith "t")
}
val anotherQueryX = TestGeneratedEntity { name startWith "x" }
val anotherQueryY = TestGeneratedEntity { name startWith "y" }
val anotherQueryZ = TestGeneratedEntity { name startWith "z" }
val queryOperation = ((anotherQueryX or anotherQueryY) and anotherQueryZ) + testEntities
queryOperation.forEach {
println(it.name)
}
}
}
- Use inline value classes
- Use inline methods
- Basic Examples
- DSL Marker Annotation
- Entity Link dsl
- All Query builder
- Source Code Generation
- Generate through Kotlin Compiler Plugin