# Jira Server App - SQL queries - jooq library

**URL:** <https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489>\
**Category:** Jira Server\
**Tags:** database\
**Created:** [December 19, 2019, 6:10pm UTC](https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489 "2019-12-19T18:10:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreymoser](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/andreymoser/32/38059_2.png) [@andreymoser](https://community.developer.atlassian.com/u/andreymoser)\
**Post date:** [December 19, 2019, 6:10pm UTC](https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489/1 "2019-12-19T18:10:07Z")

</div>

Hey Community! 🙂

I am currently researching how to build typesafe SQL queries in order to develop a Jira Server App and guarantee it to work on all supported databases. One approach is the jooq ([https://www.jooq.org](https://www.jooq.org)) library using the SQL translation feature from one dialect to another ([Format, pretty print, and translate your SQL from one dialect to another](https://www.jooq.org/translate/)), however it’s necessary to buy the professional edition for developers. I did test this approach and it worked nice in open source databases such as MySQL and Postgres in Jira.

So, I would like to discuss and hear from you if there is another approach instead of jooq for building complex and typesafe SQL queries. Maybe jooq is the best option so far.

Thank you’ll =)

Cheers,  
Andrey Bidinotto

---

<div class="post-metadata">

**Author:** ![danielwester](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/danielwester/32/36730_2.png) [@danielwester](https://community.developer.atlassian.com/u/danielwester)\
**Post date:** [December 19, 2019, 6:29pm UTC](https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489/2 "2019-12-19T18:29:24Z")

</div>

Use ActiveObjects and you’ll be 97% there

---

<div class="post-metadata">

**Author:** ![andreymoser](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/andreymoser/32/38059_2.png) [@andreymoser](https://community.developer.atlassian.com/u/andreymoser)\
**Post date:** [December 19, 2019, 6:33pm UTC](https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489/3 "2019-12-19T18:33:47Z")

</div>

Thanks Daniel for your reply! I use AO too, but I have complex queries that are really hard to accomplish with AO queries.

---

<div class="post-metadata">

**Author:** ![a.belostotskiy](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@a.belostotskiy](https://community.developer.atlassian.com/u/a.belostotskiy)\
**Post date:** [December 19, 2019, 8:21pm UTC](https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489/4 "2019-12-19T20:21:36Z")

</div>

QueryDSL is the way to go currently.  
JOOQ is great, but AFAIK it doesnt’t support all databases we need to support in open source edition (like oracle), unless you’re willing to spend a hefty sum for commercial edition. I’ve mentioned this in [similar community post](https://community.developer.atlassian.com/t/querydsl-no-support-no-maintenance-no-one-using-it/33477/2)

---

<div class="post-metadata">

**Author:** ![sascha.haeusler](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/sascha.haeusler/32/37049_2.png) [@sascha.haeusler](https://community.developer.atlassian.com/u/sascha.haeusler)\
**Post date:** [December 20, 2019, 8:30am UTC](https://community.developer.atlassian.com/t/jira-server-app-sql-queries-jooq-library/34489/5 "2019-12-20T08:30:53Z")

</div>

We use QueryDSL ([Bitbucket](https://bitbucket.org/atlassian/atlassian-pocketknife-querydsl/src/master/)). We had to work around some schema issues (somehow it didn’t choose for Postgres and MS-SQL and Oracle I think the correct schema) but otherwise really good to use.
