Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SQL query template function querySQL #13455

Closed
TCOTC opened this issue Dec 13, 2024 · 6 comments
Closed

Add SQL query template function querySQL #13455

TCOTC opened this issue Dec 13, 2024 · 6 comments
Assignees
Milestone

Comments

@TCOTC
Copy link
Contributor

TCOTC commented Dec 13, 2024

增加 querySQL 模板函数

需要查 refs 表

image

@88250
Copy link
Member

88250 commented Dec 13, 2024

要不直接加个 querySQL 吧,更通用点。

@TCOTC
Copy link
Contributor Author

TCOTC commented Dec 13, 2024

所有表都能查吗?

@88250
Copy link
Member

88250 commented Dec 13, 2024

对,和那个内核 sql 接口差不多

@TCOTC
Copy link
Contributor Author

TCOTC commented Dec 13, 2024

那就加这个吧

@88250 88250 changed the title 增加 queryRefs 模板函数 增加 querySQL 模板函数 Dec 13, 2024
@88250 88250 changed the title 增加 querySQL 模板函数 Add SQL query template function querySQL Dec 13, 2024
@88250 88250 closed this as completed Dec 13, 2024
@88250 88250 self-assigned this Dec 13, 2024
@88250 88250 added this to the 3.1.16 milestone Dec 13, 2024
@TCOTC
Copy link
Contributor Author

TCOTC commented Dec 26, 2024

这个会报错:模板解析失败:template: :1:8: executing "" at : wrong number of args for querySQL: want 1 got 2 v3.1.17

 .action{querySQL "SELECT * FROM spans LIMIT ?" "3"}

@88250
Copy link
Member

88250 commented Dec 26, 2024

这个不支持预编译 SQL,只能把参数拼进去。

mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants