OpenGauss is the open source .NET data provider.
License
—
Deps
11
Install Size
—
Vulns
✓ 0
Published
Oct 15, 2024
$ dotnet add package WBoy.OpenGauss.NETOpenGauss is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.
Here's a basic code snippet to get you started:
var connString = "Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase";
await using var conn = new OpenGaussConnection(connString);
await conn.OpenAsync();
// Insert some data
await using (var cmd = new OpenGaussCommand("INSERT INTO data (some_field) VALUES (@p)", conn))
{
cmd.Parameters.AddWithValue("p", "Hello world");
await cmd.ExecuteNonQueryAsync();
}
// Retrieve all rows
await using (var cmd = new OpenGaussCommand("SELECT some_field FROM data", conn))
await using (var reader = await cmd.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
Console.WriteLine(reader.GetString(0));
}
For the full documentation, please visit the OpenGauss website.