Connect Metabase and build metrics

Start with the shared setup and dataset. The versioned observations below use the MatrixOne build identified in the overview.

Connection

Install and initialize Metabase; the tested version was v0.64.1.5 with its bundled MariaDB JDBC driver 2.7.15.

  1. In the administration database settings, add a MySQL database.

  2. Set host MO_HOST, port 6001, database bi_tutorial and the read-only username/password.

  3. For the tested local non-TLS instance, add these JDBC connection options:

usePipelineAuth=false&useBatchMultiSend=false&useSsl=false

The first two options disable MariaDB driver’s pipelined authentication/batch multi-send. Configure SSL independently for your deployment. Default pipelined authentication failed in the tested combination; see MatrixOne #24161.

Save an explicit SQL model

Automatic metadata synchronization hit SHOW GRANTS FOR CURRENT_USER() and field-sync errors in the tested version (#29952). An empty discovered-table list does not mean the database is empty. Use an explicit native SQL model when this occurs:

  1. Create a new SQL query on the connection, run the following and check that it returns four rows.

SELECT order_id, customer_id, ordered_at, category, region, quantity,
       gross_amount, refund_amount, net_amount, cost_amount
FROM bi_tutorial.order_metrics
  1. Save it as Paid order metrics and convert it to a Model. Review the model column metadata: IDs/quantity are numbers, ordered_at is a date-time, categories/regions are text and monetary columns are Decimal numbers.

  2. Create a question from the saved model and summarize Sum of net_amount. The scalar result is 410.000000. Break out by category: A=130.000000, B=280.000000.

  3. Save the definition as a metric where the installed version exposes the metric editor. Keep dimensions available in the source model for later filtering. Create Distinct count of customer_id separately; the overall result is 3.

  4. Add saved questions to a dashboard. Map a category filter to the model’s category; selecting A must return net amount 130.000000 and two buyers. Save, reopen and refresh the dashboard.

The tested API workflow used a native card with type: "model", followed by query-builder cards sourcing card__<model-id>. Metric cards used type: "metric". These are Metabase saved objects, not SQL CREATE VIEW statements.

Verification boundary

Saved models, query-builder metrics, filtered dashboard requests and a browser-rendered dashboard were verified for this workaround. It does not fix automatic metadata synchronization. A separate Boolean-to-Number field-sync exception was also observed; do not assume correcting the grants query resolves every sync error. Check the source SQL and the expected KPI results after changing a model.