Unable to share chart with long column names
eagletmt opened this issue · 0 comments
eagletmt commented
When I run query with relatively long column names like select * from (values (1, 2), (2, 4)) as t(long_name_column_x, long_name_result)
and share its chart, bdash-server returns 500 because BdashQuery.chart_config column is too short.
Local bdash-server logs:
prisma:query BEGIN
prisma:query INSERT INTO `bdash_server_dev`.`BdashQuery` (`id_hash`,`createdAt`,`updatedAt`,`userId`,`title`,`description`,`query_sql`,`data_source_info`,`chart_svg`,`chart_config`,`result`) VALUES (?,?,?,?,?,?,?,?,?,?,?)
prisma:query ROLLBACK
PrismaClientKnownRequestError2 [PrismaClientKnownRequestError]:
Invalid `prisma.bdashQuery.create()` invocation:
The provided value for the column is too long for the column's type. Column: chart_config
at cb (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/@prisma/client/runtime/index.js:78689:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async postBdashQuery (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/.next/server/pages/api/bdash-query/create.js:244:22)
at async apiResolver (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/next/dist/next-server/server/api-utils.js:8:1)
at async DevServer.handleApiRequest (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/next/dist/next-server/server/next-server.js:64:462)
at async Object.fn (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/next/dist/next-server/server/next-server.js:56:492)
at async Router.execute (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/next/dist/next-server/server/router.js:23:67)
at async DevServer.run (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/next/dist/next-server/server/next-server.js:66:1042)
at async DevServer.handleRequest (/home/eagletmt/.clg/github.com/bdash-app/bdash-server/node_modules/next/dist/next-server/server/next-server.js:34:504) {
code: 'P2000',
clientVersion: '2.17.0',
meta: { column_name: 'chart_config' }
}