You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let created:Vec<Option<Channel>> = db
.create("channel").content(Channel{id:None,username: username.to_string(),follower_list:vec![],banned_list:vec![],followed_list:vec![],banned_from_list:vec![],}).await.unwrap();
Here is how I search channel record:
let searced:Option<Channel> = db.select(("channel", id.clone())).await.unwrap();
I also want to make username unique and searchable by search query. How can I do this ?
I maybe build structure wrong, please correct me. I wanted to make id defined by database and make it primary key, and username as a unique key.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm new on SurrealDB, it's a naive question, but I couldn't find how to.
Here is my
Channel
struct:Here is how I create a
channel
record:Here is how I search
channel
record:I also want to make username unique and searchable by search query. How can I do this ?
I maybe build structure wrong, please correct me. I wanted to make id defined by database and make it primary key, and username as a unique key.
Beta Was this translation helpful? Give feedback.
All reactions