Databases and example rows

The code says which tables exist. The database says what they really hold. Atlas reads a database's catalog, matches its tables to the tables in the code, and keeps a few example rows beside each one, so you and the assistant can see the data a program works on.

Atlas only reads. It runs the database's own catalog queries and, when you allow it, one SELECT of a few rows per table. It never runs a query written by a person or a model.

Add a database

Open Databases in the sidebar and choose Add a database. Adding, reading and mapping a database takes a system administrator.

Field What to enter
Name A name for the database, such as Billing production. It cannot be changed later.
Database Its kind. The form shows a connection string to start from.
Connection string Stored as a workspace secret and never shown again. The list shows it with every password, key and token left out. Leave it empty when editing to keep the stored one.
Used by The applications whose code uses the database. Their code tables are what its tables are matched to, and whoever may read one of them may read the database. A database used by no application is visible to administrators only.
Schemas The schemas to read, separated by commas, with * as a wildcard. Empty reads every schema the account can see.
Read example rows Off by default. See Example rows.

Choose Test to open a connection and close it again, and Read now to read the catalog. Reading again finds tables that were added and removes tables that are gone, with their rows. A table you mapped by hand keeps its mapping.

Use an account that can only read. Atlas also asks the database for a read-only session where it can (PostgreSQL, MySQL, SQLite), but the account is what protects the data.

Supported databases

Database Connection string to start from Notes
SQL Server Server=host,1433;Database=db;User Id=user;Password=password;Encrypt=True Also Azure SQL.
PostgreSQL Host=host;Port=5432;Database=db;Username=user;Password=password Also Amazon RDS, Azure and Google Cloud SQL.
MySQL and MariaDB Server=host;Port=3306;Database=db;User ID=user;Password=password Reads the database named in the string.
Oracle Data Source=host:1521/service;User Id=user;Password=password Leaves out Oracle's own schemas.
Db2 Server=host:50000;Database=db;UID=user;PWD=password Db2 for Linux, UNIX and Windows; Db2 for z/OS and IBM i need a Db2 Connect license on the database side.
SQLite Data Source=/data/app.db;Mode=ReadOnly A database file on the Atlas server.
Firebird DataSource=host;Port=3050;Database=/data/app.fdb;User=SYSDBA;Password=password Firebird has no schemas.
Informix Server=host:9089;Database=db;UID=user;PWD=password Read over DRDA (port 9089 by default) with the Db2 driver. Foreign keys are not read.
SAP ASE (Sybase) Data Source=host;Port=5000;Database=db;Uid=user;Pwd=password Reads the database named in the string.
Snowflake account=org-account;user=user;password=password;db=DB;warehouse=WH Reading rows runs queries on the warehouse.
ClickHouse Host=host;Port=8123;Username=user;Password=password;Database=default ClickHouse has no foreign keys.
Google BigQuery A service account key, as JSON Datasets are the schemas. Rows are read without running a query; views get none. For a private endpoint, add "endpoint": "https://..." to the key.
ODBC Driver={HDBODBC};ServerNode=host:30015;UID=user;PWD=password For a database with an ODBC driver installed on the Atlas server, such as SAP HANA or Teradata. Keys are not read.

How tables are matched to the code

A table in the code is a SQL table or view the SQL indexer read, or an ABAP dictionary table or view. Atlas compares each database table with the code tables of the applications the database is used by. The name counts most; then the schema, when the code names one; then how many of the code's columns the database has.

State Means
Matched One code table in a linked application has the name, and nothing is in doubt.
Possible A candidate only. The database is used by no application, another database used by the same application has the same table, several code tables could be this one, or the schema or name only nearly agree.
Not found No code table has the name.
Mapped An administrator chose the code table. Reading the database again keeps it.
Not in code An administrator said no code has this table.

A possible match is shown as a candidate wherever it appears, and the assistant is told it is one. To settle it, choose Map beside the table: pick the code table, choose Not in the code, or choose Match automatically to hand the table back to matching.

Tables are matched again when the database is read, when its applications change, and when a new revision is indexed.

Example rows

Example rows show what a table holds: the codes, formats and values a program has to handle. They are a few rows, not a copy of the table.

From the database

Turn on Read example rows on the database. Atlas reads them each time it reads the catalog.

Setting Default Range
Rows per table 20 1 to 1,000
Characters per value 200 10 to 4,000. Longer values are cut.
Tables at most 200 1 to 5,000. The tables after the limit are listed without rows.
Sensitive columns Names containing password, passwd, pwd, secret, token, ssn, social_security, iban, credit_card, card_number, cvv, salary, email, phone or birth One pattern per line, * for any text.
Sensitive columns are Left out Left out, or kept with their values masked.

Turning example rows off deletes the rows already read.

From a CSV file

On a table's page in the code, choose Add rows from CSV. The file needs a header row and can be up to 2 MB; up to 1,000 rows are kept, and comma, semicolon, tab and pipe are recognized. Uploading a file with the same name again replaces its rows. Sensitive column patterns do not apply to a file you upload: upload only what may be seen.

From a build

The client library pushes rows for a table named in the code, from data your build already has:

using var atlas = new AtlasClient("https://atlas.example.com", libraryToken);

// From a query your build runs against its own database: the first 20 rows.
await using var reader = await command.ExecuteReaderAsync();
await atlas.PushSamplesAsync("Billing", "invoice", reader, maxRows: 20, name: "nightly");

// Or from values you already have.
await atlas.PushSamplesAsync("Billing", "dbo.customer",
    new[] { "customer_id", "name" },
    new[] { new[] { "7", "Weber Partner" }, new[] { "8", "Lang AG" } });

Pushing the same name again replaces the rows. When no indexed revision defines the table yet, the rows are kept and attached once one does; the result's Attached says which happened.

Who sees the rows, and whether the AI does

People see a database's tables and rows when they may read an application the database is used by. Rows uploaded or pushed for a code table follow that table's application.

Whether the assistant and analyses may read rows is a separate decision, made on each set of rows:

  • Rows read from a database follow the database's The assistant and analyses may read the rows setting, which is off by default.
  • Rows from a CSV file or a build are hidden from the AI unless the upload or the push says otherwise.
  • AI can read on a set of rows changes it for that set alone. Once set by hand, the database's setting no longer changes it.

The assistant reads a table's data with the data command (see Ask Atlas). Rows hidden from the AI are left out of everything it can run, its graph queries included.

Referenced by