{"record":{"id":"50eac96b229f625b","repo":"cube-js/cube","slug":"options-sqlapiload-must-be-a-function","errorCode":null,"errorMessage":"options.sqlApiLoad must be a function","messagePattern":"options\\.sqlApiLoad must be a function","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-backend-native/js/index.ts","lineNumber":408,"sourceCode":"\n  if (typeof options.checkAuth !== 'function') {\n    throw new Error('options.checkAuth must be a function');\n  }\n\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),","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-native/js/index.ts#L390-L426","documentation":"Configuration guard in registerInterface (cubejs-backend-native): fires when the options object lacks a `sqlApiLoad` function. The native SQL API bridge requires this callback to load query results, so a missing one means the interface cannot serve SQL load requests.","triggerScenarios":"Thrown at packages/cubejs-backend-native/js/index.ts:408 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide an sqlApiLoad async function in the options passed to registerInterface.","Confirm the wiring code that builds the options object actually assigns sqlApiLoad."],"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"}