DSL support deprecated in 3.x, what is alternative?

In my project, we are using DSL intensively to generate dynamic NQL queries as per conditional inputs with java sdk 2.x. But dsl package is deprecated in java sdk 3.x version.
recommended string query is not well suited for Dynamic query generation.
What alternative is available? or Couchbase devs are expecting to implement and maintain similar on our own from 3.x onwards.

We dropped the DSL because we found that while it gets very simple cases off the ground okay-ish, as soon as queries get a little more complex the verbosity of the java language and the complexity of the queries is doing more harm than good. Feel free to copy/paste the old DSL from SDK 2 over into your codebase and keep using it, but in my opinion just writing straight queries is often the easier and more clear choice. Alternatively look into something like spring data with its repositories.

1 Like

Thanks for the lightning response.

We are already creating very complex queries out from it and having very stable system for years now.
If I could have the option of a straight String query, sure I go but here I need dsl package.

The DSL is very self contained (couchbase-java-client/src/main/java/com/couchbase/client/java/query/dsl at master · couchbase/couchbase-java-client · GitHub), so you can copy / paste the namespace over into your project and use it with SDK 3 hopefully without too much issue.

1 Like