Cypress plugin (v1.0.0) for executing SQL queries against Microsoft SQL Server databases, leveraging the tedious driver. Extends the cypress-sql-server concept by allowing connections to multiple databases by passing the database name as a command parameter. Key differentiator: supports multiple databases within the same server via dynamic database selection, and optionally multiple servers by providing full config per call. Primarily for E2E testing to seed/verify database state. Low release cadence (single version).
npm install cypress-multiple-db-sql-serverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers the Cypress task and custom command using TypeScript. Configures DB connection via env, then executes query against 'myDatabase'.
Always provide the database name parameter in cy.sqlServerQuery(dbName, query).
Ensure env.db is set with correct casing and structure in cypress.config.ts.
Upgrade Cypress to version 10 or higher.
When using execSql directly, provide a config object as the first argument (not from env).
Add valid db configuration under env in cypress.config.ts (or cypress.json for older versions).
Ensure SQL Server is running and reachable. Update server field in db config if needed.
Verify credentials in env.db.authentication.options.userName and .password.
Add on('task', { ...sqlQueryPlugin }) inside setupNodeEvents.