Skip to content

Commit d6f6ebb

Browse files
committed
fix tool test job
1 parent 8793f88 commit d6f6ebb

File tree

2 files changed

+39
-8
lines changed

2 files changed

+39
-8
lines changed

.github/workflows/dotnet.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
run: |
126126
cp libchdb.so src/chdb/libchdb.so
127127
ls -lahS src/chdb/libchdb*
128-
dotnet pack src/chdb/chdb.csproj -c Release --include-symbols --version-suffix ${{ github.run_number }}
128+
dotnet pack src/chdb/chdb.csproj -c Release --include-symbols
129129
ls -lahS nupkg
130130
131131
- name: Publish the package to nuget.org
@@ -151,14 +151,15 @@ jobs:
151151
cp libchdb.so src/chdb/
152152
ls -lahS src/chdb/libchdb*
153153
dotnet nuget sources add -n chdb ./nupkg
154-
dotnet pack src/chdb-tool/chdb-tool.csproj -c Release --include-symbols --version-suffix ${{ github.run_number }}
154+
dotnet pack src/chdb-tool/chdb-tool.csproj -c Release --include-symbols
155155
ls -lahS nupkg
156156
157157
- name: Publish
158158
run: dotnet nuget push nupkg/chdb-tool.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}
159159

160160
- name: Test chdb-tool
161161
run: |
162+
./update_libchdb.sh
162163
dotnet tool install --add-source ./nupkg --global chdb-tool
163164
which chdb
164165
cp libchdb.so /home/runner/.dotnet/tools/

README.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,24 @@ Running on platforms: linux, osx, windows, and architectures: x64, arm64.
1616
Currently the librairy is too large to be packed into a nuget package, so you need to install it manually. Use the [update_libchdb.sh](update_libchdb.sh) script to download the library for your platform and architecture.
1717

1818
```bash
19+
# download the latest version of the library - it takes a version as an optional argument
1920
./update_libchdb.sh
21+
# install the package to your project
2022
dotnet add package chdb
2123
```
2224

25+
Also place the library in appropriate folder, and add following to your csproj file:
26+
27+
```xml
28+
<ItemGroup>
29+
<None Update="libchdb.so">
30+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
31+
</None>
32+
</ItemGroup>
33+
```
34+
35+
Then you can use it in your code like this:
36+
2337
```csharp
2438
using ChDb;
2539

@@ -39,6 +53,21 @@ var result = s.Query("DESCRIBE s3('https://datasets-documentation.s3.eu-west-3.a
3953
Console.WriteLine(result.Text);
4054
```
4155

56+
or use it right in F# interactive with `dotnet fsi`:
57+
58+
```fsharp
59+
#r "nuget: chdb"
60+
61+
open ChDb
62+
63+
// print out result in the PrettyCompact format by default
64+
let result = ChDb.Query "select version()"
65+
printfn "%s" result.Text
66+
// or save result to a text or binary file in any supported format
67+
let result = ChDb.Query("select * from system.formats where is_output = 1", "CSVWithNames")
68+
System.IO.File.WriteAllBytes("supported_formats.csv", result.Buf)
69+
```
70+
4271
## chdb-tool
4372

4473
![NuGet Version](https://img.shields.io/nuget/vpre/chdb-tool)
@@ -73,13 +102,14 @@ chdb "select * from system.formats where is_output = 1" PrettyCompact
73102
# Build
74103

75104
```bash
76-
# update latest chdb version
77105
./update_libchdb.sh [v1.2.1]
78-
# install versionbump tool
79-
dotnet tool install -g BumpVersion
80-
# bump version
81-
bumpversion patch
82-
git push --foloow-tags
106+
cp libchdb.so src/chdb/
107+
dotnet build -c Release
108+
dotnet test -c Release
109+
dotnet pack -c Release
110+
dotnet nuget add source ./nupkg --name chdb
111+
dotnet tool update -g chdb-tool
112+
chdb --version
83113
```
84114

85115
## Authors

0 commit comments

Comments
 (0)