### Complete Configuration Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/configuration.md A comprehensive example demonstrating how to configure the immudb4net client for a production environment, including server details, credentials, database, state holder, security, and connectivity settings. ```csharp using ImmuDB; using System; var client = ImmuClient.NewBuilder() // Server connection .WithServerUrl("immudb.example.com") .WithServerPort(3322) // Authentication .WithCredentials("production_user", "secure_password") // Database .WithDatabase("production_db") // State management .WithStateHolder(FileImmuStateHolder.NewBuilder() .WithStatesFolder("/var/lib/myapp/immudb_states") .Build()) .CheckDeploymentInfo(true) // Security .WithServerSigningKey("/etc/myapp/immudb_public_key.pem") // Connectivity .WithHeartbeatInterval(TimeSpan.FromSeconds(30)) .WithConnectionShutdownTimeout(TimeSpan.FromSeconds(5)) // Build and connect .Build(); try { await client.Open("production_user", "secure_password", "production_db"); // Use client var entry = await client.Get("mykey"); } finally { await client.Close(); } ``` -------------------------------- ### Full Usage Example: Managing Users in immudb Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md A comprehensive example demonstrating the creation of an immudb client, database creation, user creation with different permissions, listing users, displaying user details, and changing a user's password. ```csharp using ImmuDB; using ImmuDB.Iam; using System; using System.Collections.Generic; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Create database first await client.CreateDatabase("appdb"); // Create users with different permissions await client.CreateUser("alice", "alice_password", Permission.PERMISSION_RW, "appdb"); await client.CreateUser("bob", "bob_password", Permission.PERMISSION_R, "appdb"); await client.CreateUser("charlie", "charlie_password", Permission.PERMISSION_ADMIN, "appdb"); // List all users var users = await client.ListUsers(); Console.WriteLine("Registered Users:"); foreach (var user in users) { Console.WriteLine($"\nUser: {user.Name}"); Console.WriteLine($" Active: {user.Active}"); if (!string.IsNullOrEmpty(user.CreatedAt)) { Console.WriteLine($" Created At: {user.CreatedAt}"); } if (!string.IsNullOrEmpty(user.CreatedBy)) { Console.WriteLine($" Created By: {user.CreatedBy}"); } if (user.Permissions.Count > 0) { Console.WriteLine(" Permissions:"); foreach (var perm in user.Permissions) { Console.WriteLine($" - {perm}"); } } } // Find a specific user var aliceUser = users.Find(u => u.Name == "alice"); if (aliceUser != null) { Console.WriteLine($"\nFound user: {aliceUser.Name}"); Console.WriteLine($" Full details: {aliceUser.ToString()}"); } // Change password for a user await client.ChangePassword("alice", "alice_password", "new_alice_password"); Console.WriteLine("\nPassword changed for alice"); await client.Close(); ``` -------------------------------- ### Full SQL Query and Data Handling Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/SQLQueryResult.md A comprehensive example demonstrating connecting to immudb, creating a table, inserting data, executing a query, and processing the results, including column and row data access with type checking. ```csharp using ImmuDB; using ImmuDB.SQL; using System; using System.Data; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Create and populate table await client.SQLExec("CREATE TABLE IF NOT EXISTS employees(id INTEGER AUTO_INCREMENT, name VARCHAR, salary INTEGER, hired_date TIMESTAMP, PRIMARY KEY id)"); await client.SQLExec( "INSERT INTO employees(name, salary, hired_date) VALUES($1, $2, $3)", SQLParameter.Create("Alice", "name"), SQLParameter.Create(50000, "salary"), SQLParameter.Create(new DateTime(2020, 1, 15), "hired_date") ); await client.SQLExec( "INSERT INTO employees(name, salary, hired_date) VALUES($1, $2, $3)", SQLParameter.Create("Bob", "name"), SQLParameter.Create(60000, "salary"), SQLParameter.Create(new DateTime(2019, 6, 1), "hired_date") ); // Query results var result = await client.SQLQuery("SELECT id, name, salary, hired_date FROM employees WHERE salary > $1", SQLParameter.Create(45000, "min_salary") ); // Display column info Console.WriteLine("Columns:"); foreach (var column in result.Columns) { Console.WriteLine($" {column.Name}: {column.Type}"); } // Display data Console.WriteLine("\nData:"); foreach (var row in result.Rows) { var id = row["id"].Value; var name = row["name"].Value; var salary = row["salary"].Value; var hiredDate = row["hired_date"].Value; Console.WriteLine($" ID {id}: {name} - ${salary} (Hired: {hiredDate})"); } // Access specific values with type checking foreach (var row in result.Rows) { var nameValue = row["name"]; if (nameValue.ValueType == SqlDbType.NVarChar) { Console.WriteLine($"String value: {nameValue.Value}"); } var salaryValue = row["salary"]; if (salaryValue.ValueType == SqlDbType.BigInt) { var amount = (long)salaryValue.Value; Console.WriteLine($"Salary: {amount}"); } } await client.Close(); ``` -------------------------------- ### Create User with Read-Write Permissions Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/types.md Example demonstrating how to create a user with read-write permissions using the immudb client. ```csharp await client.CreateUser("alice", "pwd", Permission.PERMISSION_RW, "mydb"); ``` -------------------------------- ### Full immudb .NET Client Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/SQLExecResult.md A comprehensive example demonstrating table creation, insertion, update, and deletion using the immudb .NET client, including transaction verification. ```csharp using ImmuDB; using ImmuDB.SQL; using System; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Create table var createResult = await client.SQLExec("CREATE TABLE IF NOT EXISTS products(id INTEGER AUTO_INCREMENT, name VARCHAR, price INTEGER, PRIMARY KEY id)"); Console.WriteLine($"Table created in Tx: {createResult.Items[0].TxID}"); // Insert multiple rows var insertResult = await client.SQLExec( "INSERT INTO products(name, price) VALUES($1, $2)", SQLParameter.Create("Laptop", "name"), SQLParameter.Create(1000, "price") ); Console.WriteLine($"Insert Tx ID: {insertResult.Items[0].TxID}"); Console.WriteLine($"Rows inserted: {insertResult.Items[0].UpdatedRowsCount}"); // Update rows var updateResult = await client.SQLExec( "UPDATE products SET price = $1 WHERE name = $2", SQLParameter.Create(950, "new_price"), SQLParameter.Create("Laptop", "name") ); Console.WriteLine($"Update Tx ID: {updateResult.Items[0].TxID}"); Console.WriteLine($"Rows updated: {updateResult.Items[0].UpdatedRowsCount}"); // Delete rows var deleteResult = await client.SQLExec( "DELETE FROM products WHERE price < $1", SQLParameter.Create(100, "min_price") ); Console.WriteLine($"Delete Tx ID: {deleteResult.Items[0].TxID}"); Console.WriteLine($"Rows deleted: {deleteResult.Items[0].UpdatedRowsCount}"); // Transaction info can be used to verify the operation var tx = await client.TxById(insertResult.Items[0].TxID); Console.WriteLine($"Verified transaction {tx.Header.Id} with {tx.Header.NEntries} entries"); await client.Close(); ``` -------------------------------- ### Example: Creating a User Instance Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Demonstrates how to create a new User object with a given name. ```csharp var user = new User("alice"); ``` -------------------------------- ### Example: Creating a User with Permissions Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Demonstrates how to create a new User object with a name and a list of permissions. ```csharp var permissions = new List { Permission.PERMISSION_RW }; var user = new User("bob", permissions); ``` -------------------------------- ### Example: Displaying User Creation Timestamp Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Shows how to print the creation timestamp of a user. ```csharp Console.WriteLine($"Created at: {user.CreatedAt}"); ``` -------------------------------- ### ImmuDB Sorted Set Operations Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ZEntry.md Demonstrates adding entries to a sorted set using ZAdd, scanning entries with ZScan, and verifying additions with VerifiedZAdd. This example covers common sorted set interactions. ```csharp using ImmuDB; using System; using System.Collections.Generic; using System.Text; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Add some scored entries to a sorted set await client.ZAdd("leaderboard", "player1", 1000.5); await client.ZAdd("leaderboard", "player2", 950.3); await client.ZAdd("leaderboard", "player3", 1050.2); // Scan the sorted set in descending order var entries = await client.ZScan("leaderboard", 100, true); Console.WriteLine("Top Players:"); foreach (var zEntry in entries) { var playerName = Encoding.UTF8.GetString(zEntry.Key); Console.WriteLine($" {playerName}: {zEntry.Score} points"); Console.WriteLine($" Value: {zEntry.Entry.ToString()}"); } // Verify a sorted set entry var verified = await client.VerifiedZAdd("leaderboard", "player4", 900.0); Console.WriteLine($"Added with verification in Tx: {verified.Id}"); await client.Close(); ``` -------------------------------- ### Example: Printing User Details Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Shows how to print the string representation of a User object. ```csharp Console.WriteLine(user.ToString()); // Output: User{user='alice', createdAt='2023-01-01', createdBy='immudb', active=True, permissions=[...]} ``` -------------------------------- ### Example: Checking User Activity Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Demonstrates how to check the Active status of a user. ```csharp if (user.Active) { Console.WriteLine("User is active"); } ``` -------------------------------- ### Example: Listing and Displaying Users Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Demonstrates how to list all users and iterate through their properties like Name, Active status, CreatedAt, CreatedBy, and Permissions. ```csharp var users = await client.ListUsers(); foreach (var user in users) { Console.WriteLine($"User: {user.Name}"); } ``` -------------------------------- ### Example: Iterating Through User Permissions Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Shows how to iterate through the Permissions list of a specific user. ```csharp var user = users[0]; foreach (var permission in user.Permissions) { Console.WriteLine($" Permission: {permission}"); } ``` -------------------------------- ### Example: Displaying User Creator Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Shows how to print the username of the user who created the current user. ```csharp Console.WriteLine($"Created by: {user.CreatedBy}"); ``` -------------------------------- ### ImmuState Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuState.md Demonstrates connecting to an immudb server, retrieving the client's state, and verifying its signature. ```csharp using ImmuDB; using System; var client = ImmuClient.NewBuilder() .WithServerUrl("localhost") .WithServerPort(3322) .WithServerSigningKey("/path/to/server_public_key.pem") .Build(); await client.Open("immudb", "immudb", "defaultdb"); // Get local cached state var state = client.State; Console.WriteLine($"Database: {state.Database}"); Console.WriteLine($"Transaction ID: {state.TxId}"); Console.WriteLine($"Hash: {Convert.ToHexString(state.TxHash)}"); // Get server state directly var serverState = client.ServerCurrentState; // Verify signature (automatic during property access) if (serverState.CheckSignature(null)) { Console.WriteLine("State is authentic"); } await client.Close(); ``` -------------------------------- ### Quick Start: Automatic Connection Configuration Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/configuration.md Configuration that automatically opens the connection after building the client. Useful for immediate use. ```csharp var client = await ImmuClient.NewBuilder() .WithServerUrl("localhost") .WithServerPort(3322) .WithCredentials("immudb", "immudb") .WithDatabase("defaultdb") .Open(); try { // Use client (already connected) var entry = await client.Get("mykey"); } finally { await client.Close(); } ``` -------------------------------- ### Full ImmuClient Configuration and Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Demonstrates a comprehensive configuration of ImmuClientBuilder, including server URL, port, credentials, database, heartbeat interval, shutdown timeout, and deployment info check, followed by opening the connection and performing a client operation. ```csharp var client = ImmuClient.NewBuilder() .WithServerUrl("immudb.example.com") .WithServerPort(3322) .WithCredentials("myuser", "mypassword") .WithDatabase("mydb") .WithHeartbeatInterval(TimeSpan.FromMinutes(2)) .WithConnectionShutdownTimeout(TimeSpan.FromSeconds(5)) .CheckDeploymentInfo(true) .Build(); try { await client.Open("myuser", "mypassword", "mydb"); // Use client var entry = await client.Get("mykey"); Console.WriteLine(entry.ToString()); } finally { await client.Close(); } ``` -------------------------------- ### Deployment Verification Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/FileImmuStateHolder.md Configures an ImmuClient with deployment verification enabled and demonstrates handling successful verification or failure due to server mismatch or corrupted state. ```csharp using ImmuDB; var stateHolder = FileImmuStateHolder.NewBuilder() .WithStatesFolder("./states") .Build(); var client = ImmuClient.NewBuilder() .WithStateHolder(stateHolder) .CheckDeploymentInfo(true) // Verify server on connect .Build(); try { await client.Open("immudb", "immudb", "defaultdb"); Console.WriteLine("Server verified successfully"); } catch (Exception ex) { Console.WriteLine("Server deployment verification failed"); // Different server or corrupted state } ``` -------------------------------- ### State File Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/FileImmuStateHolder.md A typical state file contains database name, transaction ID, transaction hash, and signature. ```json { "database": "defaultdb", "txId": 1000, "txHash": "abc123...", "signature": "def456..." } ``` -------------------------------- ### GlobalSettings Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets the process-wide SDK settings that apply globally across all client instances. ```APIDOC ## GlobalSettings ### Description Gets process-wide SDK settings. ### Type `LibraryWideSettings` ### Example ```csharp var settings = ImmuClient.GlobalSettings; ``` ``` -------------------------------- ### Full Entry Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/Entry.md Demonstrates the complete lifecycle of storing, retrieving, and accessing properties of an entry using ImmuClient. ```csharp using ImmuDB; using System; using System.Text; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Store a value await client.Set("user:1", "Alice"); // Retrieve the entry var entry = await client.Get("user:1"); // Access properties Console.WriteLine($"Key: {Encoding.UTF8.GetString(entry.Key)}"); Console.WriteLine($"Value: {entry.ToString()}"); Console.WriteLine($"Transaction ID: {entry.Tx}"); // Check metadata if (entry.Metadata != null) { Console.WriteLine($"Is deleted: {entry.Metadata.Deleted}"); Console.WriteLine($"Has expiration: {entry.Metadata.HasExpirationTime}"); if (entry.Metadata.HasExpirationTime) { Console.WriteLine($"Expires at: {entry.Metadata.ExpirationTime}"); } } await client.Close(); ``` -------------------------------- ### Quick Start: Local Development Configuration Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/configuration.md A minimal configuration for connecting to a local immudb instance. Assumes default credentials and database. ```csharp var client = ImmuClient.NewBuilder().Build(); await client.Open("immudb", "immudb", "defaultdb"); ``` -------------------------------- ### Handle Key Not Found and Create Default Entry Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/errors.md This example shows how to catch a `KeyNotFoundException` and subsequently create a default entry for the key. This is useful for scenarios where a key might not exist initially. ```csharp try { var entry = await client.Get("key"); } catch (KeyNotFoundException) { logger.Info("Key not found, creating default entry"); await client.Set("key", "default_value"); } ``` -------------------------------- ### Create and Open ImmuClient Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Creates an ImmuClient instance and immediately opens a connection using the configured credentials. This is a convenient method for starting a connected client. ```csharp public async Task Open() ``` ```csharp var client = await ImmuClient.NewBuilder() .WithServerUrl("localhost") .WithServerPort(3322) .WithCredentials("immudb", "immudb") .WithDatabase("defaultdb") .Open(); ``` -------------------------------- ### Quick Start: Secure Production Configuration Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/configuration.md Configuration for a secure production environment, including server details, credentials loaded from environment variables, state holder, and server signing key. ```csharp var client = ImmuClient.NewBuilder() .WithServerUrl("immudb.prod.internal") .WithServerPort(3322) .WithCredentials("svc_account", Environment.GetEnvironmentVariable("IMMUDB_PASSWORD")) .WithDatabase("production") .WithStateHolder(FileImmuStateHolder.NewBuilder() .WithStatesFolder("/var/lib/immudb_state") .Build()) .CheckDeploymentInfo(true) .WithServerSigningKey("/etc/immudb/public_key.pem") .WithHeartbeatInterval(TimeSpan.FromSeconds(30)) .Build(); try { await client.Open("svc_account", Environment.GetEnvironmentVariable("IMMUDB_PASSWORD"), "production"); // Use client } finally { await client.Close(); } ``` -------------------------------- ### Batch SetAll and Get Operations with KVPairs Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/KVPair.md Demonstrates a complete workflow: connecting to immudb, creating a list of KVPairs, atomically setting them using SetAll, and then retrieving each value. Includes error handling for corrupted data. ```csharp using ImmuDB; using System; using System.Collections.Generic; using System.Text; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Create multiple key-value pairs var pairs = new List { new KVPair("user:1", Encoding.UTF8.GetBytes("Alice")), new KVPair("user:2", Encoding.UTF8.GetBytes("Bob")), new KVPair("user:3", Encoding.UTF8.GetBytes("Charlie")), new KVPair("user:4", Encoding.UTF8.GetBytes("Diana")) }; // Set all atomically try { var txHeader = await client.SetAll(pairs); Console.WriteLine($"All entries set in transaction {txHeader.Id}"); } catch (CorruptedDataException ex) { Console.WriteLine($"Error: {ex.Message}"); } // Retrieve the values foreach (var pair in pairs) { var keyStr = Encoding.UTF8.GetString(pair.Key); var entry = await client.Get(keyStr); Console.WriteLine($"{keyStr}: {entry.ToString()}"); } await client.Close(); ``` -------------------------------- ### Full TxHeader Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Demonstrates setting a value, retrieving transaction header information, and performing cryptographic operations using TxHeader properties and methods. ```csharp using ImmuDB; using System; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Set a value and get transaction info var txHeader = await client.Set("user:1", "Alice"); // Access transaction properties Console.WriteLine($"Tx ID: {txHeader.Id}"); Console.WriteLine($"Version: {txHeader.Version}"); Console.WriteLine($"Entries: {txHeader.NEntries}"); // Convert timestamp var utcTime = DateTimeOffset.FromUnixTimeSeconds(txHeader.Ts / 1_000_000).DateTime; Console.WriteLine($"Timestamp: {utcTime:u}"); // Get Alh for verification var alh = txHeader.Alh(); Console.WriteLine($"Alh: {Convert.ToHexString(alh)}"); await client.Close(); ``` -------------------------------- ### Quick Start: Remote Server Configuration Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/configuration.md Configuration for connecting to a remote immudb server, specifying the server URL, credentials, and database. ```csharp var client = ImmuClient.NewBuilder() .WithServerUrl("immudb-prod.mycompany.com") .WithCredentials("app_user", "app_password") .WithDatabase("appdb") .Build(); await client.Open("app_user", "app_password", "appdb"); ``` -------------------------------- ### Full Transaction Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/Tx.md Demonstrates how to connect to immudb, retrieve a transaction by ID, access its header and entries, and perform a verified transaction lookup. ```csharp using ImmuDB; using System; using System.Collections.Generic; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Get a transaction by ID var tx = await client.TxById(5); // Access transaction header Console.WriteLine($"Transaction ID: {tx.Header.Id}"); Console.WriteLine($"Version: {tx.Header.Version}"); Console.WriteLine($"Entry count: {tx.Header.NEntries}"); // Iterate entries Console.WriteLine($"Total entries in tx: {tx.Entries.Count}"); foreach (var entry in tx.Entries) { Console.WriteLine($" Key: {entry.Key}"); } // Get verified transaction with proof try { var verifiedTx = await client.VerifiedTxById(5); Console.WriteLine("Transaction verified successfully"); } catch (VerificationException ex) { Console.WriteLine($"Verification failed: {ex.Message}"); } await client.Close(); ``` -------------------------------- ### Using Dedicated State Folders Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/FileImmuStateHolder.md Best practice for managing states across different environments by using dedicated state folders. This example shows how to dynamically set the states folder path. ```csharp var stateFolder = Environment.GetEnvironmentVariable("IMMUDB_STATE_FOLDER") ?? "~/.immudb/states"; ``` -------------------------------- ### SQL Parameter Usage Example Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/SQLParameter.md Demonstrates how to use SQLParameter with ImmuClient for inserting and querying data. Ensure you have connected to the immudb instance before executing these operations. ```csharp using ImmuDB.SQL; using System; var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); // Create table await client.SQLExec("CREATE TABLE IF NOT EXISTS users(id INTEGER AUTO_INCREMENT, name VARCHAR, age INTEGER, created_at TIMESTAMP, PRIMARY KEY id)"); // Insert with parameters var result = await client.SQLExec( "INSERT INTO users(name, age, created_at) VALUES($1, $2, $3)", SQLParameter.Create("Alice", "name"), SQLParameter.Create(30, "age"), SQLParameter.Create(DateTime.UtcNow, "created_at") ); Console.WriteLine($"Inserted {result.Items[0].UpdatedRowsCount} rows"); // Query with parameters var queryResult = await client.SQLQuery( "SELECT id, name, age FROM users WHERE age > $1", SQLParameter.Create(25, "min_age") ); foreach (var row in queryResult.Rows) { Console.WriteLine($"Name: {row["name"].Value}, Age: {row["age"].Value}"); } await client.Close(); ``` -------------------------------- ### Get Entry by Key and Revision Number Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Retrieves the value at a specific revision number of a key. ```csharp public async Task GetAtRevision(string key, long rev) ``` ```csharp var entry = await client.GetAtRevision("mykey", 2); ``` -------------------------------- ### Configuring Multiple Application Instances Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/FileImmuStateHolder.md When running multiple instances of an application, use different state folders for each instance to maintain independent states. This example appends an application ID to the state folder path. ```csharp var appId = Environment.GetEnvironmentVariable("APP_ID") ?? "app1"; var holder = FileImmuStateHolder.NewBuilder() .WithStatesFolder($"./states/{appId}") .Build(); ``` -------------------------------- ### Entry Methods Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/Entry.md Provides methods to convert the entry to a string, get its encoded key, and compute its digest. ```APIDOC ## Entry Methods ### ToString() Returns the entry value as a UTF-8 decoded string. **Returns:** `string` — Value decoded as UTF-8 (empty string if no value) ### GetEncodedKey() Gets the encoded key with appropriate prefix for internal use. **Returns:** `byte[]` — Encoded key **Note:** For internal cryptographic operations ### DigestFor(int) Computes the digest/hash for a specific transaction version. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | version | int | Yes | Transaction version | **Returns:** `byte[]` — Digest bytes **Note:** Used internally for verification ``` -------------------------------- ### Run Immudb Docker Container Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Starts a detached Docker container for immudb, mapping port 3322. Ensure Docker is installed and running. ```bash docker run -d --name immudb -p 3322:3322 codenotary/immudb:latest ``` -------------------------------- ### Verified Get Entry by Key and Revision Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Retrieves a key with verification at a specific revision. Throws VerificationException if verification fails. ```csharp public async Task VerifiedGetAtRevision(string key, long rev) ``` ```csharp var entry = await client.VerifiedGetAtRevision("mykey", 2); ``` -------------------------------- ### Scan(string) Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Scans all keys that start with a given prefix. This is useful for retrieving multiple related keys efficiently. ```APIDOC ## Scan(string) ### Description Scans all keys with a given prefix. ### Method Not specified (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **prefix** (string) - Yes - Key prefix to match ### Returns `Task>` — List of matching entries ### Example ```csharp var entries = await client.Scan("user:"); ``` ``` -------------------------------- ### Configure Database Name Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Set the default database to be used with the ImmuClient instance via WithDatabase. This is helpful for multi-database setups. ```csharp builder.WithDatabase("myapp") ``` -------------------------------- ### Configure and Connect ImmuClient Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Shows how to build and configure an ImmuClient instance with server details, credentials, and database settings. It then opens the connection to the immudb server. ```csharp var client = ImmuClient.NewBuilder() .WithServerUrl("immudb.example.com") .WithServerPort(3322) .WithCredentials("user", "password") .WithDatabase("mydb") .WithHeartbeatInterval(TimeSpan.FromSeconds(30)) .Build(); await client.Open("user", "password", "mydb"); ``` -------------------------------- ### Verified Get Entry by Key Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Retrieves a key with cryptographic verification of authenticity, validating proof against local state. Throws VerificationException if verification fails. ```csharp public async Task VerifiedGet(string key) ``` ```csharp try { var entry = await client.VerifiedGet("mykey"); Console.WriteLine("Entry is authentic: " + entry.ToString()); } catch (VerificationException ex) { Console.WriteLine("Data tampering detected: " + ex.Message); } ``` -------------------------------- ### IdleConnectionCheckInterval Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets or sets the interval at which idle connections are checked. ```APIDOC ## IdleConnectionCheckInterval ### Description Gets or sets the interval for checking idle connections. ### Type `TimeSpan` ### Example ```csharp client.IdleConnectionCheckInterval = TimeSpan.FromMinutes(1); ``` ``` -------------------------------- ### Open Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Creates an ImmuClient and immediately opens a connection using configured credentials. Throws an exception if connection or authentication fails. ```APIDOC ## Open ### Description Creates an ImmuClient and immediately opens a connection using configured credentials. ### Method Signature ```csharp public async Task Open() ``` ### Returns `Task` — Connected client instance ### Throws `RpcException` — If connection or authentication fails ### Example ```csharp var client = await ImmuClient.NewBuilder() .WithServerUrl("localhost") .WithServerPort(3322) .WithCredentials("immudb", "immudb") .WithDatabase("defaultdb") .Open(); ``` ``` -------------------------------- ### Get Username Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Access the Name property to retrieve the username. ```csharp public string Name { get; } ``` -------------------------------- ### ConnectionShutdownTimeout Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets or sets the timeout duration for shutting down client connections. ```APIDOC ## ConnectionShutdownTimeout ### Description Gets or sets the timeout for connection shutdown. ### Type `TimeSpan` (default: 2 seconds) ### Example ```csharp client.ConnectionShutdownTimeout = TimeSpan.FromSeconds(5); ``` ``` -------------------------------- ### Get SQLParameter Value Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/SQLParameter.md Shows how to retrieve the 'Value' property of a SQLParameter. ```csharp var param = new SQLParameter("Alice"); Console.WriteLine($"Value: {param.Value}"); ``` -------------------------------- ### Get Transaction Version Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Access the transaction version. This property is read-only. ```csharp public int Version { get; } ``` ```csharp var txHeader = await client.Set("key", "value"); Console.WriteLine($"Version: {txHeader.Version}"); ``` -------------------------------- ### Standard Key-Value Set and Get Source: https://github.com/codenotary/immudb4net/blob/main/Readme.md Performs standard read and write operations without cryptographic verification. Useful when validations can be deferred. ```C# await client.Set("k123", "v123"); string v = await client.Get("k123").ToString(); or await client.Set("k123", new byte[]{1, 2, 3}); byte[] v = await client.Get("k123").Value; ``` -------------------------------- ### ServerCurrentState Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets the current server state without relying on local caching. ```APIDOC ## ServerCurrentState ### Description Gets the current server state without local caching. ### Type `ImmuState` ### Example ```csharp var serverState = client.ServerCurrentState; ``` ``` -------------------------------- ### Get Transaction ID Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Retrieve the unique identifier for the transaction. This property is read-only. ```csharp public ulong Id { get; } ``` ```csharp var txHeader = await client.Set("key", "value"); Console.WriteLine($"Transaction ID: {txHeader.Id}"); ``` -------------------------------- ### Execute SQL Statements and Queries Source: https://github.com/codenotary/immudb4net/blob/main/Readme.md Demonstrates executing SQL commands like CREATE TABLE, CREATE INDEX, INSERT, and SELECT using SQLExec and SQLQuery. Includes parameter binding for inserts. ```C# var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); await client.SQLExec("CREATE TABLE IF NOT EXISTS logs(id INTEGER AUTO_INCREMENT, created TIMESTAMP, entry VARCHAR, PRIMARY KEY id)"); await client.SQLExec("CREATE INDEX IF NOT EXISTS ON logs(created)"); var rspInsert = await client.SQLExec("INSERT INTO logs(created, entry) VALUES($1, $2)", SQLParameter.Create(DateTime.UtcNow), SQLParameter.Create("hello immutable world")); var queryResult = await client.SQLQuery("SELECT created, entry FROM LOGS order by created DESC"); var sqlVal = queryResult.Rows[0]["entry"]; Console.WriteLine($"The log entry is: {sqlVal.Value}"); ``` -------------------------------- ### ImmuClient Initialization with FileImmuStateHolder Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/FileImmuStateHolder.md Demonstrates how to initialize ImmuClient with a FileImmuStateHolder, specifying a custom states folder. Includes error handling for connection verification failures. ```csharp using ImmuDB; using ImmuDB.Exceptions; var client = ImmuClient.NewBuilder() .WithStateHolder(FileImmuStateHolder.NewBuilder() .WithStatesFolder("./states") .Build()) .Build(); try { await client.Open("immudb", "immudb", "defaultdb"); } catch (VerificationException ex) when (ex.Message.Contains("deployment")) { Console.WriteLine("Connected to wrong immudb server!"); // Clear states and reconnect to correct server } ``` -------------------------------- ### State Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets the current local database state. Updates from the server if not already cached. ```APIDOC ## State ### Description Gets the current local database state. Updates from server if not already cached. ### Type `ImmuState` ### Example ```csharp var state = client.State; Console.WriteLine($"Tx ID: {state.TxId}"); ``` ``` -------------------------------- ### Get Biometric Ledger Root Hash Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Retrieve the root hash of the Biometric Ledger. ```csharp public byte[] BlRoot { get; } ``` -------------------------------- ### Get Number of Entries Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Retrieve the count of entries included in this transaction. This property is read-only. ```csharp public int NEntries { get; } ``` ```csharp Console.WriteLine($"Number of entries: {txHeader.NEntries}"); ``` -------------------------------- ### Build Immudb4net from Source Source: https://github.com/codenotary/immudb4net/blob/main/Readme.md Instructions for building the immudb4net library from its source code using the dotnet CLI. ```bash dotnet build ``` -------------------------------- ### Access KVPair Key Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/KVPair.md Demonstrates how to create a KVPair with a string key and retrieve its key as a byte array, then convert it back to a string for display. ```csharp var pair = new KVPair("mykey", new byte[] { 1, 2, 3 }); Console.WriteLine($"Key: {Encoding.UTF8.GetString(pair.Key)}"); ``` -------------------------------- ### Create and Open ImmuClient Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Instantiate and open an ImmuClient to connect to the immudb server. Ensure the server details and database name are correctly provided. ```csharp var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); ``` -------------------------------- ### GrpcAddress Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets the full gRPC address, including host and port, of the connected immudb server. ```APIDOC ## GrpcAddress ### Description Gets the full gRPC address (host:port) of the immudb server. ### Type `string` ### Example ```csharp Console.WriteLine($"Server: {client.GrpcAddress}"); ``` ``` -------------------------------- ### Batch Get Entries by Keys Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Batch retrieves values for multiple keys. This operation is atomic. ```csharp public async Task> GetAll(List keys) ``` ```csharp var entries = await client.GetAll(new List { "key1", "key2", "key3" }); ``` -------------------------------- ### Get(string) Method Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Retrieves the current value associated with a given key from the active database. ```APIDOC ## Get(string key) ### Description Retrieves the current value for a key. ### Method Instance Method ### Parameters #### Path Parameters - **key** (string) - Required - The key to retrieve ### Returns `Task` — Entry containing key, value, and metadata ### Throws `KeyNotFoundException` — If key does not exist ### Example ```csharp var entry = await client.Get("mykey"); Console.WriteLine(entry.ToString()); // Output as string Console.WriteLine(entry.Value); // Raw bytes ``` ``` -------------------------------- ### DeploymentInfoCheck Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets or sets a boolean value indicating whether server authenticity is verified upon connection. ```APIDOC ## DeploymentInfoCheck ### Description Gets or sets whether server authenticity is verified on connection. ### Type `bool` (default: true) ### Example ```csharp client.DeploymentInfoCheck = false; // Disable verification ``` ``` -------------------------------- ### Initialize ImmuClient with Server URL and Port Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Initializes a new ImmuClient with a specified server URL and port, using the defaultdb database. ```csharp public ImmuClient(string serverUrl, int serverPort) { } ``` ```csharp var client = new ImmuClient("immudb.example.com", 3322); ``` -------------------------------- ### Get Biometric Ledger Transaction ID Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Retrieve the transaction ID from the Biometric Ledger (blockchain layer). ```csharp public ulong BlTxId { get; } ``` -------------------------------- ### Enable Deployment Info Check Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/FileImmuStateHolder.md Sets a flag to verify that the connected server matches the known deployment. This is true by default. ```csharp holder.DeploymentInfoCheck = true; ``` -------------------------------- ### Get Transaction Timestamp Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/TxHeader.md Access the transaction's timestamp, provided in epoch microseconds. This property is read-only. ```csharp public long Ts { get; } ``` ```csharp var timestamp = txHeader.Ts; var dateTime = DateTimeOffset.FromUnixTimeSeconds(timestamp / 1_000_000).DateTime; ``` -------------------------------- ### Create ImmuClient with Default Configuration Source: https://github.com/codenotary/immudb4net/blob/main/Readme.md Instantiate an ImmuClient using default settings. Alternatively, you can directly instantiate the client with server address and port, or specify a default database. ```C# ImmuClient immuClient = ImmuClient.NewBuilder().Build(); ``` ```C# Immuclient immuClient = new ImmuClient(); ``` ```C# Immuclient immuClient = new ImmuClient("localhost", 3322); ``` ```C# Immuclient immuClient = new ImmuClient("localhost", 3322, "defaultdb"); ``` -------------------------------- ### Verified Get Transaction by ID Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Retrieve a transaction by its ID with cryptographic verification. This ensures the transaction data has not been tampered with. ```csharp // Verified transaction (with cryptographic proof) var verifiedTx = await client.VerifiedTxById(100); ``` -------------------------------- ### Initialize ImmuClient with Defaults Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Initializes a new ImmuClient with default values (localhost:3322, defaultdb database). ```csharp public ImmuClient() { } ``` ```csharp var client = new ImmuClient(); ``` -------------------------------- ### Get User String Representation Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Override the ToString method to return a string representation of the user's details. ```csharp public override string ToString() ``` -------------------------------- ### TxScan(ulong) Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Iterates over transactions starting from a specified transaction ID. This method is useful for retrieving a sequence of transactions. ```APIDOC ## TxScan(ulong) ### Description Iterates over transactions starting from a specified transaction ID. This method is useful for retrieving a sequence of transactions. ### Method `public async Task> TxScan(ulong initialTxId)` ### Parameters #### Path Parameters - **initialTxId** (ulong) - Yes - Starting transaction ID ### Response #### Success Response (200) - **List** (`Task>`) - List of transactions ### Example ```csharp var txs = await client.TxScan(0); ``` ``` -------------------------------- ### ImmuClient(string, int) Constructor Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Initializes a new ImmuClient with a specified server URL and port, connecting to the 'defaultdb' database. ```APIDOC ## ImmuClient(string serverUrl, int serverPort) ### Description Initializes a new ImmuClient with specified server URL and port, using defaultdb database. ### Method Constructor ### Parameters #### Path Parameters - **serverUrl** (string) - Required - Server address (e.g., "localhost" or "http://localhost") - **serverPort** (int) - Required - Server port (e.g., 3322) ### Example ```csharp var client = new ImmuClient("immudb.example.com", 3322); ``` ``` -------------------------------- ### Configure Idle Connection Check Interval Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets or sets the interval at which idle connections are checked. This property is internally settable. ```csharp client.IdleConnectionCheckInterval = TimeSpan.FromMinutes(1); ``` -------------------------------- ### Configure Connection Shutdown Timeout Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets or sets the timeout duration for connection shutdown operations. Defaults to 2 seconds. ```csharp client.ConnectionShutdownTimeout = TimeSpan.FromSeconds(5); ``` -------------------------------- ### Configure Server Authenticity Check Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Gets or sets whether server authenticity is verified upon connection. Defaults to true. ```csharp client.DeploymentInfoCheck = false; ``` -------------------------------- ### Build Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Creates an ImmuClient instance with the configured settings. This method does not open a connection. ```APIDOC ## Build ### Description Creates an ImmuClient instance with the configured settings. Does not open a connection. ### Method Signature ```csharp public ImmuClient Build() ``` ### Returns `ImmuClient` — Configured client instance ### Example ```csharp var client = builder.Build(); // Open connection manually later await client.Open("username", "password", "database"); ``` ``` -------------------------------- ### ImmuClient() Constructor Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Initializes a new ImmuClient with default values for server URL and port, connecting to the 'defaultdb' database. ```APIDOC ## ImmuClient() ### Description Initializes a new ImmuClient with default values: localhost:3322, defaultdb database. ### Method Constructor ### Parameters This constructor takes no parameters. It uses implicit defaults for server URL, port, and database. ### Example ```csharp var client = new ImmuClient(); ``` ``` -------------------------------- ### Create User with Name and Permissions Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Construct a new User object with a specified name and a list of permissions. ```csharp public User(string name, List permissions) ``` -------------------------------- ### Get Transaction by ID Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Retrieve a transaction from the database using its unique transaction ID. The header contains metadata about the transaction. ```csharp // Get transaction by ID var tx = await client.TxById(100); Console.WriteLine($"Entries: {tx.Header.NEntries}"); ``` -------------------------------- ### Open(string, string, string) Method Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Opens a connection to the immudb server and initiates a user session with the provided credentials and database name. ```APIDOC ## Open(string username, string password, string databaseName) ### Description Opens a connection to the immudb server and initiates a user session. ### Method Instance Method ### Parameters #### Path Parameters - **username** (string) - Required - Username for authentication - **password** (string) - Required - Password for authentication - **databaseName** (string) - Required - Database to connect to ### Throws - `InvalidOperationException` — If a session is already open - `RpcException` — If authentication fails or server is unreachable ### Example ```csharp var client = new ImmuClient(); await client.Open("immudb", "immudb", "defaultdb"); ``` ``` -------------------------------- ### Handle KeyNotFoundException Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/errors.md Catch this exception when a key does not exist in the database. This is common when using methods like Get, Delete, or History. ```csharp try { var entry = await client.Get("nonexistent"); } catch (KeyNotFoundException) { Console.WriteLine("Key does not exist"); } ``` -------------------------------- ### Verified Get Key-Value Pair Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Read a value associated with a key with cryptographic verification. This ensures data integrity and authenticity. ```csharp // Verified read (cryptographically proven) var verified = await client.VerifiedGet("key"); ``` -------------------------------- ### Configure Server Signing Key Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Provide the path to the server's public signing key file (PEM format) for state verification using WithServerSigningKey. This is crucial for ensuring data integrity. ```csharp builder.WithServerSigningKey("/path/to/server_public_key.pem") ``` -------------------------------- ### Get Key-Value Pair Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Read a value associated with a given key from the database. The returned entry contains the value and metadata. ```csharp // Read var entry = await client.Get("key"); Console.WriteLine(entry.ToString()); ``` -------------------------------- ### Get Entry Value as Bytes Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/Entry.md Retrieves the value of a stored entry as a byte array. This is the raw data stored for the key. ```csharp var valueBytes = entry.Value; ``` -------------------------------- ### Open and Close User Sessions Source: https://github.com/codenotary/immudb4net/blob/main/Readme.md Initiate a user session by opening it with credentials and a database, and terminate the session by closing it. A one-liner option is also available for opening the session. ```C# await immuClient.Open("usr1", "pwd1", "defaultdb"); // Interact with immudb using logged-in user. //... await immuClient.Close(); ``` ```C# client = await ImmuClient.NewBuilder().Open(); //then close it await immuClient.Close(); ``` -------------------------------- ### ZEntry Score Property Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ZEntry.md Get the score of a ZEntry, which determines its position in the sorted set. Scores are used for ordering entries. ```csharp public double Score { get; } ``` ```csharp var zEntry = zEntries[0]; Console.WriteLine($"Score: {zEntry.Score}"); ``` -------------------------------- ### Create User Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/README.md Create a new user in the database with specified username, password, permissions, and database scope. Requires appropriate privileges. ```csharp // Create user await client.CreateUser("alice", "password", Permission.PERMISSION_RW, "mydb"); ``` -------------------------------- ### Create ImmuClientBuilder with Defaults Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Instantiate the ImmuClientBuilder using its default constructor to begin building an ImmuClient with default settings. ```csharp var builder = new ImmuClientBuilder(); ``` -------------------------------- ### Get Transaction ID of an Entry Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/Entry.md Retrieves the transaction ID associated with a stored entry. This is useful for tracking the history of changes. ```csharp var entry = await client.Get("mykey"); Console.WriteLine($"Transaction ID: {entry.Tx}"); ``` -------------------------------- ### Create User with Name Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Construct a new User object with a specified name and an empty permissions list. ```csharp public User(string name) ``` -------------------------------- ### Get User Creator Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Access the CreatedBy property to retrieve the username of the user who created this user. This property can also be set. ```csharp public string? CreatedBy { get; set; } ``` -------------------------------- ### Build ImmuClient Instance Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClientBuilder.md Creates an ImmuClient instance with the configured settings. This method does not open a connection; the connection must be opened manually later. ```csharp public ImmuClient Build() ``` ```csharp var client = builder.Build(); // Open connection manually later await client.Open("username", "password", "database"); ``` -------------------------------- ### Get User Creation Timestamp Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/User.md Access the CreatedAt property to retrieve the timestamp when the user was created. This property can also be set. ```csharp public string? CreatedAt { get; set; } ``` -------------------------------- ### Scan Transactions from ID Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Retrieves a list of transactions starting from a specified transaction ID. Useful for iterating through transaction history. ```csharp public async Task> TxScan(ulong initialTxId) var txs = await client.TxScan(0); ``` -------------------------------- ### Creating a Column Definition Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/SQLQueryResult.md Demonstrates the creation of a Column object, specifying its name and SQL data type. ```csharp var column = new Column("age", "INTEGER"); ``` -------------------------------- ### Create ImmuState Instance Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuState.md Instantiate a new ImmuState object with database name, transaction ID, transaction hash, and signature. ```csharp var state = new ImmuState("mydb", 100, txHashBytes, signatureBytes); ``` -------------------------------- ### Get immudb Server gRPC Address Source: https://github.com/codenotary/immudb4net/blob/main/_autodocs/ImmuClient.md Retrieves the full gRPC address, including host and port, of the connected immudb server. ```csharp Console.WriteLine($"Server: {client.GrpcAddress}"); ```