Totodore / socketioxide

A socket.io server implementation in Rust that integrates with the Tower ecosystem and the Tokio stack.
https://docs.rs/socketioxide
MIT License
1.27k stars 56 forks source link

Add support for surrealdb #90

Open prabirshrestha opened 1 year ago

prabirshrestha commented 1 year ago

surrealdb is written in rust and can be embedded like sqlite with rocksdb backend or memory backend or can be run in HA with tikv/foundationdb. You can use surrealdb::Surreal<surrealdb::engine::any> to support any backend in surrealdb. It has a concept of live queries via websockets - https://www.youtube.com/watch?v=zEaQBiNbkoU.

-- Subscribe to all matching document changes
LIVE SELECT * FROM document
    WHERE
        account = $auth.account
        OR public = true
;

-- Subscribe to all changes to a single record
LIVE SELECT * FROM post:c569rth77ad48tc6s3ig;

-- Stop receiving change notifications
KILL "1986cc4e-340a-467d-9290-de81583267a2";

Would be great to have a surealdb backend.

Totodore commented 1 year ago

You mean a socket.io adapter working with surrealdb ? It is a good idea but requires issue #5 to be resolved

prabirshrestha commented 1 year ago

Yes socketio adapter working with surrealdb. Ideally it would be good to have only async supported since that is what most of the popular framework supports as is less work for the project.

prabirshrestha commented 1 year ago

FYI: Live query api for SurrealDB got checked in. https://github.com/surrealdb/surrealdb/pull/2919