https://kotlinlang.org logo
#feed
Title
# feed
c

CLOVIS

09/20/2021, 10:34 AM
I have recently started working on a Kotlin/JVM DSL for Apache Cassandra. I will be releasing it as part of a greater project, under the Apache 2.0 license. I'm curious if there's interest from the community, I don't think Cassandra is very popular with Kotlin developers?
🎉 9
e

elect

09/20/2021, 4:15 PM
Hey Clovis, what's your usage target in mind?
c

CLOVIS

09/20/2021, 7:40 PM
I'm starting a project that will use Apache Cassandra as a database (both because of the high availability guarantees, and because I want to learn how projects are managed at FB-scale). I've been looking at different JVM drivers, and from what I see the only one actively maintained is DataStax's, however it is really inconvenient to use from Kotlin (everything is annotation-based/code generation-based, which might be a good fit for Java, but really ugly in Kotlin). It also doesn't handle migrations.
I've started writing a small DSL on top of the DataStax drivers, that is able to create missing columns / access database columns through KotlinX.Coroutines etc. The actual project this is used for is written to be highly modular as some parts will be very useful to reuse in other projects, so while I'm at it I'm making this into its own library as well.
However, I don't really have any experience with C*, so I'd be interested in someone knowing how everything works / best practices to guide my steps
e

elect

09/21/2021, 7:50 AM
it might be maybe a little too challenging if you didn't design yet such a library and don't have much experience with C, but nonetheless, you have a lot to learn from such an experience, so if you feel it ok, go for it 🙂 You may want to look also into this for some inspiration or building on top
c

CLOVIS

09/21/2021, 7:55 AM
I'm not really building the connection etc, I'm just writing a Kotlin DSL bridge that generates CQL, then I'm feeding that CQL to DataStax's drivers, so the “hard part” is on them (in particular because I know that maintaining such a driver is a ton of work)
The current DSL I have takes inspiration from Exposed (for the column declarations) and from KMongo (for the queries).
e

elect

09/21/2021, 9:50 AM
ok, it makes sense. Don't forget about DSL annotation to improve experience
Hey Clovis, I've been creating a couple of DSL, and I thought that it'd be nice for the users/devs to group all of them under a single organization.. like
kotlin-dsl
or whatever what do you think?
c

CLOVIS

09/26/2021, 3:46 PM
This is the repo of this project: https://gitlab.com/braindot/clovis In particular, the Cassandra stuff is in the
core.database
module (this is very early stages of the project). In the future, the project will provide DSLs for Google Calendar and a few other things. Everything is under Apache 2.0, so if you want to fork the repo and republish it under another namespace, you're free to do that 👍
e

elect

09/26/2021, 4:02 PM
any reason for gitlab over github?
c

CLOVIS

09/26/2021, 6:22 PM
GitLab is open source, the prices are much lower (unlimited private repositories in the free version, open source organizations can get the Ultimate/Gold tiers for free), CI is very easy to setup yet very powerful (though that's from before GitHub Actions, not sure how good that is), in general you get much more features in the free version than the paid one You can self host (including the free version), which my university did (the reason I switched originally)
If you prefer GitHub though, nothing is stopping you from publishing a copy there
e

elect

09/27/2021, 8:28 AM
I don't want the burden to keep it update 🙂 Maybe an awesome-kotlin-dsl-script repo with link might be a nice alternative
c

CLOVIS

09/27/2021, 9:48 AM
You should probably be able to tell GitHub to mirror the repository? GitLab can, at least
Keeping it updated should be as simple as git pull+push, though
5 Views