surrealdb / surrealist

Surrealist is the ultimate way to visually manage your SurrealDB database
https://surrealist.app/
MIT License
1.03k stars 73 forks source link

SLEEP blocks all responses, including preceding ones #289

Closed fokklz closed 1 month ago

fokklz commented 1 month ago

Describe the bug When using the SLEEP keyword, the responses will not come trough. Even the statements before the SLEEP won't.

To Reproduce Steps to reproduce the behavior:

  1. Create a new empty Query
  2. Insert:
    
    DEFINE TABLE data;

DEFINE FIELD created ON TABLE data TYPE datetime DEFAULT time::now() READONLY; DEFINE FIELD updated ON TABLE data TYPE datetime VALUE time::now() DEFAULT time::now();

UPDATE data:1 SET value = "SOME";

SLEEP 10s;

UPDATE data:1 SET value = "SOME OTHER";

3. Run

**Expected behavior**

Ouput of each query, 10s sleep, output of the last query

**Environment:**

Platform: Desktop OS: Windows_NT Architecture: x86_64 WebView: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 Version: 2.0.6 Flags: featureFlags: false, models_view: true, apidocs_view: true, themes: false, newsfeed: true

macjuul commented 1 month ago

This actually works as intended since Surrealist will only display results once all queries are completed, including SLEEP statements.

fokklz commented 1 month ago

@macjuul would it be possible to add a feedback then that requests are processed or something, as currently there is 0 visual indication something is happening. Should I create a future request for this?

macjuul commented 1 month ago

Fully agree! This is currently being tracked in #258 and something I'd love to implement soon