Company databases

Connect internal tools to your company database

Your orders, customers and stock already live in a database. Now the tools your team builds with AI can work on that live data, behind your company login, without copying anything into a spreadsheet first.

Quick answer

An admin connects the database once with npx teamonly db add. Each app that needs it adds one line to teamonly.json. Postgres and MySQL work, in the cloud or inside your network, with no open ports. On the Team plan and up, and in the free trial.

Team plan and up, and in the free 14-day trialLast updated

01Two kinds

Where is your database?

Either way it is one command, and the password goes straight to Cloudflare. TeamOnly doesn’t keep it.

A

In the cloud

Reachable from the internet, with SSL on. Supabase, Neon, Amazon RDS and Aurora, Google Cloud SQL, Azure Database, PlanetScale for MySQL, or your own server with a public address.

npx teamonly db add crm --url postgres://reader@db.acme.com:5432/crm

You are asked for the password. It isn’t shown and isn’t saved on your computer.

B

Inside your network

No public address: an office server, a database in a private cloud network, a machine in a closet. A small connector from Cloudflare runs on any machine that can reach it. The database needs SSL turned on. A self-signed certificate is fine.

npx teamonly db tunnel

It prints one command to run on that machine. The connector only makes an outgoing connection: no open ports, no firewall changes, no VPN.

02Step by step

How to connect a database

An admin does steps 1 and 2 once. After that, any builder can use the connection in an app.

  1. Use a read-only database user

    Ask whoever runs the database for a user that can read the tables your apps need, and nothing else. Use a user that can write only for an app that must change data.

  2. Connect it (admins only)

    In the cloud: npx teamonly db add crm --url postgres://reader@db.acme.com:5432/crm. Inside your network: run npx teamonly db tunnel, run the command it prints on a machine inside the network (for example sudo cloudflared service install TOKEN, or the Docker line it shows), then npx teamonly db add warehouse --private --host 10.0.4.12 --database wh --user reader. TeamOnly checks it can sign in before it saves the connection. Or use the dashboard: Company page, “Company databases”, “Connect a database”.

  3. Turn it on for an app

    Add "connections": ["warehouse"] to the app’s teamonly.json and run npx teamonly deploy. Apps that don’t list a connection can’t reach it.

  4. Use it in the code

    In the app’s API, c.var.ctx.connection('warehouse').connectionString goes to the postgres or pg package (mysql2 for MySQL). On your computer, put WAREHOUSE_URL in .dev.vars to point at a test copy.

Terminal~/orders-dashboard
npx teamonly db tunnelThe tunnel is ready. Start it on a machine inside your network that can reach the database:  Always on (Linux or Mac service): sudo cloudflared service install eyJh...It only makes an outgoing connection to Cloudflare: no open ports, no firewall changes.npx teamonly db add warehouse --private --host 10.0.4.12 --database wh --user readerDatabase password (not shown, not stored by TeamOnly):Connected "warehouse" (postgres reader@10.0.4.12/wh). The password went to Cloudflare Hyperdrive; TeamOnly does not keep it.npx teamonly deployConnected to the company database "warehouse" (c.var.ctx.connection('warehouse') in the API)Live at https://orders-dashboard.acme.teamonly.app

03The code

What it looks like in the app

One line in the app’s settings, and a normal query in its API. Your AI tool writes this part.

teamonly.json
{
  "name": "orders-dashboard",
  "connections": ["warehouse"]
}
.dev.vars (on your computer only)
WAREHOUSE_URL=postgres://reader:test@localhost:5432/wh

Queries go from the app through Cloudflare Hyperdrive, which keeps a pool of connections close to your database. Use postgres 3.4.5 or later.

src/worker/index.ts
import { Hono } from 'hono';
import postgres from 'postgres';
import { teamonly, type TeamOnly } from 'teamonly/server';

const app = new Hono<TeamOnly>();
app.use('*', teamonly());

app.get('/api/orders', async (c) => {
  const sql = postgres(c.var.ctx.connection('warehouse').connectionString, {
    max: 5,
    fetch_types: false,
  });
  const rows = await sql`
    select id, customer, total, status
    from orders
    where status = 'open'
    order by created_at desc
    limit 100`;
  return c.json(rows);
});

export default app;

04Ask your AI tool

What to type

Name the connection and the tables. Your AI tool does the rest.

  • A dashboard over live data

    “Claude, build a dashboard over our warehouse orders table; use the warehouse connection. Show orders by day for the last 30 days, the top 20 customers, and a searchable table of open orders.”

  • A lookup for the support team

    “Build a customer lookup on the crm connection. Search by name, email or account number, and show the customer’s recent orders. Read only: no edits.”

  • Notes next to company data

    “Keep the warehouse read only. Let people add notes and flags to an order, and save those in the app’s own database with who wrote them.”

05For IT

What IT sees and controls

  • Only admins add connections

    A connection gives apps live access, so only company admins can add or remove one. Builders can use a connection, not create one.

  • Which apps use which database

    The dashboard lists each connection and the apps that use it. Each app page lists the company databases it reaches. A connection can’t be removed while an app still uses it.

  • TeamOnly never keeps the password

    It goes straight to Cloudflare Hyperdrive. TeamOnly stores the name, host, database and user, never the password, and never your data.

  • The database decides what apps can do

    Apps can do exactly what the database user can do. A read-only user means read-only apps, whatever the code says.

  • No inbound access to your network

    For a private database, the connector dials out to Cloudflare. Nothing new listens on your network, and you can stop it by stopping that one service.

  • Still behind company login

    Every request to an app is checked against your company login first, and each app reaches only the connections it lists.

06Compared

How is this different from Retool?

In Retool you add your database as a “resource” and build screens on it in Retool’s editor. Your firewall has to let Retool reach the database, and one on a private network is reached through an SSH tunnel to a bastion host you run. Retool’s Team plan charges for every person who opens an app: $10 a month per builder and $5 per internal user, billed yearly. On TeamOnly the app is ordinary code your AI tool writes, a private database connects with an outgoing-only connector, and people who only use apps are free.

Checked 27 October 2026. Sources: Retool: Connect to PostgreSQL, Retool: SSH tunnels, Retool pricing. More options compared: Retool alternatives.

07FAQ

Questions people ask

All questions and answers

Does it work with MySQL?

Yes. Postgres and MySQL both work, including PlanetScale for MySQL. Use --url mysql://... when you add it, and the mysql2 package in the app.

Can I connect Supabase?

Yes. Supabase is Postgres. Add it with its connection string from the Supabase dashboard, using a database user with only the access your apps need. The app keeps using the company login, not Supabase sign-in.

Does our data pass through TeamOnly’s servers?

No. Queries go from the app’s code, which runs on Cloudflare, through Cloudflare Hyperdrive to your database. TeamOnly stores only the connection details (name, host, database, user). It doesn’t store the password or your data.

Can apps write to the database?

Yes, if the database user can. We recommend a read-only user for most apps, and a separate user that can write only to the tables an app must change.

Is the connector safe to run inside our network?

It is cloudflared, Cloudflare’s own connector. It only makes an outgoing connection to Cloudflare, so you open no ports and change no firewall rules. Only the apps that list the connection can reach the database through it, and only after company login. Keep its token private and stop the service to cut it off.

What does it cost?

Company databases are part of the Team plan ($249 a month for unlimited builders and apps) and Business, and you can try them in the free 14-day trial. There is no charge per connection or per person who uses the apps. They are not on the Builder plan.

Early access

Put your first tool online this week.

TeamOnly is in early access, and every plan is open now. Share one app with up to 5 people for free, try Builder free for 14 days, or subscribe. Either way, your company is ready right away, and three commands put your first app online.

Start freeOr subscribe now

No card for the Free plan or the trial. Paid plans from $19 a month, cancel any time.

Not ready? Get updates

Use your work email. We write rarely, and only when there is news worth sending.

Questions go to hello@teamonly.dev, and a person answers.