using System.Data.Common;
using Npgsql;

namespace KArtSell.BuildingBlocks.Data;

public sealed class NpgsqlConnectionFactory(NpgsqlDataSource dataSource) : IDbConnectionFactory
{
    public async ValueTask<DbConnection> OpenAsync(CancellationToken cancellationToken = default)
        => await dataSource.OpenConnectionAsync(cancellationToken);
}
