Skip to content

Commit

Permalink
⚗️ Add experimental code
Browse files Browse the repository at this point in the history
  • Loading branch information
czy-29 committed Dec 9, 2024
1 parent b40f2ad commit be09d16
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
3 changes: 3 additions & 0 deletions tracing-surreal/src/bin/gadget.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
25 changes: 25 additions & 0 deletions tracing-surreal/src/bin/kernel.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use est::AnyRes;
use surrealdb::{
engine::remote::ws::{Client, Ws},
opt::auth::Root,
Surreal,
};
use tracing_surreal::stop::Stop;

async fn db() -> AnyRes<Surreal<Client>> {
let db = Surreal::new::<Ws>("localhost:8000").await?;

db.signin(Root {
username: "root",
password: "root",
})
.await?;
db.use_ns("root").await?;
Ok(db)
}

#[tokio::main]
async fn main() -> AnyRes {
Stop::init(db().await?, "test").await?.print().await;
Ok(())
}
26 changes: 2 additions & 24 deletions tracing-surreal/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
use est::AnyRes;
use surrealdb::{
engine::remote::ws::{Client, Ws},
opt::auth::Root,
Surreal,
};
use tracing_surreal::stop::Stop;

async fn db() -> AnyRes<Surreal<Client>> {
let db = Surreal::new::<Ws>("localhost:8000").await?;

db.signin(Root {
username: "root",
password: "root",
})
.await?;
db.use_ns("root").await?;
Ok(db)
}

#[tokio::main]
async fn main() -> AnyRes {
Stop::init(db().await?, "test").await?.print().await;
Ok(())
fn main() {
println!("Hello, world!");
}

0 comments on commit be09d16

Please sign in to comment.