Skip to main content

Load into a test database

Load a run's rows straight into a test database instead of downloading files. Bloom loads into PostgreSQL, MySQL, MariaDB and SQL Server.

Approve the test database first​

Bloom only loads into connections their owner has marked as a test database. Open Connections, edit the connection and turn on Test database: Bloom may load into it. Only do this for databases without real data.

Connections that aren't approved are listed under the load panel with Approve in Connections.

Load​

  1. On a run's result, under Load into a test database, click Load into a database.
  2. Pick the Target connection and, if you want, a Schema (optional).
  3. Choose what happens to Existing rows:
    • Add to what's there, or
    • Replace: empty these tables first.
  4. Tick Create missing tables if the tables don't exist yet. It creates columns, keys and supported constraints, and adds foreign keys after the rows are in.
  5. Check This load will, which lists what will be created, emptied or recreated, then click Load N rows.

Problems are checked before anything is written​

As you choose the target, Bloom checks it and shows any problem with a one-click fix, such as Switch to Replace, Create missing tables, Create schema name, Recreate table or, on PostgreSQL, Load into a new schema. The load button stays off until they're fixed.

Add to what's there stops before writing if the target already has rows with the ids Bloom generated, and names the tables.

Replace asks you to confirm​

Replace and Recreate open Change existing tables?: type the database name to confirm. This can't be undone.

Plans that span several schemas​

If the plan was read from more than one schema (for example sales and billing), Keep each table in its own schema appears and is on by default. Each table loads back into its own schema under its real name: sales.customer and billing.customer stay separate even though the plan calls them sales_customer and billing_customer. The target must already have those schemas.

Untick it to load everything into one schema, using the plan's table names. The SQL download works the same way: for multi-schema plans each INSERT names its schema.

On MySQL and MariaDB a connection is one database, so other schemas aren't offered. On SQL Server, Bloom doesn't create schemas: load into one that exists, such as dbo.

Results​

Up to 200,000 rows load in one transaction: if anything fails you'll see Load failed. Nothing was changed. Larger loads commit in batches, and on MySQL and MariaDB a load that creates tables can't be rolled back, so a failure may say Load failed. The target was partly changed.

Each load is listed under the panel. Only runs made with the current checks can be loaded; for an older run, generate it again.

Loading back into the source database​

A plan's own source database is offered only if it's approved as a test database. It's labelled (source of this plan), with a warning, because the generated rows will sit alongside the real ones and Replace deletes them.

caution

Never approve production, or anything holding real data, as a test database.