fix: improve Makefile and duckdb.go for better environment handling

- Updated the Makefile to export the EDITION variable for the lite build process, ensuring proper environment setup.
- Added a defer statement in duckdb.go to ensure the SQL database connection is closed after use, improving resource management.

These changes enhance the build process and resource handling in the application.
This commit is contained in:
wizardchen
2026-02-28 16:12:44 +08:00
committed by lyingbug
parent 7b7017ec03
commit 2a5cf57589
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -248,8 +248,9 @@ build-lite:
else \
echo ">> No frontend/package.json, skipping frontend"; \
fi
EDITION=lite eval "$$(./scripts/get_version.sh env)"; \
LDFLAGS="$$(EDITION=lite ./scripts/get_version.sh ldflags)"; \
export EDITION=lite; \
eval "$$(./scripts/get_version.sh env)"; \
LDFLAGS="$$(./scripts/get_version.sh ldflags)"; \
CGO_ENABLED=1 \
CGO_CFLAGS="-Wno-deprecated-declarations" \
CGO_LDFLAGS="-Wl,-no_warn_duplicate_libraries" \
+1
View File
@@ -14,6 +14,7 @@ func downloadSpatial() {
if err != nil {
panic(err)
}
defer sqlDB.Close()
// Try to install spatial extension (may already be installed or network unavailable)
installSQL := "INSTALL spatial;"