|
1 | | -# Npgsql - the .NET data provider for PostgreSQL |
| 1 | +# GaussDB |
2 | 2 |
|
3 | | -[](https://www.nuget.org/packages/Npgsql/) |
4 | | -[](https://www.myget.org/feed/npgsql/package/nuget/Npgsql) |
5 | | -[](https://www.myget.org/feed/npgsql-vnext/package/nuget/Npgsql) |
6 | | -[](https://github.com/npgsql/npgsql/actions/workflows/build.yml) |
7 | | -[](https://gitter.im/npgsql/npgsql) |
| 3 | +[](https://opensource.org/licenses/PostgreSQL) |
8 | 4 |
|
9 | | -## What is Npgsql? |
10 | 5 |
|
11 | | -Npgsql is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET. |
12 | 6 |
|
13 | | -For the full documentation, please visit [the Npgsql website](https://www.npgsql.org). For the Entity Framework Core provider that works with this provider, see [Npgsql.EntityFrameworkCore.PostgreSQL](https://github.com/npgsql/efcore.pg). |
| 7 | +## What is GaussDB ? |
| 8 | + |
| 9 | +GuassDB is an open-source database driver led by Huawei's open-source community and refactored based on npgsql. It is compatible with openGauss and Guass databases. [Open Source for Huawei](https://developer.huaweicloud.com/programs/opensource/contributing/) revolves around Huawei's technology ecosystems including Kunpeng, Ascend, HarmonyOS, and Huawei Cloud. Through collaboration with developers from enterprises, universities, and the open-source community, it enables adaptation development and solution validation for open-source software, ensuring smoother and more efficient operation on Huawei Cloud. |
| 10 | + |
| 11 | +Before getting started, developers can download the [Open Source for Huawei Wiki](https://gitcode.com/HuaweiCloudDeveloper/OpenSourceForHuaweiWiki) to access detailed development procedures, technical preparations, and various resources required throughout the development process. If you have any questions during use, please visit the [GaussDB forum](https://bbs.huaweicloud.com/forum/forum-1350-1.html) for discussion. |
| 12 | + |
| 13 | + |
14 | 14 |
|
15 | 15 | ## Quickstart |
16 | 16 |
|
17 | 17 | Here's a basic code snippet to get you started: |
18 | 18 |
|
19 | 19 | ```csharp |
20 | | -using Npgsql; |
| 20 | +using GaussDB; |
21 | 21 |
|
22 | 22 | var connString = "Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase"; |
23 | 23 |
|
24 | | -var dataSourceBuilder = new NpgsqlDataSourceBuilder(connString); |
| 24 | +var dataSourceBuilder = new GaussDataSourceBuilder(connString); |
25 | 25 | var dataSource = dataSourceBuilder.Build(); |
26 | 26 |
|
27 | 27 | var conn = await dataSource.OpenConnectionAsync(); |
28 | 28 |
|
29 | 29 | // Insert some data |
30 | | -await using (var cmd = new NpgsqlCommand("INSERT INTO data (some_field) VALUES (@p)", conn)) |
| 30 | +await using (var cmd = new GaussCommand("INSERT INTO data (some_field) VALUES (@p)", conn)) |
31 | 31 | { |
32 | 32 | cmd.Parameters.AddWithValue("p", "Hello world"); |
33 | 33 | await cmd.ExecuteNonQueryAsync(); |
34 | 34 | } |
35 | 35 |
|
36 | 36 | // Retrieve all rows |
37 | | -await using (var cmd = new NpgsqlCommand("SELECT some_field FROM data", conn)) |
| 37 | +await using (var cmd = new GaussCommand("SELECT some_field FROM data", conn)) |
38 | 38 | await using (var reader = await cmd.ExecuteReaderAsync()) |
39 | 39 | { |
40 | 40 | while (await reader.ReadAsync()) |
41 | 41 | Console.WriteLine(reader.GetString(0)); |
42 | 42 | } |
43 | 43 | ``` |
44 | | - |
45 | | -## Key features |
46 | | - |
47 | | -* High-performance PostgreSQL driver. Regularly figures in the top contenders on the [TechEmpower Web Framework Benchmarks](https://www.techempower.com/benchmarks/). |
48 | | -* Full support of most PostgreSQL types, including advanced ones such as arrays, enums, ranges, multiranges, composites, JSON, PostGIS and others. |
49 | | -* Highly-efficient bulk import/export API. |
50 | | -* Failover, load balancing and general multi-host support. |
51 | | -* Great integration with Entity Framework Core via [Npgsql.EntityFrameworkCore.PostgreSQL](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL). |
52 | | - |
53 | | -For the full documentation, please visit the Npgsql website at [https://www.npgsql.org](https://www.npgsql.org). |
0 commit comments