Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e0bd9c1
started work
Gazizonoki Apr 18, 2025
2613dac
C API
Gazizonoki May 10, 2025
74eda9d
ODBC MVP
Gazizonoki May 16, 2025
f9a08a5
Revert C API
Gazizonoki May 16, 2025
f27d288
Parameter bind
Gazizonoki May 26, 2025
c3456db
Add unit test
Gazizonoki May 26, 2025
a0decdd
fix
Gazizonoki May 26, 2025
958e565
added tx support
Gazizonoki May 26, 2025
7ab1b67
step
Gazizonoki May 30, 2025
d15d3b9
step
Gazizonoki Jun 2, 2025
5f3537d
step
Gazizonoki Jun 3, 2025
f4aecf9
Error handlig
Gazizonoki Jul 11, 2025
4683392
some fixes
Apr 7, 2026
08cd57c
env features
Apr 7, 2026
b5bf9fa
attributes
Apr 8, 2026
35b5492
fix
Apr 9, 2026
94aa4ab
driver pool
Ylonies Apr 17, 2026
7ac660f
conn attributes
Ylonies Apr 17, 2026
ca7fbdc
stmt attr
Ylonies Apr 18, 2026
a06fd33
retry qyery for autocommit
Ylonies Apr 18, 2026
248574a
getdiagfield + fixes
Ylonies Apr 27, 2026
06c92f3
review fixes
Ylonies May 5, 2026
9923f33
full core api tests
Ylonies May 6, 2026
cff2314
some metadata functions
Ylonies May 7, 2026
82b3bb6
erlang odbc client
Ylonies May 7, 2026
0c33d8b
fixes
Ylonies May 12, 2026
21f9ebb
fix odbc covert for chrono
Ylonies May 16, 2026
1910fa8
fix
Ylonies May 18, 2026
80a8f16
review fixes
Ylonies May 20, 2026
60197b1
refactor exec cursor prefetch and test CMake
Ylonies May 23, 2026
b7e3965
mv examples odbc
Ylonies May 23, 2026
99582c8
odbcinst.ini on build and install
Ylonies May 24, 2026
74c0da7
fix PIC for .so builds
Jun 8, 2026
8c456b4
fix odbc driver binding behaviour
Jun 10, 2026
a1dce6c
fix build
Jun 10, 2026
2da873e
fix the bind param feature
Jun 11, 2026
a7b4e4f
fix cmake pr regression
Jun 11, 2026
45e0e05
remove useless driver pool
Jun 17, 2026
6157276
driver::Stop(true):)
Jun 17, 2026
9903036
fully core-odbc compliant driver
Jun 17, 2026
bce83c2
fix the tests
Jun 18, 2026
af203b8
fix odbc core conformance
Jul 14, 2026
cc59fa8
work in progress
Jul 28, 2026
92789a7
performance is not an acceptance criteria
Jul 29, 2026
bd07057
document actual odbc limitations
Jul 30, 2026
8b5831b
create a doc with goals and restrictions
Jul 31, 2026
9fd35b0
fix qt odbc
Jul 31, 2026
4953ea5
add odbc deb package
Jul 31, 2026
156617f
run tests for odbc pull requests
Jul 31, 2026
01d0fb3
run only odbc tests for feature pull requests
Jul 31, 2026
9ccdd0c
fix driver ownership
Aug 3, 2026
791c4dd
implemented connection string authentification
Aug 4, 2026
879ba80
remove useless stats conditional
Aug 4, 2026
bf606c3
fix SQL_DIAG_ROW_COUNT
Aug 4, 2026
062fb78
fix issues and ci
Aug 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions .github/actions/prepare_vm/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ runs:
sudo apt-get -y update
sudo apt-get -y install git gdb ninja-build libidn11-dev ragel yasm libc-ares-dev libre2-dev \
rapidjson-dev zlib1g-dev libxxhash-dev libzstd-dev libsnappy-dev libgtest-dev libgmock-dev \
libbz2-dev liblz4-dev libdouble-conversion-dev libssl-dev libstdc++-13-dev gcc-13 g++-13
libbz2-dev liblz4-dev libdouble-conversion-dev libssl-dev libstdc++-13-dev gcc-13 g++-13 \
unixodbc unixodbc-dev

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10000
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 10000
Expand All @@ -28,6 +29,8 @@ runs:
if: ${{ inputs.mode == 'build' }}
shell: bash
run: |
# Static deps are linked into the shared ODBC driver; they must be built with -fPIC.
export PIC="-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
# Install ccache
(V=4.8.1; curl -L https://github.com/ccache/ccache/releases/download/v${V}/ccache-${V}-linux-x86_64.tar.xz | \
sudo tar -xJ -C /usr/local/bin/ --strip-components=1 --no-same-owner ccache-${V}-linux-x86_64/ccache)
Expand All @@ -48,7 +51,7 @@ runs:
tar -xvzf abseil-cpp-20230802.0.tar.gz
cd abseil-cpp-20230802.0
mkdir build && cd build
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_BUILD_TYPE=Release -DABSL_PROPAGATE_CXX_STD=ON ..
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_BUILD_TYPE=Release -DABSL_PROPAGATE_CXX_STD=ON ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/absl
cd ../../
Expand All @@ -59,7 +62,7 @@ runs:
cd protobuf-25.0
mkdir build && cd build
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_PREFIX_PATH="${HOME}/ydb_deps/absl" -DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_INSTALL=ON -Dprotobuf_ABSL_PROVIDER=package ..
-Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_INSTALL=ON -Dprotobuf_ABSL_PROVIDER=package ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/protobuf
cd ../../
Expand All @@ -68,7 +71,7 @@ runs:
wget -O grpc-1.60.2.tar.gz https://github.com/grpc/grpc/archive/refs/tags/v1.60.2.tar.gz
tar -xvzf grpc-1.60.2.tar.gz && cd grpc-1.60.2
mkdir build && cd build
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_PREFIX_PATH="${HOME}/ydb_deps/absl;${HOME}/ydb_deps/protobuf" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 \
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_PREFIX_PATH="${HOME}/ydb_deps/absl;${HOME}/ydb_deps/protobuf" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 ${PIC} \
-DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ABSL_PROVIDER=package \
Expand All @@ -78,17 +81,26 @@ runs:
cmake --install . --config Release --prefix ~/ydb_deps/grpc
cd ../../

# Install base64
wget -O base64-0.5.2.tar.gz https://github.com/aklomp/base64/archive/refs/tags/v0.5.2.tar.gz
tar -xvzf base64-0.5.2.tar.gz && cd base64-0.5.2
mkdir build && cd build
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_BUILD_TYPE=Release ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/base64
cd ../../

# Install brotli
wget -O brotli-1.1.0.tar.gz https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz
tar -xvzf brotli-1.1.0.tar.gz && cd brotli-1.1.0
mkdir build && cd build
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_BUILD_TYPE=Release ..
cmake -G Ninja ${ENABLE_CCACHE} -DCMAKE_BUILD_TYPE=Release ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/brotli
cd ../../

# Clean up
ccache -s
sudo rm -rf llvm.sh abseil-cpp-20230802.0.tar.gz protobuf-25.0.tar.gz grpc-1.60.2.tar.gz \
brotli-1.1.0.tar.gz abseil-cpp-20230802.0 \
protobuf-25.0 grpc-1.60.2 brotli-1.1.0
base64-0.5.2.tar.gz brotli-1.1.0.tar.gz abseil-cpp-20230802.0 \
protobuf-25.0 grpc-1.60.2 base64-0.5.2 brotli-1.1.0
18 changes: 15 additions & 3 deletions .github/scripts/run_iam_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

IAM_REGEX='^(DriverAuth|TMetadataFixture|TJwtIamFixture|TOAuthIamFixture|OAuth_WithFacility)\.'
IAM_REGEX='^(DriverAuth|TMetadataFixture|TJwtIamFixture|TOAuthIamFixture|OAuth_WithFacility|OdbcAuthentication)\.'
IAM_CONTAINER_NAME="${IAM_CONTAINER_NAME:-ydb-iam}"
IAM_CTEST_JOBS="${IAM_CTEST_JOBS:-2}"
IAM_READY_ATTEMPTS="${IAM_READY_ATTEMPTS:-60}"
Expand All @@ -16,7 +16,7 @@ cleanup_iam() {
wait_for_iam_ydb() {
for _ in $(seq 1 "${IAM_READY_ATTEMPTS}"); do
if docker exec -e "YDB_TOKEN=${IAM_TOKEN}" "${IAM_CONTAINER_NAME}" /ydb \
--endpoint grpc://localhost:2136 \
--endpoint grpc://localhost:2236 \
--database /local \
sql -s 'select 1' >/dev/null 2>&1; then
return 0
Expand All @@ -29,19 +29,31 @@ wait_for_iam_ydb() {
return 1
}

provision_odbc_static_user() {
docker exec -e "YDB_TOKEN=${IAM_TOKEN}" "${IAM_CONTAINER_NAME}" /ydb \
--endpoint grpc://localhost:2236 \
--database /local \
sql -s "CREATE USER odbcauth PASSWORD '12345678'"
}

trap cleanup_iam EXIT
cleanup_iam

docker run -d --name "${IAM_CONTAINER_NAME}" --hostname localhost \
-p 2235:2135 -p 2236:2136 -p 28765:8765 \
-p 2235:2235 -p 2236:2236 -p 28765:28765 \
-v /tmp/ydb_iam_certs:/ydb_certs \
-e GRPC_TLS_PORT=2235 \
-e GRPC_PORT=2236 \
-e MON_PORT=28765 \
-e YDB_USE_IN_MEMORY_PDISKS=true \
-e YDB_TABLE_ENABLE_PREPARED_DDL=true \
-e YDB_ENFORCE_USER_TOKEN_REQUIREMENT=true \
-e YDB_DEFAULT_CLUSTERADMIN=root@builtin \
ghcr.io/ydb-platform/local-ydb:trunk

wait_for_iam_ydb
provision_odbc_static_user

YDB_ENDPOINT=localhost:2236 YDB_DATABASE=/local \
YDB_ODBC_STATIC_USER=odbcauth YDB_ODBC_STATIC_PASSWORD=12345678 \
ctest -j"${IAM_CTEST_JOBS}" --test-dir build -R "${IAM_REGEX}" --output-on-failure
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: |
set -euo pipefail

IAM_REGEX='^(DriverAuth|TMetadataFixture|TJwtIamFixture|TOAuthIamFixture|OAuth_WithFacility)\.'
IAM_REGEX='^(DriverAuth|TMetadataFixture|TJwtIamFixture|TOAuthIamFixture|OAuth_WithFacility|OdbcAuthentication)\.'
FLAKY_REGEX='(ManyMessages|DiscoveryHang|DescribeHang)'
EXCLUDE_REGEX="${IAM_REGEX}|${FLAKY_REGEX}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
id: deb-package-cache-key
shell: bash
run: |
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'odbc/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"

- name: Restore Debian package build cache
uses: actions/cache/restore@v4
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- odbc-driver-feature
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand Down Expand Up @@ -54,9 +55,15 @@ jobs:
with:
compiler: ${{ matrix.compiler }}
- name: Test
if: github.event_name != 'pull_request' || github.base_ref == 'main'
shell: bash
run: |
ctest -j$(nproc) --preset unit
- name: Test ODBC
if: github.event_name == 'pull_request' && github.base_ref == 'odbc-driver-feature'
shell: bash
run: |
ctest --test-dir build/odbc/tests/unit -j$(nproc) --output-on-failure
- name: Package integration build
shell: bash
run: |
Expand Down Expand Up @@ -132,9 +139,10 @@ jobs:
tar -C build -xzf "integration-build-${{ matrix.compiler }}.tar.gz"
tar -C "$HOME" -xzf "integration-deps-${{ matrix.compiler }}.tar.gz"
- name: Test
if: github.event_name != 'pull_request' || github.base_ref == 'main'
shell: bash
run: |
IAM_REGEX='^(DriverAuth|TMetadataFixture|TJwtIamFixture|TOAuthIamFixture|OAuth_WithFacility)\.'
IAM_REGEX='^(DriverAuth|TMetadataFixture|TJwtIamFixture|TOAuthIamFixture|OAuth_WithFacility|OdbcAuthentication)\.'

YDB_VERSION=${{ matrix.ydb-version }} ctest -j2 --preset integration \
-E "${IAM_REGEX}" --output-on-failure
Expand All @@ -144,8 +152,22 @@ jobs:
./.github/scripts/run_iam_integration_tests.sh
;;
esac
- name: Test ODBC
if: github.event_name == 'pull_request' && github.base_ref == 'odbc-driver-feature'
shell: bash
run: |
YDB_VERSION=${{ matrix.ydb-version }} \
ctest --test-dir build/odbc/tests/integration -j2 \
-E '^OdbcAuthentication\.' --output-on-failure

case '${{ matrix.ydb-version }}' in
25.1|trunk)
./.github/scripts/run_iam_integration_tests.sh
;;
esac

test-install:
if: github.event_name != 'pull_request' || github.base_ref == 'main'
name: "Test CMake Install"
concurrency:
group: test-install-${{ github.ref }}-${{ matrix.compiler }}
Expand Down Expand Up @@ -228,7 +250,7 @@ jobs:
id: deb-package-cache-key
shell: bash
run: |
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'odbc/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"

- name: Validate dpkg-buildpackage
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/warmup_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
id: deb-package-cache-key
shell: bash
run: |
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'odbc/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"
- name: Restore Debian package build cache
id: deb-package-cache
uses: actions/cache/restore@v4
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ option(YDB_SDK_EXAMPLES "Build YDB C++ SDK examples" On)
option(YDB_SDK_ENABLE_OTEL_METRICS "Build OpenTelemetry metrics plugin" Off)
option(YDB_SDK_ENABLE_OTEL_TRACE "Build OpenTelemetry trace plugin" Off)
option(YDB_CPP_SDK_SLO_USE_INSTALLED_SDK "Build only SLO workloads against an installed ydb-cpp-sdk package" Off)
option(YDB_SDK_ODBC "Build YDB ODBC driver" Off)
if (YDB_SDK_ODBC)
# ODBC driver is a shared library; static archives linked into it must be PIC.
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "" FORCE)
endif()
set(YDB_SDK_GOOGLE_COMMON_PROTOS_TARGET "" CACHE STRING "Name of cmake target preparing google common proto library")
option(YDB_SDK_USE_RAPID_JSON "Search for rapid json library in system" ON)

Expand Down Expand Up @@ -85,6 +90,10 @@ add_subdirectory(plugins)

#_ydb_sdk_validate_public_headers()

if (YDB_SDK_ODBC)
add_subdirectory(odbc)
endif()

if (YDB_SDK_EXAMPLES)
add_subdirectory(examples)
endif()
Expand Down
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"cacheVariables": {
"YDB_SDK_TESTS": "TRUE",
"YDB_SDK_EXAMPLES": "TRUE",
"YDB_SDK_ODBC": "TRUE",
"ARCADIA_ROOT": "..",
"ARCADIA_BUILD_ROOT": "."
}
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,18 @@ match the dependency set published with that gRPC release:
These pins are shared by regular CI builds, SLO workload images, and the
development container.

When building with `YDB_SDK_ODBC=ON` (included in the `release-test-*` presets), the ODBC
driver is a shared library. Static dependencies installed under `~/ydb_deps` must be built
with position-independent code (`-DCMAKE_POSITION_INDEPENDENT_CODE=ON`).

```bash
sudo apt-get -y update
sudo apt-get -y install git gdb ninja-build libidn11-dev ragel yasm libc-ares-dev libre2-dev \
rapidjson-dev zlib1g-dev libxxhash-dev libzstd-dev libsnappy-dev libgtest-dev libgmock-dev \
libbz2-dev liblz4-dev libdouble-conversion-dev libssl-dev libstdc++-13-dev gcc-13 g++-13
libbz2-dev liblz4-dev libdouble-conversion-dev libssl-dev libstdc++-13-dev gcc-13 g++-13 \
unixodbc unixodbc-dev

PIC="-DCMAKE_POSITION_INDEPENDENT_CODE=ON"

wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
Expand All @@ -72,7 +79,7 @@ wget -O abseil-cpp-20230802.0.tar.gz https://github.com/abseil/abseil-cpp/archiv
tar -xvzf abseil-cpp-20230802.0.tar.gz
cd abseil-cpp-20230802.0
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DABSL_PROPAGATE_CXX_STD=ON ..
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DABSL_PROPAGATE_CXX_STD=ON ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/absl
cd ../../
Expand All @@ -83,7 +90,7 @@ tar -xvzf protobuf-25.0.tar.gz
cd protobuf-25.0
mkdir build && cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$HOME/ydb_deps/absl" -DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_INSTALL=ON -Dprotobuf_ABSL_PROVIDER=package ..
-Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_INSTALL=ON -Dprotobuf_ABSL_PROVIDER=package ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/protobuf
cd ../../
Expand All @@ -92,7 +99,7 @@ cd ../../
wget -O grpc-1.60.2.tar.gz https://github.com/grpc/grpc/archive/refs/tags/v1.60.2.tar.gz
tar -xvzf grpc-1.60.2.tar.gz && cd grpc-1.60.2
mkdir build && cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$HOME/ydb_deps/absl;$HOME/ydb_deps/protobuf" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 \
cmake -G Ninja -DCMAKE_PREFIX_PATH="${HOME}/ydb_deps/absl;${HOME}/ydb_deps/protobuf" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 ${PIC} \
-DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ABSL_PROVIDER=package \
Expand All @@ -106,7 +113,7 @@ cd ../../
wget -O base64-0.5.2.tar.gz https://github.com/aklomp/base64/archive/refs/tags/v0.5.2.tar.gz
tar -xvzf base64-0.5.2.tar.gz && cd base64-0.5.2
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/base64
cd ../../
Expand All @@ -115,7 +122,7 @@ cd ../../
wget -O brotli-1.1.0.tar.gz https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz
tar -xvzf brotli-1.1.0.tar.gz && cd brotli-1.1.0
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${PIC} \
-DCMAKE_INSTALL_PREFIX="$HOME/ydb_deps/brotli" ..
cmake --build . --config Release
cmake --install . --config Release
Expand All @@ -125,7 +132,7 @@ cd ../../
wget -O jwt-cpp-0.7.0.tar.gz https://github.com/Thalhammer/jwt-cpp/archive/refs/tags/v0.7.0.tar.gz
tar -xvzf jwt-cpp-0.7.0.tar.gz && cd jwt-cpp-0.7.0
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${PIC} ..
cmake --build . --config Release
cmake --install . --config Release --prefix ~/ydb_deps/jwt-cpp
cd ../../
Expand Down Expand Up @@ -241,12 +248,17 @@ wget "${BASE}/libydb-cpp-dev_${TAG#v}_amd64.deb"
wget "${BASE}/libydb-cpp-iam-dev_${TAG#v}_amd64.deb"
wget "${BASE}/libydb-cpp-otel-metrics-dev_${TAG#v}_amd64.deb"
wget "${BASE}/libydb-cpp-otel-tracing-dev_${TAG#v}_amd64.deb"
# Optional ODBC driver:
wget "${BASE}/ydb-odbc_${TAG#v}_amd64.deb"

sudo apt-get update
sudo apt-get install -y \
./yandex-googleapis-api-common-protos-*.deb \
./libydb-cpp-dev_*.deb ./libydb-cpp-iam-dev_*.deb \
./libydb-cpp-otel-metrics-dev_*.deb ./libydb-cpp-otel-tracing-dev_*.deb
./libydb-cpp-otel-metrics-dev_*.deb ./libydb-cpp-otel-tracing-dev_*.deb \
./ydb-odbc_*.deb

odbcinst -q -d -n YDB
```

After installation, use the SDK in your CMake project:
Expand Down
15 changes: 15 additions & 0 deletions cmake/PackSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ set(CPACK_RESOURCE_FILE_LICENSE "${YDB_SDK_SOURCE_DIR}/LICENSE")

set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL libydb-cpp libydb-cpp-iam libydb-cpp-otel-metrics libydb-cpp-otel-tracing)
if (YDB_SDK_ODBC)
list(APPEND CPACK_COMPONENTS_ALL ydb-odbc)
endif()

set(CPACK_DEBIAN_LIBYDB_CPP_PACKAGE_NAME "libydb-cpp-dev")
set(CPACK_DEBIAN_LIBYDB_CPP_PACKAGE_DEPENDS
Expand All @@ -34,6 +37,18 @@ set(CPACK_DEBIAN_LIBYDB_CPP_OTEL_TRACING_PACKAGE_NAME "libydb-cpp-otel-tracing-d
set(CPACK_DEBIAN_LIBYDB_CPP_OTEL_TRACING_PACKAGE_DEPENDS
"libydb-cpp-dev (= ${YDB_SDK_VERSION}), libydb-cpp-otel-metrics-dev (= ${YDB_SDK_VERSION})")

if (YDB_SDK_ODBC)
set("CPACK_DEBIAN_YDB-ODBC_PACKAGE_NAME" "ydb-odbc")
set("CPACK_DEBIAN_YDB-ODBC_PACKAGE_DEPENDS" "odbcinst")
set("CPACK_DEBIAN_YDB-ODBC_PACKAGE_SHLIBDEPS" ON)
set("CPACK_DEBIAN_YDB-ODBC_PACKAGE_CONTROL_EXTRA"
"${YDB_ODBC_DEBIAN_CONTROL_EXTRA}")
set("CPACK_DEBIAN_YDB-ODBC_PACKAGE_CONTROL_STRICT_PERMISSION" ON)
set("CPACK_DEBIAN_YDB-ODBC_PACKAGE_SECTION" "database")
set("CPACK_DEBIAN_YDB-ODBC_DESCRIPTION"
"YDB ODBC driver\n Shared ODBC driver and unixODBC registration for YDB.")
endif()

foreach(component IN ITEMS libydb-cpp libydb-cpp-iam libydb-cpp-otel-metrics libydb-cpp-otel-tracing)
string(TOUPPER "${component}" component_upper)
string(REPLACE "-" "_" component_var "${component_upper}")
Expand Down
Loading
Loading