如何将SQL查询转换为键值命令

huangapple go评论53阅读模式
英文:

How to convert SQL query to key-value command

问题

是否可以使用一些开源项目来帮助解析SQL查询并将其转换为自定义键-值数据库命令(对键执行CRUD操作)?我看到TiDB的架构,似乎它们有一个抽象的层。我会感激任何人指向一些资源来帮助开始这个过程。

我尝试过研究其他项目,似乎大多数项目都将解析层嵌入到其数据库中,因此我无法真正将其解耦并使用它们的解决方案。

英文:

Is it possible to use some opensource project to help parse the sql query and convert it into the custom key-value db command (CRUD on the key). I saw the architecture of the tidb, and it seems like they have an abstracted layer. I would appreciated anyone pointing to some resources to help start the process.

I did try to research other project out there, and it seems like most of them have ad-hoc and embeded the parsing layers into their db, so I cannot really decouple and use their solutions.

答案1

得分: 1

你可以参考这篇博客:https://www.pingcap.com/blog/tidb-internal-computing/

但我认为将代码与 TiDB 分离并不容易。

英文:

You can refer to this blog:https://www.pingcap.com/blog/tidb-internal-computing/

But I don't think it is easy to decouple the code from TiDB.

答案2

得分: 0

你可以使用类似 https://github.com/pingcap/tidb/tree/master/parser 的 SQL 解析器,但接着你需要添加执行实际存储操作的内容。

如果你想要事务,你可能想查看这个:
https://tikv.org/deep-dive/distributed-transaction/percolator/

英文:

You could use an SQL parser like https://github.com/pingcap/tidb/tree/master/parser but then you would have to add something that does the actual storage operations.

If you want transactions you might want to check this:
https://tikv.org/deep-dive/distributed-transaction/percolator/

huangapple
  • 本文由 发表于 2023年2月16日 08:00:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/75466557.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定