如何允许用户提交 q 查询并将其解释为字符串?

发布于 2025-01-18 00:41:24 字数 198 浏览 1 评论 0原文

我希望允许用户编写真正的 q 查询,例如

select from table where date=.zd

是否可以使用类似

E)select from table where date=.zd

然后使用该 E) 的输入来解析查询并对其进行处理?

I want to allow users to write real q queries like

select from table where date=.z.d

Is it possible to use something like

E)select from table where date=.z.d

and then use the input to that E) to parse the query and do stuff with it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2025-01-25 00:41:24

如果您创建一个名为 .Ee 的函数,则传递给它的任何内容都将被解释为字符串,因此您可以执行以下操作来开始解析您的输入:

q).E.e: {" " vs x}
q)E)select from table where date = .z.d
"select"
"from"
"table"
"where"
"date"
,"="
".z.d"

If you create a function called .E.e, anything you pass to it will be interpreted as a string, so you can do something like this to start parsing your input:

q).E.e: {" " vs x}
q)E)select from table where date = .z.d
"select"
"from"
"table"
"where"
"date"
,"="
".z.d"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文