Skip to content

Commit 445c025

Browse files
dev: prepare repository for ecosystem dotnet (#306)
* dev: prepare repository for ecosystem dotnet * update publish jobs
1 parent 71001da commit 445c025

File tree

9 files changed

+120
-56
lines changed

9 files changed

+120
-56
lines changed

.github/scripts/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CHANGELOG="$CHANGELOG
4747
4848
Full Changelog: [$LAST_TAG...$TAG](https://github.com/ydb-platform/ydb-dotnet-sdk/compare/$LAST_TAG...$TAG)"
4949

50-
cd src
50+
cd src/Ydb.Sdk/src
5151
dotnet pack -c Release -o out /p:Version=$VERSION
5252
gh release create $TAG -t "$TAG" --notes "$CHANGELOG"
5353
dotnet nuget push out/Ydb.Sdk.$VERSION.nupkg --skip-duplicate --api-key $NUGET_TOKEN --source https://api.nuget.org/v3/index.json

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
env:
2525
VERSION_CHANGE: ${{ github.event.inputs.version-change }}
2626
RELEASE_CANDIDATE: ${{ github.event.inputs.release-candidate }}
27-
CHANGELOG_FILE: CHANGELOG.md
27+
CHANGELOG_FILE: ./src/Ydb.Sdk/CHANGELOG.md
2828
GITHUB_TOKEN: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }}
2929
NUGET_TOKEN: ${{ secrets.YDB_PLATFORM_NUGET_TOKEN }}
3030
steps:
@@ -42,7 +42,7 @@ jobs:
4242
9.0.x
4343
- name: Build
4444
run: |
45-
cd src
45+
cd src/Ydb.Sdk/src
4646
dotnet build --configuration Release
4747
- name: Publish
4848
run: bash .github/scripts/publish.sh

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Common
44

5-
YDB is a free and open project and we appreciate to receive contributions from our community.
5+
YDB is a free and open project, and we appreciate to receive contributions from our community.
66

77
## Contributing code changes
88

99
If you would like to contribute a new feature or a bug fix, please discuss your idea first on the GitHub issue.
1010
If there is no issue for your idea, please open one. It may be that somebody is already working on it,
1111
or that there are some complex obstacles that you should know about before starting the implementation.
12-
Usually there are several ways to fix a problem and it is important to find the right approach before spending time on a PR
12+
Usually there are several ways to fix a problem, and it is important to find the right approach before spending time on a PR
1313
that cannot be merged.
1414

1515
## Provide a contribution

README.md

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,37 @@
1-
[![Nuget](https://img.shields.io/nuget/v/Ydb.Sdk)](https://www.nuget.org/packages/Ydb.Sdk/)
1+
# YDB .NET Ecosystem
22

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+
[![Telegram](https://img.shields.io/badge/Telegram-Русский_чат-2ba2d9.svg?logo=telegram)](https://t.me/ydb_ru)
4+
[![Telegram](https://img.shields.io/badge/Telegram-English_chat-2ba2d9.svg?logo=telegram)](https://t.me/ydb_en)
5+
[![WebSite](https://img.shields.io/badge/website-ydb.tech-blue.svg)](https://ydb.tech)
56

6-
## Prerequisites
7-
.NET 6 or above
7+
## Overview
88

9-
## Features
9+
This repository contains all official C# components for working with YDB:
1010

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.
1213

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
1815

19-
## Installation
16+
| Package | NuGet | Readme | Documentation |
17+
|-----------|--------------------------------------------------------------------------------------------|-----------------------------------|---------------|
18+
| `Ydb.Sdk` | [![NuGet](https://img.shields.io/nuget/v/Ydb.Sdk)](https://www.nuget.org/packages/Ydb.Sdk) | [README](./src/Ydb.Sdk/README.md) | |
2019

21-
```
22-
dotnet add package Ydb.Sdk
23-
```
24-
25-
## Usage ADO.NET
20+
## Versioning
2621

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.
2825

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**.
3827

39-
await using var connection = new YdbConnection(ydbConnectionBuilder);
40-
await connection.OpenAsync();
28+
## Contributing
4129

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.
5331

54-
var ydbDataReader = await ydbCommand.ExecuteReaderAsync();
32+
## License
5533

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.
6535

6636
## Examples
6737

SECURITY.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
We're extremely grateful for security researchers and users who report vulnerabilities they discovered in YDB. All reports are thoroughly investigated.
6+
7+
To report a potential vulnerability in YDB please email details to [[email protected]](mailto:[email protected]).
8+
9+
### When Should I Report a Vulnerability?
10+
11+
- You think you discovered a potential security vulnerability in YDB
12+
- You are unsure how a vulnerability affects YDB
13+
14+
## Security Vulnerability Response
15+
16+
Each report is acknowledged and analyzed by YDB maintainers within 5 working days.
17+
We will keep the reporter informed about the issue progress.
18+
19+
## Public Disclosure Timing
20+
21+
A public disclosure date is negotiated by YDB maintainers and the bug submitter.
22+
We prefer to fully disclose the bug as soon as possible once a mitigation is available for YDB users.
23+
It is reasonable to delay disclosure when the bug or the fix is not yet fully understood,
24+
the solution is not well-tested, or for vendor coordination.
25+
The timeframe for disclosure is from immediate (especially if it's already publicly known) to 90 days.
26+
For a vulnerability with a straightforward mitigation, we expect report date to disclosure date to be on the order of 7 days.

src/EFCore.Ydb/README.md

Whitespace-only changes.
File renamed without changes.

src/Ydb.Sdk/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# YDB .NET SDK
2+
3+
[![NuGet](https://img.shields.io/nuget/v/Ydb.Sdk)](https://www.nuget.org/packages/Ydb.Sdk)
4+
5+
## Overview
6+
7+
Provides an ADO.NET standard implementation for working with YDB, as well as native clients for lightweight interaction with YDB.
8+
9+
## Features
10+
11+
- **Ydb.Sdk.Ado**: 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.
12+
- **Ydb.Sdk.Services.Topic**: Writer and Reader topic clients implement core topic functionality for YDB – writing and reading message streams.
13+
14+
## Installation
15+
16+
```
17+
dotnet add package Ydb.Sdk
18+
```
19+
20+
## Usage ADO.NET
21+
22+
Example of using ADO.NET to execute a SQL query against YDB:
23+
24+
```c#
25+
var ydbConnectionBuilder = new YdbConnectionStringBuilder
26+
{
27+
Host = "server",
28+
Port = 2135,
29+
Database = "/my-ydb",
30+
UseTls = true
31+
};
32+
33+
await using var connection = new YdbConnection(ydbConnectionBuilder);
34+
await connection.OpenAsync();
35+
36+
var ydbCommand = connection.CreateCommand();
37+
ydbCommand.CommandText = """
38+
SELECT series_id, season_id, episode_id, air_date, title
39+
FROM episodes
40+
WHERE series_id = @series_id AND season_id > @season_id
41+
ORDER BY series_id, season_id, episode_id
42+
LIMIT @limit_size;
43+
""";
44+
ydbCommand.Parameters.Add(new YdbParameter("series_id", DbType.UInt64, 1U));
45+
ydbCommand.Parameters.Add(new YdbParameter("season_id", DbType.UInt64, 1U));
46+
ydbCommand.Parameters.Add(new YdbParameter("limit_size", DbType.UInt64, 3U));
47+
48+
var ydbDataReader = await ydbCommand.ExecuteReaderAsync();
49+
50+
_logger.LogInformation("Selected rows:");
51+
while (await ydbDataReader.ReadAsync())
52+
{
53+
_logger.LogInformation(
54+
"series_id: {series_id}, season_id: {season_id}, episode_id: {episode_id}, air_date: {air_date}, title: {title}",
55+
ydbDataReader.GetUint64(0), ydbDataReader.GetUint64(1), ydbDataReader.GetUint64(2),
56+
ydbDataReader.GetDateTime(3), ydbDataReader.GetString(4));
57+
}
58+
```
59+
60+
## More examples
61+
62+
- [AdoNet simple guide](./../../examples/src/AdoNet)
63+
- [AdoNet connect to Yandex Cloud](./../../examples/src/YC)
64+
- [Dapper example](./../../examples/src/DapperExample)
65+
- [Topic client](./../../examples/src/Topic)

src/YdbSdk.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
44
VisualStudioVersion = 16.0.29306.81
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ydb.Sdk", "Ydb.Sdk", "{34D81B90-76BA-430B-B3B1-B830B7206134}"
7+
ProjectSection(SolutionItems) = preProject
8+
Ydb.Sdk\CHANGELOG.md = Ydb.Sdk\CHANGELOG.md
9+
EndProjectSection
710
EndProject
811
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E21B559D-5E8D-47AE-950E-03435F3066DF}"
912
EndProject

0 commit comments

Comments
 (0)