socketioxide icon indicating copy to clipboard operation
socketioxide copied to clipboard

Add support for surrealdb

Open prabirshrestha opened this issue 2 years ago • 3 comments

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.

prabirshrestha avatar Oct 02 '23 04:10 prabirshrestha

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

Totodore avatar Oct 02 '23 04:10 Totodore

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 avatar Oct 02 '23 05:10 prabirshrestha

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

prabirshrestha avatar Nov 13 '23 20:11 prabirshrestha

I don't think we will support this adapter internally. If anyone want to build an external crate. Don't hesitate !

Totodore avatar Jan 01 '25 18:01 Totodore