Skip to content

Riskified/libsnowflakeclient

 
 

Repository files navigation

Snowflake Connector for C/C++

https://github.com/snowflakedb/libsnowflakeclient/workflows/Build%20and%20Test/badge.svg?branch=master

Under development. No functionality works. Suggestion is welcome at any time.

Build and Tests

Build

Ensure you have cmake 2.8 or later version.

Linux and OSX

./scripts/build_libsnowflakeclient.sh

Windows

Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS14, VS15, VS16] and run the script.

set platform=x64
set build_type=Debug
set vs_version=VS14
ci\build.bat

Prepare for Test

Set the Snowflake connection info in parameters.json and place it in $HOME:

{
    "testconnection": {
        "SNOWFLAKE_TEST_USER":      "<your_user>",
        "SNOWFLAKE_TEST_PASSWORD":  "<your_password>",
        "SNOWFLAKE_TEST_ACCOUNT":   "<your_account>",
        "SNOWFLAKE_TEST_WAREHOUSE": "<your_warehouse>",
        "SNOWFLAKE_TEST_DATABASE":  "<your_database>",
        "SNOWFLAKE_TEST_SCHEMA":    "<your_schema>",
        "SNOWFLAKE_TEST_ROLE":      "<your_role>"
    }
}

Proxy

Libsnowflakeclient supports HTTP and HTTPS proxy connections using environment variables. To use a proxy server configure the following environment variables:

  • http_proxy
  • https_proxy
  • no_proxy
export http_proxy="[protocol://][user:password@]machine[:port]"
export https_proxy="[protocol://][user:password@]machine[:port]"

More info can be found on the libcurl tutorial page.

Run Tests

Run the tests. The test parameter environment variables will be set automatically.

Linux and OSX

./scripts/run_tests.sh

Windows

Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS14, VS15, VS16] and run the script.

set platform=x64
set build_type=Debug
set vs_version=VS14
ci\test.bat

Profiling (Linux and OSX)

If you want to use gprof, add -p option to the build script, run a test program followed by gprof, for example:

./scripts/build_libsnowflakeclient.sh -p
./cmake-build/examples/ex_connect
gprof ./cmake-build/examples/ex_connect gmon.out

Check memory leak by Valgrind (Linux)

Use valgrind to check memory leak.

./scripts/build_libsnowflakeclient.sh
valgrind --leak-check=full ./cmake-build/examples/ex_connect

and verify no error in the output:

ERROR SUMMARY: 0 errors from 0 contexts ...

Packages

No packages published

Languages

  • C 54.3%
  • C++ 32.9%
  • Shell 5.4%
  • Batchfile 3.4%
  • CMake 2.1%
  • JavaScript 0.8%
  • Other 1.1%