{"record":{"id":"de77a67a6c9ef5dc","repo":"cube-js/cube","slug":"the-keybydatasource-cubejs-db-schema-datasour-de77a6","errorCode":null,"errorMessage":"The ${keyByDataSource('CUBEJS_DB_SCHEMA', dataSource)} is deprecated. Please, use the ${keyByDataSource('CUBEJS_DB_NAME', dataSource)} instead.","messagePattern":"The (.+?) is deprecated\\. Please, use the (.+?) instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cubejs-backend-shared/src/env.ts","lineNumber":600,"sourceCode":"      );\n    }\n    return val;\n  },\n\n  /**\n   * Database name.\n   * @deprecated\n   */\n  dbSchema: ({\n    required,\n    dataSource,\n    preAggregations,\n  }: {\n    dataSource: string,\n    required?: boolean,\n    preAggregations?: boolean,\n  }) => {\n    console.warn(\n      `The ${\n        keyByDataSource('CUBEJS_DB_SCHEMA', dataSource)\n      } is deprecated. Please, use the ${\n        keyByDataSource('CUBEJS_DB_NAME', dataSource)\n      } instead.`\n    );\n    const val = get(keyByDataSource('CUBEJS_DB_SCHEMA', dataSource, preAggregations)).asString();\n    if (required && !val) {\n      throw new Error(\n        `The ${\n          keyByDataSource('CUBEJS_DB_SCHEMA', dataSource)\n        } is required and missing.`\n      );\n    }\n    return val;\n  },\n\n  /**","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-shared/src/env.ts#L582-L618","documentation":"Cube renamed the per-datasource database schema env var CUBEJS_DB_SCHEMA (with datasource suffix variants) to CUBEJS_DB_NAME. When the deprecated var is read, Cube warns and directs users to the replacement while still returning the old value.","triggerScenarios":"A driver/datasource calls env function dbSchema (e.g. from driverConfigToDbDetails or schema requirements) and CUBEJS_DB_SCHEMA or CUBEJS_DB_SCHEMA_<DATA_SOURCE> is present in the environment.","commonSituations":"Old docker-compose/env templates; upgrading Cube where driver configs still reference CUBEJS_DB_SCHEMA; multi-datasource setups with suffixed legacy vars.","solutions":["Rename CUBEJS_DB_SCHEMA to CUBEJS_DB_NAME (and suffixed variants to CUBEJS_DB_NAME_<DATA_SOURCE>) in your environment","Confirm the target driver honors CUBEJS_DB_NAME","Restart Cube after updating env and verify the warning disappears"],"exampleFix":"// before\nCUBEJS_DB_SCHEMA=analytics\n// after\nCUBEJS_DB_NAME=analytics","handlingStrategy":"validation","validationCode":"if (process.env.CUBEJS_DB_SCHEMA) console.warn('Use CUBEJS_DB_NAME instead of deprecated CUBEJS_DB_SCHEMA');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit env files against current Cube env docs on upgrade","Prefer CUBEJS_DB_NAME for new deployments","Treat deprecation warnings as CI failures via log scanning"],"tags":["env","deprecation","config","schema"],"backgroundTag":"deprecated-env-var","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}