You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the driver_factory documentation, when using JavaScript, there are examples for returning a driver config object ({ type: "duckdb" }) and an instance of a Custom Driver (class that extends BaseDriver).
However, I'm getting an error with the option configured to return both formats:
From the TypeScript definition this should be OK, but this is the error that happens during schema compilation:
Compiling schema error: e25ceb53-6fa6-4128-bdc9-a0cc1d92728c-span-1 (289ms)
{
"version": "default_schema_version_69b10a3ae4ba76ea6144b864e4d001d1"
}
Error: CreateOptions.driverFactory function must return either BaseDriver or DriverConfig.
at OptsHandler.assertDriverFactoryResult (/cube/node_modules/@cubejs-backend/server-core/src/core/OptsHandler.ts:146:15)
at /cube/node_modules/@cubejs-backend/server-core/src/core/OptsHandler.ts:225:21
at CubejsServerCore.contextToDbType (/cube/node_modules/@cubejs-backend/server-core/src/core/OptsHandler.ts:246:17)
at CompilerApi.dbType (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:499:28)
If instead I return a driver instance, no error is shown:
Thanks for posting! It looks like the error message has pointed you in the right direction and you were able to configure what you want. What is the question here?
Well, from the from typescript I understood that driver_factory could return class instances and config objects.
However, from the tests it seems it can only return one or the other, not both formats.
So the question is basically if this is the intended behaviour.
And if so, I'm not sure if CubejsServerCore.createDriver is the correct way to create the non-custom driver instances (to be equivalent to the other format, returning the config objects).
Problem
From the
driver_factory
documentation, when using JavaScript, there are examples for returning a driver config object ({ type: "duckdb" }
) and an instance of a Custom Driver (class that extendsBaseDriver
).However, I'm getting an error with the option configured to return both formats:
From the TypeScript definition this should be OK, but this is the error that happens during schema compilation:
If instead I return a driver instance, no error is shown:
The text was updated successfully, but these errors were encountered: