Databases
Who can do this: repository admins, the database administrator, and an administrator of the agent's machine.
The database connector reads tables and views of SQL Server and PostgreSQL through the agent. Available on Scale. Rows become records; a column holding a document’s bytes can make them openable. Nothing is ever written to the database.
| Plan | Scale |
| Reads | Rows of SQL Server and PostgreSQL tables and views in the agent profile’s schemas, as records; a column holding a document’s bytes as its content |
| Does not read | Columns you exclude; files a row only points to by a path; PostgreSQL arrays, enums, money, ranges and network types |
| Reaches it through | The agent, with a read-only database user; the connection string stays in the agent’s configuration file |
| Limits | MySQL and Oracle are not supported yet. Tables without a change marker are rescanned at the crawl interval instead of within minutes; a view cannot be the child side of a hierarchy |
Limits common to every connector — indexed text per document, file size for extraction, OCR — are in Connectors.
Before you start
Section titled “Before you start”-
A read-only database user that may only
SELECTfrom the schemas you want. Deny columns no one should see, or offer a view without them; point at a replica where you have one. The agent opens PostgreSQL sessions read-only in any case. -
A profile on the agent: the connection string stays in the agent’s configuration file; ContentSurface only learns the profile’s name and its schemas.
"Plugins": {"database": {"Enabled": true,"Profiles": {"erp": {"Engine": "sqlserver","ConnectionString": "Server=sql01;Database=Erp;User ID=cs_reader;Password=…;Encrypt=true","Schemas": [ "dbo" ]}}}}Use
"Engine": "postgresql"with an Npgsql connection string for PostgreSQL. Every agent of the connection needs the same profile. Run the agent’s preflight.
Steps in the Portal
Section titled “Steps in the Portal”
- Connections → New connection → Database, on-premises, and the Profile name.
- Under Agents, add the agent; it must report the
databaseplugin. - Check.
- Define each table under Document types: ContentSurface proposes
the key, a name column, dates and a change marker — a
rowversionor a modification time your application always sets, from which changes are read every few minutes. Exclude columns no one should see. See Document types and hierarchy. - New mount point: a table, such as
sales.Customer. A table not defined yet offers Define… right there, with the same proposals. - Mount it. A source filter such as
Country IN ('SI', 'AT') AND Active = truenarrows the rows. - Optionally, a hierarchy places related rows below their parent — orders below their customer — over relation definitions.
ContentSurface checks every 5 minutes: tables with a change marker report
new and changed rows, and each check recounts the rows of every folder of
the mount folder (under its source filter), which finds deleted rows. The
recount is one COUNT per table — per tree level for a parent-field tree —
and uses an index; on a view, which has none, it reads the view. Rows
shown below a row through a hierarchy are counted per level the same way
(one grouped COUNT per level), so a deleted order or invoice line disappears
within minutes too.
A mount folder is then rescanned once a day as a safety net. When it lists or shows rows of a table without a change marker, its mount folder is rescanned at the crawl interval instead: the mount folder’s Crawl says which.
In the API
The Portal does this through these calls; an integration can make them directly.
| Operation | Call |
|---|---|
| Creates a connection; its connector type and source location are fixed. | POST /v1/admin/connections |
| Adds and removes the agents an on-prem connection uses; an added agent must be enrolled and report the connector's plugin. The answer names the mount points each added agent covers. | PATCH /v1/admin/connections/{id}/agents |
| Tests reachability and authentication of the source. | POST /v1/admin/connections/{id}/check |
| Replaces an assigned type's standard field assignments. A changed sourceId, content or parentId gives every node a new identity: with nodes, answers 409 with the impact; repeat with ?confirm and a reason. | PUT /v1/admin/document-types/{id}/standard-fields |
| Validates a location through the connector and creates a mount point on it. | POST /v1/admin/connections/{id}/mount-points |