Batch INSERT (using array of arrays) results in the application hanging

未关闭
#261 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
领域
database

调研方向

先阅读 executeStatement 如何处理 ordinalParameters,然后使用提供的 INSERT 和 [[1], [2], [3]] 参数复现该问题。完成的标准是,参数化批量 INSERT 不再让应用程序一直挂起;该 issue 未指定文件或测试。

由索引模型根据 Issue 内容生成。

描述

Hey!

I'm trying to parameterise an INSERT statement and feeding executeStatement an array of arrays so that I can batch INSERTs into a table.

However, it seems like instead of working (or failing), the driver never responds and the application just hangs.

Example:

const query = `INSERT INTO test(id) values(?)`.
const params = [[1], [2], [3]];
const session = /* call some code to get a DBX session /* 
const op = session.executeStatement(query, { ordinalParameters: params })
...

If I fully create the INSERT query, INSERT INTO test(id) values (1), (2), (3), it works just fine.

I had a look at how executeStatement handles parameters and it doesn't seem to support arrays of arrays, so I am at loss of how to batch insert with parameterisation.

Env:

  • Running on Node 20.x and version 1.8.4 of the driver.
主要语言
TypeScript
星标
36
派生
50
平均合并
13 小时 46 分钟
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

databricks/databricks-sql-nodejs 的其他 Issue

查看 databricks/databricks-sql-nodejs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。