Pointing NocoDB at a Real Database
Everything so far lived in bases NocoDB created, in tables NocoDB made. This chapter is the product's other half — and this guide teaches it from the documentation, because the lab could show you the door but not walk through it. Read the evidence first; it is short and it is real.
The idea
Most interesting data already lives
somewhere: the shop's PostgreSQL, the
club's MySQL, a SQL Server at work.
Creating a base from such a
database — instead of starting empty —
makes NocoDB a face on tables that
already exist: the grid reads and
writes the original rows, in the
original database, while other tools
keep using them as before. NocoDB calls
each connected database a source of
the base (chapter 2), and a base may
have several: its own store plus
outside ones, with tables from each
sitting side by side in the same
project. The info endpoint in this
lab's server advertised the capability
plainly — "connectToExternalDB":true
in transcript t02 — so what follows is
not a paid-edition rumour; it is a
feature of the edition on this page.
Per the documentation, the connection asks for what any database client asks for: host, port, database name, a user and password, and SSL settings where the server demands them. PostgreSQL and MySQL (with MariaDB) are the documented citizens; SQL Server appears in the documentation's lists as well. On connecting, NocoDB reads the database's own catalogue and presents its tables; you choose which ones the base shows, and NocoDB layers its fields, views and roles over them, keeping that layer in its metadata database, not in yours.
What the lab could and could not show
The lab had no database server — no PostgreSQL, no MySQL, nothing listening that speaks a database protocol — so no live external connection was possible. What it could do was offer the one database it had: a small SQLite file, written by a script, holding a seed-packet table (transcript t10). The server's answer, twice, in two request shapes, verbatim:
HTTP 400 {"msg":"Connection missing host name or IP address"}
That refusal is itself the chapter's
most useful fact. In this build, adding
a source demands a host — the
feature is aimed at server databases,
and an SQLite file cannot be attached
as an external source through this API
(SQLite serves as the built-in store,
chapter 2, not as an outside source).
Everything beyond that refusal in this
chapter is documented, not run, and
criteria.md records it that way.
Judgement for when you do it
Three cautions, from the documentation and the shape of the thing. Give NocoDB a database account with only the rights it needs — a read-only user makes a genuinely read-only base, enforced by the database itself, beneath NocoDB's own roles. Expect NocoDB's types to be a rendering of the database's types: exotic column types may arrive as text or as the catch-all "specific database type" field, and the database stays the authority on what fits. And remember the layer split when backing up (chapter 13): your rows live in your database, your views and fields and members live in NocoDB's metadata — losing either loses half the thing.