{"record":{"id":"6f56e448f2a3b62c","repo":"cube-js/cube","slug":"options-sqlgenerators-must-be-a-function","errorCode":null,"errorMessage":"options.sqlGenerators must be a function","messagePattern":"options\\.sqlGenerators must be a function","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-backend-native/js/index.ts","lineNumber":412,"sourceCode":"\n  if (typeof options.checkSqlAuth !== 'function') {\n    throw new Error('options.checkSqlAuth must be a function');\n  }\n\n  if (typeof options.meta !== 'function') {\n    throw new Error('options.meta must be a function');\n  }\n\n  if (typeof options.stream !== 'function') {\n    throw new Error('options.stream must be a function');\n  }\n\n  if (typeof options.sqlApiLoad !== 'function') {\n    throw new Error('options.sqlApiLoad must be a function');\n  }\n\n  if (typeof options.sqlGenerators !== 'function') {\n    throw new Error('options.sqlGenerators must be a function');\n  }\n\n  if (typeof options.sql !== 'function') {\n    throw new Error('options.sql must be a function');\n  }\n\n  const native = loadNative();\n  return native.registerInterface({\n    ...options,\n    contextToApiScopes: wrapNativeFunctionWithChannelCallback(options.contextToApiScopes),\n    checkAuth: wrapNativeFunctionWithChannelCallback(options.checkAuth),\n    checkSqlAuth: wrapNativeFunctionWithChannelCallback(options.checkSqlAuth),\n    sql: wrapNativeFunctionWithChannelCallback(options.sql),\n    meta: wrapNativeFunctionWithChannelCallback(options.meta),\n    stream: wrapNativeFunctionWithStream(options.stream),\n    sqlApiLoad: wrapNativeFunctionWithStream(options.sqlApiLoad),\n    sqlGenerators: wrapRawNativeFunctionWithChannelCallback(options.sqlGenerators),\n    logLoadEvent: wrapRawNativeFunctionWithChannelCallback(options.logLoadEvent),","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-native/js/index.ts#L394-L430","documentation":"Configuration guard in registerInterface (cubejs-backend-native): fires when options.sqlGenerators is not a function. The native backend uses this callback to obtain SQL generators per data source, so its absence indicates an incomplete SQLInterfaceOptions object at setup time.","triggerScenarios":"Thrown at packages/cubejs-backend-native/js/index.ts:412 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an sqlGenerators function in the registerInterface options.","Check for typos (e.g. sqlGenerator singular) in the options object construction."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}