Ensure database code properly handles provider-specific differences and capabilities. Different database providers have varying syntax requirements, feature support, and connection methods that must be accounted for in the implementation.
Ensure database code properly handles provider-specific differences and capabilities. Different database providers have varying syntax requirements, feature support, and connection methods that must be accounted for in the implementation.
Key areas to consider:
$1
, $2
) while others use anonymous placeholders (?
)Example of proper provider-specific handling:
// Handle parameter binding differences
const usesAnonymousParams = [Providers.MYSQL, Providers.SQLITE].includes(provider)
// Skip provider-specific features appropriately
if (datasource.provider !== 'sqlite' && parseEnvValue(datasource.url) === defaultURL(datasource.provider)) {
// Show warning for non-SQLite providers only
}
// Handle provider-specific connection methods
if (credentials.type === 'postgresql' || credentials.type === 'cockroachdb') {
// Unix socket handling for PostgreSQL-compatible databases
}
Always test provider-specific code paths and avoid making assumptions about universal database feature support.
Enter the URL of a public GitHub repository