# Add a keyvault add database_url "postgresql://localhost:5432/mydb"# Retrieve itvault get database_url# Output: postgresql://localhost:5432/mydb# Try to get a non-existent keyvault get nonexistent# Output: Key not found
The get command executes the following SQL query (KVSTORE.cs:94-97):
SELECT value FROM storeWHERE key = $key
The implementation reads the result and outputs either the value or “Key not found” (KVSTORE.cs:91-107):
public int Get(string key){ using var command = connection.CreateCommand(); command.CommandText = """ SELECT value FROM store WHERE key = $key """; command.Parameters.AddWithValue("$key", key); using var reader = command.ExecuteReader(); string? value = null; while (reader.Read()) { value = reader.GetString(0); } Console.WriteLine($"{value ?? "Key not found"}"); return 0;}