Skip to main content
This tutorial runs real queries against RNAcentral, the public PostgreSQL database operated by EMBL-EBI. It is officially public: host, user and password are published by RNAcentral, so you can reproduce every call here exactly — RWS QA runs these very queries against the deployed service.

Prerequisites

Step 1: A first unpaged query

RNAcentral’s rnacen.rnc_database table lists the databases it aggregates — a few dozen rows, well under the 5,000-row unpaged cap. In your integration’s extract (or straight from curl), send:
The answer comes back in about two seconds:
Every value is a string or null — numbers, dates and even PostgreSQL jsonb columns arrive as text, exactly as the response contract promises.
An unpaged ORDER BY is fine. Only paginated queries must leave ordering to the service.

Step 2: Paginate with a cursor

rnacen.rna holds tens of millions of RNA sequences, so this slice of 12,000 rows needs paging. Add the cursor directives and drop the ORDER BY (the service sorts by your unique keys): The first call carries no x_cursor; each response’s next_cursor feeds the next call’s x_cursor, until it comes back null. In the RWS Application, the cursor pagination config from the Live JDBC reference drives this loop for you. Verified result on the live service: 12,000 rows in 5 pages of 2,500 — 12,000 distinct ids, no duplicates, no gaps (offset mode returns the identical set). id is the table’s primary key, which is exactly what x_unique_keys wants: unique over the whole result, never NULL.

PostgreSQL notes

  • The paginated wrapper runs your SQL as a derived table — any valid PostgreSQL SELECT works, including CTE-free subqueries and jsonb columns.
  • A trailing ; in x_sql is stripped automatically.
  • timestamp columns arrive as yyyy-MM-ddTHH:mm:ss strings in the database’s wall-clock time; timestamptz carries its offset.

Next steps

Live JDBC guide

The full reference: directives, pagination, errors

MySQL tutorial

The same flow against Rfam and Ensembl