* Resolve the set of schemas a search should scope to when the caller did not * pass an explicit `schema` filter. * * Prefers the connector's default schema (e.g. the database named in a * MySQL/MariaDB DSN) so searches don't leak across every database on the * server. When the connector report
(connector: Connector)
| 78 | * for PostgreSQL/SQL Server/SQLite is already scoped to the connected database. |
| 79 | */ |
| 80 | async function resolveDefaultSchemas(connector: Connector): Promise<string[]> { |
| 81 | if (connector.getDefaultSchema) { |
| 82 | const defaultSchema = await connector.getDefaultSchema(); |
| 83 | if (defaultSchema) { |
| 84 | return [defaultSchema]; |
| 85 | } |
| 86 | } |
| 87 | return connector.getSchemas(); |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Get row count estimate for a table. |
no test coverage detected