|
1 | | -[](https://www.nuget.org/packages/Ydb.Sdk/) |
| 1 | +# YDB .NET Ecosystem |
2 | 2 |
|
3 | | -# YDB .NET SDK |
4 | | -Provides an ADO.NET standard implementation for working with YDB, as well as native clients for lightweight interaction with YDB. |
| 3 | +[](https://t.me/ydb_ru) |
| 4 | +[](https://t.me/ydb_en) |
| 5 | +[](https://ydb.tech) |
5 | 6 |
|
6 | | -## Prerequisites |
7 | | -.NET 6 or above |
| 7 | +## Overview |
8 | 8 |
|
9 | | -## Features |
| 9 | +This repository contains all official C# components for working with YDB: |
10 | 10 |
|
11 | | -- **ADO.NET**: Full support for standard ADO.NET interfaces including DbConnection, DbCommand, DbDataReader, and more. This allows you to use familiar methods and patterns for database operations while leveraging the power and flexibility of YDB. |
| 11 | +- **Ydb.Sdk** - Core SDK includes an ADO.NET provider and a topic (Writer / Reader) client. |
| 12 | +- **EntityFrameworkCore.Ydb** - Entity Framework Core integration. |
12 | 13 |
|
13 | | -## Versioning |
14 | | - |
15 | | -We follow the **[SemVer 2.0.0](https://semver.org)**. In particular, we provide backward compatibility in the `MAJOR` releases. New features without loss of backward compatibility appear on the `MINOR` release. In the minor version, the patch number starts from `0`. Bug fixes and internal changes are released with the third digit (`PATCH`) in the version. |
16 | | - |
17 | | -Major version zero (`0.y.z`) is considered prerelease and **do not guarantee any backward compatibility**. |
| 14 | +## Packages |
18 | 15 |
|
19 | | -## Installation |
| 16 | +| Package | NuGet | Readme | Documentation | |
| 17 | +|-----------|--------------------------------------------------------------------------------------------|-----------------------------------|---------------| |
| 18 | +| `Ydb.Sdk` | [](https://www.nuget.org/packages/Ydb.Sdk) | [README](./src/Ydb.Sdk/README.md) | | |
20 | 19 |
|
21 | | -``` |
22 | | -dotnet add package Ydb.Sdk |
23 | | -``` |
24 | | - |
25 | | -## Usage ADO.NET |
| 20 | +## Versioning |
26 | 21 |
|
27 | | -Example of using ADO.NET to execute a SQL query against YDB: |
| 22 | +We follow the **[SemVer 2.0.0](https://semver.org)**. In particular, we provide backward compatibility in the `MAJOR` |
| 23 | +releases. New features without loss of backward compatibility appear on the `MINOR` release. In the minor version, the |
| 24 | +patch number starts from `0`. Bug fixes and internal changes are released with the third digit (`PATCH`) in the version. |
28 | 25 |
|
29 | | -```c# |
30 | | -var ydbConnectionBuilder = new YdbConnectionStringBuilder |
31 | | -{ |
32 | | - Host = "server", |
33 | | - Port = 2135, |
34 | | - Database = "/my-ydb", |
35 | | - UseTls = true, |
36 | | - CredentialsProvider = credentialsProvider // Credentials provider, see "Credentials" section |
37 | | -}; |
| 26 | +Major version zero (`0.y.z`) is considered prerelease and **do not guarantee any backward compatibility**. |
38 | 27 |
|
39 | | -await using var connection = new YdbConnection(ydbConnectionBuilder); |
40 | | -await connection.OpenAsync(); |
| 28 | +## Contributing |
41 | 29 |
|
42 | | -var ydbCommand = connection.CreateCommand(); |
43 | | -ydbCommand.CommandText = """ |
44 | | - SELECT series_id, season_id, episode_id, air_date, title |
45 | | - FROM episodes |
46 | | - WHERE series_id = @series_id AND season_id > @season_id |
47 | | - ORDER BY series_id, season_id, episode_id |
48 | | - LIMIT @limit_size; |
49 | | - """; |
50 | | -ydbCommand.Parameters.Add(new YdbParameter("series_id", DbType.UInt64, 1U)); |
51 | | -ydbCommand.Parameters.Add(new YdbParameter("season_id", DbType.UInt64, 1U)); |
52 | | -ydbCommand.Parameters.Add(new YdbParameter("limit_size", DbType.UInt64, 3U)); |
| 30 | +We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines. |
53 | 31 |
|
54 | | -var ydbDataReader = await ydbCommand.ExecuteReaderAsync(); |
| 32 | +## License |
55 | 33 |
|
56 | | -_logger.LogInformation("Selected rows:"); |
57 | | -while (await ydbDataReader.ReadAsync()) |
58 | | -{ |
59 | | - _logger.LogInformation( |
60 | | - "series_id: {series_id}, season_id: {season_id}, episode_id: {episode_id}, air_date: {air_date}, title: {title}", |
61 | | - ydbDataReader.GetUint64(0), ydbDataReader.GetUint64(1), ydbDataReader.GetUint64(2), |
62 | | - ydbDataReader.GetDateTime(3), ydbDataReader.GetString(4)); |
63 | | -} |
64 | | -``` |
| 34 | +This repository is licensed under the Apache 2.0 License. |
65 | 35 |
|
66 | 36 | ## Examples |
67 | 37 |
|
|
0 commit comments