It focuses on unifying the error handling in the Appender. Additionally, errors in the Appender no longer kill the application (panic) and have a unified format.
I'm happy that even with the introduction of new tests, this PR decreases the overall code size of the Appender and its tests. 😄 Sorry for the big PR - I've tried to keep the complexity low. Many changes are repetitive (using new functions) and structural.
Other changes
unified variable name refactoring according to their type definitions and methods (e.g., connector -> c, appender -> a, appender *C.duckdb_appender -> duckdbAppender C.duckdb_appender).
added missing C.duckdb_appender_destroy(&duckdbAppender) when the appender's column type initialization fails to avoid leaks.
removed duplicate code in appender_test.go by introducing a new function: cleanupAppender.
moved error-tests from appender_test.go to errors_test.go.
This is the first follow-up PR to https://github.com/marcboeker/go-duckdb/pull/187.
It focuses on unifying the error handling in the
Appender
. Additionally, errors in theAppender
no longer kill the application (panic
) and have a unified format.I'm happy that even with the introduction of new tests, this PR decreases the overall code size of the
Appender
and its tests. 😄 Sorry for the big PR - I've tried to keep the complexity low. Many changes are repetitive (using new functions) and structural.Other changes
connector -> c
,appender -> a
,appender *C.duckdb_appender -> duckdbAppender C.duckdb_appender
).C.duckdb_appender_destroy(&duckdbAppender)
when the appender's column type initialization fails to avoid leaks.appender_test.go
by introducing a new function:cleanupAppender
.appender_test.go
toerrors_test.go
.