Это видео недоступно.
Сожалеем об этом.
Live Queries SurrealDB | Rust Language
HTML-код
- Опубликовано: 27 мар 2024
- In this video I show examples of live queries in Rust using the SurrealDB database and Rust SDK. The live query stream updates the display as a table, record, or range of records are updated, in real time! In the second half of the video I deserialize the Result with a custom print function.
🦀 SurrealDB Rust Playlist
• SurrealDB + Rust Examples
Relate in SurrealDB:
---------------------------------
surrealdb.com/...
Record Links:
----------------------
I may cover record links in a future video, but in the meantime here's an article I wrote about them:
🟩🟥 redandgreen.co...
** New: I've created some slightly more ADVANCED queries and added them to my website, with these you will need to learn and understand "relate" but after a while it starts to feel a bit more intuitive.
take v first
-----------------
.take(0) returns an empty iterator.
.first() returns an Option containing the first element of the vector or None if the vector is empty.
More advanced SurrealDB queries
----------------------------------------------------------
🟩🟥 redandgreen.co...
Previous Article:
---------------------------
🟩🟥 redandgreen.co...
code : gist.github.co...
install SurrealDB
---------------------------
🟩 surrealdb.com/...
start the server
-------------------------
surreal start --log info --user root --pass root file:mydatabase.db
Demo Data
--------------------
🟩 surrealdb.com/...
Useful code example using fetch, with query prepared using format! macro:
-------------------------------------------------------------------------------------------------------------------------
🟩 github.com/sur...
Linux Hosting - VPS server - Webdock
----------------------------------------------------------------
🟩
Webdock Linux Hosting : webdock.io/en?...
🟩
Nostr
---------
@RngWeb
findthatbit@iris.to
findthatbit.info/
redandgreen.co...
#rustlang #SurrealDB #learningrust
This stream seems to run forever. Which can be great but how would you go about conditionally closing the live stream, let’s say closing the stream once it gets to rating 3.
That's interesting question, I think there is a way to do it here : surrealdb.com/docs/surrealdb/integration/websocket#kill
but you need the uuid, so you'd need to get that from a 'result' - "The UUID of the live query to kill" and then end the live query with the scope of the conditional logic that you add, eg "if rating > 3"