ProtonDB.Client 1.0.1

dotnet add package ProtonDB.Client --version 1.0.1
                    
NuGet\Install-Package ProtonDB.Client -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ProtonDB.Client" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProtonDB.Client" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="ProtonDB.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ProtonDB.Client --version 1.0.1
                    
#r "nuget: ProtonDB.Client, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ProtonDB.Client@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ProtonDB.Client&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=ProtonDB.Client&version=1.0.1
                    
Install as a Cake Tool

๐Ÿง  ProtonDB.Client

ProtonDB.Client is a lightweight .NET library that allows you to connect and interact with a ProtonDB server using simple query commands โ€” just like working with MySQL or SQLite connectors.

๐Ÿ”Œ Plug it into your apps, CLI tools, or services to send queries and retrieve results from ProtonDB over TCP.


๐Ÿš€ Features

  • Connect to a running ProtonDB server via TCP
  • Send queries, fetch results, and handle errors easily
  • Supports login with privilege-based access
  • Fetch full result sets or individual entries
  • Toggle debug logs
  • Gracefully close connections
  • Easily serializable JSON-based responses

๐Ÿ“ฆ Installation

If published to NuGet:

dotnet add package ProtonDB.Client

Or reference it manually in your project:

<ProjectReference Include="path/to/ProtonDB.Client.csproj" />

๐Ÿ› ๏ธ Usage

using ProtonDB.Client;

var conn = Connection.Connect("127.0.0.1", 9090, "admin", "yourpassword");
var cursor = new Cursor(conn);

// Send a query
cursor.Query("select(name: 'Alice')");

// Fetch all results
var results = cursor.FetchAll();
foreach (var row in results) {
    Console.WriteLine(row);
}

// Fetch one result
var single = cursor.FetchOne();

// Map result to object
var student = cursor.Map<Student>();

// Quit session
cursor.Quit();

๐Ÿ” Authentication

Login is handled via:

Connection.Connect("127.0.0.1", 9090, "username", "password");
  • Credentials are never sent in plain text โ€” only a checksum is verified on the server.
  • Privileges (guest, user, admin) restrict access to certain commands or databases.

๐Ÿงช API Summary

Connection

  • Connect(host, port, username?, password?) โ€” opens session and logs in
  • Reconnect() โ€” reestablishes dropped connection
  • Dispose() โ€” safely closes the session

Cursor

  • Query(string) โ€” submits a query
  • SafeQuery(string) โ€” submits a query and auto-reconnects if disconnected
  • FetchAll() โ†’ string[] โ€” gets all results
  • FetchOne() โ†’ string โ€” gets the first result
  • Map<T>() โ†’ T โ€” deserializes one result to object
  • MapAll<T>() โ†’ T[] โ€” deserializes all results
  • Debug(bool) โ€” enables or disables debug logs
  • Profile() โ€” gets details about the current profile
  • Quit() โ€” clean disconnect

๐Ÿงฉ Requirements


๐Ÿ›ก๏ธ Security Notes

  • No raw SQL or command strings are interpreted by the client.
  • Authentication uses checksum verification with salted hashes.

๐Ÿ“„ License

MIT โ€” free to use, modify, or distribute.


๐Ÿค– Author

Created by Kisetsu (Dharshik)

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 176 6/28/2025
1.0.0 170 6/28/2025