Skip to content

Commit

Permalink
fix(go/adbc/pkg): export Adbc* symbols on Windows
Browse files Browse the repository at this point in the history
Fixes #898.
  • Loading branch information
lidavidm committed Jul 19, 2023
1 parent 32c3f15 commit be3b855
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
6 changes: 5 additions & 1 deletion go/adbc/pkg/_tmpl/driver.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

package main

// #cgo CXXFLAGS: -std=c++11
// ADBC_EXPORTING is required on Windows, or else the symbols
// won't be accessible to the driver manager

// #cgo CFLAGS: -DADBC_EXPORTING
// #cgo CXXFLAGS: -std=c++11 -DADBC_EXPORTING
// #include "../../drivermgr/adbc.h"
// #include "utils.h"
// #include <stdint.h>
Expand Down
6 changes: 5 additions & 1 deletion go/adbc/pkg/flightsql/driver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion go/adbc/pkg/panicdummy/driver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion go/adbc/pkg/snowflake/driver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions python/adbc_driver_flightsql/tests/test_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,25 @@
# under the License.

import pyarrow
import pytest

import adbc_driver_flightsql
import adbc_driver_manager


def test_load_driver():
# Fails, but in environments where we don't spin up testing
# servers, this checks that we can at least *load* the driver
with pytest.raises(
adbc_driver_manager.OperationalError, match="Error while dialing"
):
with adbc_driver_flightsql.connect("grpc://127.0.0.100:12345") as db:
with adbc_driver_manager.AdbcConnection(db) as conn:
with adbc_driver_manager.AdbcStatement(conn) as stmt:
stmt.set_sql_query("SELECT 1")
stmt.execute_query()


def test_query_trivial(dremio):
with adbc_driver_manager.AdbcStatement(dremio) as stmt:
stmt.set_sql_query("SELECT 1")
Expand Down
8 changes: 8 additions & 0 deletions python/adbc_driver_snowflake/tests/test_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def snowflake(snowflake_uri: str):
yield conn


def test_load_driver():
# Fails, but in environments where we don't spin up testing
# servers, this checks that we can at least *load* the driver
with pytest.raises(adbc_driver_manager.ProgrammingError, match="account is empty"):
with adbc_driver_snowflake.connect(""):
pass


def test_query_trivial(snowflake):
with adbc_driver_manager.AdbcStatement(snowflake) as stmt:
stmt.set_sql_query("SELECT 1")
Expand Down

0 comments on commit be3b855

Please # to comment.