import { collectDependencies } from '../detection-utils.js';
const PLANETSCALE_DEPS = ['@planetscale/database', 'planetscale-go'];
const NEON_DEPS = ['@neondatabase/serverless', 'neon-serverless'];
const SPANNER_DEPS = [
    '@google-cloud/spanner',
    'google-cloud-spanner',
    'cloud.google.com/go/spanner',
];
const ALLOYDB_DEPS = ['@google-cloud/alloydb', 'google-cloud-alloydb-connector'];
const COCKROACH_DEPS = ['cockroachdb', '@cockroachlabs/serverless'];
const TIDB_DEPS = ['tidb', 'tidb-serverless', '@tidbcloud/serverless'];
export async function detectNewSqlDb(projectPath) {
    const deps = await collectDependencies(projectPath);
    // PlanetScale (specific SDK)
    if (PLANETSCALE_DEPS.some((d) => deps.has(d))) {
        return 'planetscale';
    }
    // Neon (PostgreSQL serverless)
    if (NEON_DEPS.some((d) => deps.has(d))) {
        return 'neon';
    }
    // Spanner (Google Cloud)
    if (SPANNER_DEPS.some((d) => deps.has(d))) {
        return 'spanner';
    }
    // AlloyDB (Google Cloud)
    if (ALLOYDB_DEPS.some((d) => deps.has(d))) {
        return 'alloydb';
    }
    // CockroachDB
    if (COCKROACH_DEPS.some((d) => deps.has(d))) {
        return 'cockroachdb';
    }
    // TiDB
    if (TIDB_DEPS.some((d) => deps.has(d))) {
        return 'tidb';
    }
    return null;
}
//# sourceMappingURL=newsql-db-detector.js.map