stateless tipg: remove `collection_catalog`
@bitner đang làm issue này rồi.
Từ ngày 16/3/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Since the start of tifeature/timvt/tipg, we designed the application with having a list of the available collections/layers stored in the application State: https://github.com/developmentseed/tipg/blob/489f0243b0b4f0d46d12f06a1baf0bccc1d4232a/tipg/db.py#L83
This gave some advantages:
- cost of running the collection listing is only paid once (at startup)
- we know what are the available collection so we can raise useful error if the user input collection is not in the list https://github.com/developmentseed/tipg/blob/489f0243b0b4f0d46d12f06a1baf0bccc1d4232a/tipg/dependencies.py#L40-L43
- cheap collection filtering https://github.com/developmentseed/tipg/blob/main/tipg/factory.py#L439-L458
The collection_catalog is created at application startup https://github.com/developmentseed/tipg/blob/489f0243b0b4f0d46d12f06a1baf0bccc1d4232a/tipg/main.py#L65-L80 because we assumed it's a pretty costly process.
The problem then (as explained in https://github.com/developmentseed/eoAPI/pull/55#issuecomment-1471006644) is when you have changed in the DB (e.g new table) it won't show up in the application because the catalog is now updated.
Proposal
- remove
collection_catalog - create a clean SQL function which will list the collections
- the function should accept
id(to return only one collection),limit,offset,spatial_filterandtemporal_filter
cc @bitner
- Ngôn ngữ chính
- PLpgSQL
- Star
- 224
- Fork
- 39
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của developmentseed/tipg
-
New MLT vector formatĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
developmentseed/tipg#248 · 1 reaction ·
-
add support for JSONB column searchCó thể làm lại được @bitner đã nhận 285 ngày trước và không có pull request nào đang mở. Đang mở
developmentseed/tipg#247 · 2 người được giao ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
developmentseed/tipg#241 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
developmentseed/tipg#240 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
developmentseed/tipg#228 · 3 bình luận ·