Skip to content

Add internal kernel API /api/sqlite/flushTransaction #10005

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

Closed
IAliceBobI opened this issue Dec 28, 2023 · 2 comments
Closed

Add internal kernel API /api/sqlite/flushTransaction #10005

IAliceBobI opened this issue Dec 28, 2023 · 2 comments
Assignees
Milestone

Comments

@IAliceBobI
Copy link

IAliceBobI commented Dec 28, 2023

希望加一个API,等待当前所有DB任务都写盘后才返回。

希望加一个API,等待当前所有DB任务都写盘后才返回。

In what scenarios do you need this feature?

有没有可能加一个flash db的API。等待所有pending的任务都给刷盘了。
有时候调用一些API后,虽然成功了,但db里是没有相关数据的。
插件中只能等待,或者间隔地循环尝试。插件引入这种设计,比较难维护。

另外,前端是否也能提供一个接口,等待编辑器里面的事务,也发送到后端。
有时我在编辑器写入内容,到内容出现在db,这个时间不好把握。

如果前端后端都有flash 接口,那就能准确地知道,何时查db,能查到刚刚写入的数据。

Describe the optimal solution

如果加入一个flushdb类似的api.
插件中可以这样用:
await createDoc()
await flushDB()
await queryDB()

Describe the candidate solution

No response

Other information

No response

@88250
Copy link
Member

88250 commented Dec 28, 2023 via email

@IAliceBobI
Copy link
Author

@88250 也行,只是我目前不知道怎么搞。后续我再研究吧。先加内核的。谢谢!

@88250 88250 self-assigned this Dec 28, 2023
@88250 88250 changed the title 希望加一个API,等待当前所有DB任务都写盘后才返回。 Add internal kernel API /api/sqlite/flushTransaction Dec 28, 2023
@88250 88250 added this to the 2.12.0 milestone Dec 28, 2023
88250 added a commit that referenced this issue Dec 28, 2023

Verified

This commit was signed with the committer’s verified signature.
@88250 88250 closed this as completed Dec 28, 2023
@88250 88250 mentioned this issue May 16, 2024
3 tasks
88250 added a commit that referenced this issue Nov 19, 2024

Verified

This commit was signed with the committer’s verified signature.
EightDoor added a commit to EightDoor/siyuan that referenced this issue Nov 22, 2024
* commit '928c1d476a4b398bdee3752cc950aed85838bf8f': (148 commits)
  🔖 Release v3.1.13
  🐛 Automatic cleanup of the local data repo may accidentally delete snapshots siyuan-note#13203
  🎨 Add internal kernel API `/api/sqlite/flushTransaction` siyuan-note#10005
  🐛 Automatic cleanup of the local data repo may accidentally delete snapshots siyuan-note#13203
  🎨 删除块,嵌入块中没有同步删除
  💄
  🔖 Release v3.1.12
  ⬆️ eslint
  🎨 Improve graph rendering siyuan-note#13196
  🎨 siyuan-note#13143
  🎨 siyuan-note#13190
  📝 Update changelogs
  ⬆️
  🎨 Improve av option editing siyuan-note#11484
  🎨 siyuan-note#13164
  🎨 Support HarmonyOS NEXT system siyuan-note#13184
  🎨 siyuan-note#11053
  🚨
  🎨 siyuan-note#11053
  🎨 Support HarmonyOS NEXT system siyuan-note#13184
  ...
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