using SurrealDb.Net;
using SurrealDb.Net.Models.Auth;

namespace RelayServer.Services.Data;

public sealed class SurrealService
{
    public async Task<SurrealDbClient> ConnectAsync()
    {
        var db = new SurrealDbClient("ws://127.0.0.1:8000/rpc");

        await db.SignIn(new RootAuth
        {
            Username = "root",
            Password = "secret"
        });

        await db.Use("test", "test");
        return db;
    }
}