Multi-tenant Postgres

Your Nile data, where work happens.

Nile — Postgres for multi-tenant B2B apps. Reporting here sees across every tenant, which is usually the point.

Use the results in Excel, Google Sheets, AI tools and your apps through the Database REST API.

Every connector type is on Free. Start with 2 data sources and 1 agent.

NileYour existing database connection
Inside your networkQuery Streams Network Agent

Run read-only queries inside your network.

Read-only queries · outbound connection

Source credentials stay on the agent. Your tools receive query results.

Source → agent → allowed results

Query Streams reads Nile from Microsoft Excel, Google Sheets, Power BI, AI assistants over MCP and a REST endpoint through one read-only connection. Nile virtualises tenants inside a single Postgres database rather than giving each customer their own, so tenant-aware tables carry a tenant_id column and one connection can see all of them. Your application scopes itself to one tenant at a time; a reporting connection does not, and for cross-customer analysis that is exactly the behaviour you want.

  • Sees across all tenants
  • Credential shown once at creation
  • Encrypted; chain not verified

Connect Nile with the right settings.

Keep the connection on the Network Agent. These are the details specific to Nile.

Host
<region>.db.thenile.dev
Port
5432
Driver
Npgsql, carried by the agent — nothing to install at the Nile end
Paste format
The string from Database, Settings, Connection, PostgreSQL — as a postgres:// URI
Username
The generated credential id from the console, not an email address
TLS
Required and enforced for Nile hostnames. Encrypted; the certificate chain is not verified
Pooling
None. The agent applies no pooler adaptations for Nile
Tenant scope
No tenant context is set, so the connection sees every tenant. Filter on tenant_id in the query when you need one
Saved as
PostgreSQL, with Nile kept as a badge
Default schema
public, which is what a federated reference carries

Nile is worth understanding as a reporting target specifically because of what it does not do here. The tenant isolation that makes it useful to build on is applied per connection, by the application, when it sets a tenant context. A reporting connection that never sets one is not bypassing a control — it is using the database the way the model intends for an operator who needs to see the whole estate.

The practical consequence is that the scoping decision moves into the query rather than the connection. Adding a tenant_id filter to a saved query and sharing that query gives a customer-scoped view without giving anyone the connection, which is the same pattern Query Streams uses everywhere else: share the ability to run something, not the credentials behind it.

For a cross-source query Nile is ordinary Postgres. A connection you called nile_app is written nile_app.public.orders, and it joins to a folder of CSVs, an on-premises system of record or a billing API in one read-only statement — with nothing copied and nothing scheduled.

Provider reference: www.thenile.dev

Built for how Nile works.

One database, every tenant, one query

Nile's model is the interesting part of this connector, and it changes what a reporting connection is good for.

  • Nile keeps all tenants in one Postgres database and separates them with a tenant_id column on tenant-aware tables, rather than giving each customer a separate database or schema.
  • Your application sets a tenant context per connection and therefore sees one customer at a time. A Query Streams connection does not set that context, so it sees across all of them.
  • That makes cross-tenant reporting a plain GROUP BY rather than an integration project. Usage per customer, revenue by plan, or which accounts have not logged in this month are all one statement.
  • It also means access control is yours to design. A connection here is not scoped to a tenant, so if you need per-customer reporting, filter on tenant_id in the saved query and share that query rather than the connection.
  • Everything the agent runs is read-only, so nothing here can modify tenant data regardless of what the query says.
-- Cross-tenant reporting is an ordinary GROUP BY
SELECT   t.name AS tenant,
         COUNT(o.id)   AS orders,
         SUM(o.amount) AS revenue
FROM     public.tenants AS t
JOIN     public.orders  AS o ON o.tenant_id = t.id
WHERE    o.placed_at >= now() - interval '30 days'
GROUP BY t.name
ORDER BY revenue DESC;

Credentials are shown once, and regional endpoints are ordinary Postgres

Two practical notes that cover most of what happens when setting this up.

  • Nile generates a credential id as the username and shows its password a single time. If you lose it, generate another rather than trying to recover the old one.
  • Endpoints are regional and end in .db.thenile.dev, on the standard port 5432. There is no pooler in this path and the agent applies no pooler adaptations.
  • TLS is required and the agent enforces it for Nile hostnames, so clearing the SSL checkbox does not produce an unencrypted connection. The certificate chain is not verified — read it as protection against anyone reading the traffic, not proof of which server answered.
  • The pasted connection string is dropped once the fields are filled, so the password is stored in one place rather than two.

From connection to useful results.

  1. Install the Network Agent on a machine that can reach the internet. It opens one outbound connection and never listens, so no inbound firewall rule is needed.
  2. In the Nile console open the database, then Settings and Connection, and choose the PostgreSQL option.
  3. Generate a credential if you do not have one. Nile shows the password once, at that moment, so copy it before you leave the page.
  4. Paste the connection string into the first field. Host, port, database, username and password are read out of it.
  5. Leave Use SSL on, test and save. Read it from Microsoft Excel, Google Sheets, Power BI, MCP or REST through that one connection.

Put your Nile results to work.

One connection serves your spreadsheets, apps and AI tools. Share permission to run a saved query; recipients see the allowed results, with the SQL and source login hidden.

For your team, vendors and partners

Pull live Nile results straight into a worksheet and refresh them on demand — desktop Excel, Excel Online, Microsoft 365.

PostgreSQL guide

Ask a question in plain English. Nova already knows your Nile tables, writes and runs the SQL, explains the answer and charts it — no query to write, no credentials to hand over.

How Nova works

Share a live Nile result with anyone — a colleague, a vendor, a partner — as a bookmarkable grid that re-runs fresh when opened, on a phone, a tablet or a desktop. They see the results, never the SQL or the credentials.

How the Data Viewer works

For apps and systems

Publish a Nile query as an authenticated JSON endpoint any application can call, with an OpenAPI 3.1 spec and ready-made Postman, Insomnia and Hoppscotch collections. No database port is opened.

PostgreSQL guide

Paste the generated Power Query M into the Power BI Advanced Editor and the report reads live Nile results over HTTPS — no ODBC driver, no database port opened.

Explore Power BI

For AI tools

Delivered to people

Put a Nile query on a schedule and have the rows delivered to Slack, Discord, email or a signed webhook — or hold the message until a row count, threshold or percentage change crosses the line you set.

How alerts and reports work

Join Nile to the rest of your data.

Bring databases, business APIs, files and logs into one read-only query. Every connector supports Federated Queries.

Name the connections and tables. Query Streams handles the source queries and combines the results.

Explore Federated Queries
Illustrative cross-source query
-- nothing copied, nothing merged, nothing scheduled
SELECT   c.region, COUNT(*) AS orders, SUM(i.amount_due) AS invoiced
FROM     nile_app.public.orders1  f
JOIN     erp_sql.dbo.customers2   c ON c.id = f.customer_id
JOIN     billing.stripe.invoices3 i ON i.customer = c.stripe_id
GROUP BY c.region
ORDER BY invoiced DESC;

Use your own connection, schema, table and column names.

Shared across the connector family.

True of every database connector

  • Outbound only — the agent opens one encrypted connection out to Query Streams. No inbound port to forward, no VPN, no IP allowlist, nothing about your database exposed to the internet.
  • Credentials stay put — the database username and password live on the machine you installed the agent on. Query Streams never receives them and cannot reach your database on its own.
  • Read-only, enforced — one statement at a time, SELECT and friends only. A write is rejected on your own machine before it is ever sent to the server, rather than relying on a permission somebody remembered to set.
  • Deploy as many agents as you like — one per site, region or cloud. Every data source they can see arrives in a single dropdown, so nobody has to know which agent hosts what.

What you get once a query is saved

  • Share the capability, not the SQL — a colleague or an outside partner can run your query and change its filters without ever seeing the statement behind it.
  • Filters from either direction — declare them yourself as @variables, or let the connector spot the literal values already sitting in your WHERE clause and offer those as dropdowns.
  • Read it from anywhere — Microsoft Excel, Google Sheets, Power BI, the REST API, AI assistants over MCP, the Query Builder and Nova all read the same saved query.
  • Run several at once — five saved queries into five worksheet tabs, streamed concurrently, however large the results.
  • Join it to anything else you have connected — another database, a business API, or a folder of files, in one read-only statement.

Questions about Nile

Where can I use Nile query results?

Use Nile results in Excel, Google Sheets, the Data Viewer, your apps through the Database REST API, and AI tools through MCP or Nova. Saved results also feed supported Automation destinations, reports and alerts. Destination availability and allowances depend on your plan.

Do I need to open an inbound port for Nile?

No. Install the Network Agent on a machine that can reach Nile. The agent connects outward to Query Streams; no inbound port or VPN is needed. Your source must still allow the agent machine to connect under its own access rules.

Can Query Streams change data in Nile?

No. Queries are enforced read-only on the Network Agent before execution. Source credentials stay on that machine. Sharing grants permission to run a saved query and receive its results; it does not reveal the SQL or database login.

What do I need to connect Nile?

Host: <region>.db.thenile.dev. Port: 5432. Driver: Npgsql, carried by the agent — nothing to install at the Nile end. Paste format: The string from Database, Settings, Connection, PostgreSQL — as a postgres:// URI

Can I join Nile to other connected sources?

Yes. Federated Queries support every connector type, including databases, business APIs, files and logs. Name the connections and tables in one read-only query. Query Streams translates the source portions as needed and combines their results. See how Federated Queries work.

Does Nile use the PostgreSQL connector?

Yes. Nile uses the PostgreSQL wire protocol. Its provider preset supplies the relevant connection settings. The linked PostgreSQL guides apply to the shared workflow; use the provider-specific connection details on this page for your endpoint and security requirements.

Put Nile where the work happens.

Start with Free: every connector type, 2 data sources and 1 Network Agent. Add plan allowances as your needs grow.