Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Go version, unify errors and other refactoring #187

Merged
merged 14 commits into from
Mar 21, 2024

Conversation

taniabogatsch
Copy link
Collaborator

New error functions

This PR adds a new file, errors.go, which unifies driver error messages by introducing two new functions: getError and getDuckDBError. For now, I've only used the new error functions in duckdb.go, but if this is a sensible proposal, I'll open more PRs to unify errors throughout the driver.

Other changes

@marcboeker, let me know what you think. :)

  • con *C.duckdb_connection becomes duckdbConn C.duckdb_connection, as it already is a pointer.
  • renamed the type conn to connection, to avoid shadowing when using the variable name conn.

@taniabogatsch taniabogatsch changed the title Uniform errors and other refactoring Bump Go version, unify errors and other refactoring Mar 20, 2024
Copy link
Owner

@marcboeker marcboeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactoring and centralized errors. I've added some minor comments.

errors.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
appender.go Outdated Show resolved Hide resolved
connection.go Outdated Show resolved Hide resolved
errors_test.go Outdated Show resolved Hide resolved
@taniabogatsch
Copy link
Collaborator Author

taniabogatsch commented Mar 21, 2024

It looks like our freebsd tests cannot be compiled to 1.22, so I'll revert back to 1.21.

  gmake test
  /usr/bin/bash /home/runner/work/_actions/vmactions/freebsd-vm/v1/run.sh execSSHSH
  Config file: freebsd-14.0.conf
  go test -v -race -count=1 .
  go: downloading github.com/apache/arrow/go/v14 v14.0.2
...
  go: downloading github.com/klauspost/cpuid/v2 v2.2.5
  github.com/marcboeker/go-duckdb: cannot compile Go 1.22 code
  FAIL	github.com/marcboeker/go-duckdb [build failed]
  FAIL
  gmake: *** [Makefile:14: test] Error 1

@marcboeker
Copy link
Owner

Thanks for the modifications.

@marcboeker marcboeker merged commit e4e08e9 into marcboeker:main Mar 21, 2024
4 checks passed
@taniabogatsch taniabogatsch deleted the unify-errors branch March 22, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants