Skip to content

Commit efcc459

Browse files
author
ds
committed
add JiraQueryBuilder mention to docs
1 parent 0a8a291 commit efcc459

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/3_advanced.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ the platform-specific Query classes can be used.
2424
You can use these query classes as a drop in replacement for the default ``Query`` class shown in the other examples.
2525
Again, if you encounter any issues specific to a platform, please create a GitHub issue on this repository.
2626

27+
Or even different query languages
28+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
30+
Some services created their own query language similar to SQL. To generate expressions for Jira there is a ``JiraQueryBuilder`` class.
31+
32+
.. code-block:: python
33+
34+
from pypika import MySQLQuery, MSSQLQuery, PostgreSQLQuery, OracleQuery, VerticaQuery
35+
36+
J = JiraTable()
37+
j = (
38+
JiraQueryBuilder()
39+
.where(J.project.isin(["PROJ1", "PROJ2"]))
40+
.where(J.issuetype == "My issue")
41+
.where(J.labels.isempty() | J.labels.notin(["stale", "bug"]))
42+
.where(J.repos.notempty() & J.repos.notin(["main", "dev"]))
43+
)
44+
print(j.get_sql())
45+
2746
GROUP BY Modifiers
2847
------------------
2948

0 commit comments

Comments
 (0)