<!-- Source: @site/projects/sqlens-for-laravel/docs/rules/cap-l0-instance-ambiguous.md -->
<!-- Canonical: https://docs.pushery.com/sqlens-for-laravel/rules/cap-l0-instance-ambiguous/ -->

# CAP.L0.INSTANCE_AMBIGUOUS — more than one connection could be the one to audit

> An audit describes one database. When the configuration leaves several candidates and nothing chose, the run stops rather than picking.

- **Category:** safety
- **Level:** 0
- **Stability:** stable
- **Suites:** audit

`sqlens:audit` produces a report **about one database**. When the project configures several
connections the audit could plausibly mean, and neither a flag nor the config says which, the run
stops here instead of choosing one.

## Why not just take the default connection

Because the report would not say it had chosen. A finding about `mysql` and a finding about
`analytics` are indistinguishable once they are in a list, and a reader would draw a conclusion about
their application from a statement about a reporting replica.

Picking on the project's behalf is the one thing that turns a correct report into a misleading one.

## What to do

Name the connection:

```bash
php artisan sqlens:audit --connection=mysql
```

…or settle it once, in config:

```php
// config/sqlens.php
'connection' => 'mysql',
```

The notice lists the candidates it found, so the choice is between names you can see rather than
names you have to go and look up.

## Related

- [The audit suite](https://docs.pushery.com/sqlens-for-laravel/audit.md) — the four statements the command will not make for you
- [Read/write splits and replicas](https://docs.pushery.com/sqlens-for-laravel/read-write-split.md) — the same refusal, one level down: which HOST inside one connection
