Skip to content

chore: add make setup target for DuckDB initialization#4

Open
KristjanESPERANTO wants to merge 1 commit intomfdz:mainfrom
KristjanESPERANTO:setup
Open

chore: add make setup target for DuckDB initialization#4
KristjanESPERANTO wants to merge 1 commit intomfdz:mainfrom
KristjanESPERANTO:setup

Conversation

@KristjanESPERANTO
Copy link
Contributor

@KristjanESPERANTO KristjanESPERANTO commented Feb 1, 2026

Motivation

I tried running this repo and hit an error on first make compare:

CatalogException: Table Function with name "st_read" is not in the catalog,
but it exists in the spatial extension.

The DuckDB spatial extension needs to be installed manually but wasn't documented or automated. This PR fixes that.

Changes

  • Add make setup target to install Python dependencies
  • Modify db_$(COUNTRY).db target to automatically install DuckDB spatial extension before running SQLMesh
  • Add scripts/setup_duckdb.py to automate spatial extension installation
  • Add explicit duckdb>=1.0.0 dependency to requirements.txt
  • Update README with setup instructions

The spatial extension is now automatically installed when creating the database, no manual intervention needed.

Usage

# Once after cloning
make setup

# Then as usual
make download
make compare      # Now automatically installs spatial extension
make generate-reports

Copy link
Member

@hbruch hbruch left a comment

Choose a reason for hiding this comment

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

Hm, that's strange. I expected sqlmesh to handle the install implicitly as spatial is defined as extension in config.yaml. Let me check this out...

- Add explicit duckdb dependency to requirements.txt
- Add setup_duckdb.py script to install spatial extension
- Add setup target to Makefile
- Update README with setup instructions

Fixes spatial extension error on first run.
@KristjanESPERANTO
Copy link
Contributor Author

Maybe I'm doing something wrong, I've never had anything to do with DuckDB before.

I just resolved the merge conflict.

@KristjanESPERANTO KristjanESPERANTO changed the title chore: add make setup target for DuckDB initialization chore: add make setup target for DuckDB initialization Feb 16, 2026
@hbruch
Copy link
Member

hbruch commented Feb 16, 2026

Another explanation might be that on my system, it was semi initialized before. I'll try to reproduce.

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.

2 participants