Giter Club home page Giter Club logo

Comments (3)

kylebarron avatar kylebarron commented on August 23, 2024 1

Once I've deleted all rows in data.items where collection_id equals the identifier, then the DELETE request works fine.

from stac-fastapi.

geospatial-jeff avatar geospatial-jeff commented on August 23, 2024 1

Sqlalchemy has support for a delete cascade which deletes all of the children first, but we decided not to implement it for reasons I can't remember at the moment.

It would also be nicer to respond with a more accurate error message, since the collection does indeed exist.

We are definitely overloading the ForeignKeyViolation (https://github.com/arturo-ai/arturo-stac-api/blob/7d4c9572981e935de2521441878f3ffb78f6b9b7/stac_api/clients/postgres/session.py#L30-L31) exception. I'll create an issue for this.

from stac-fastapi.

kylebarron avatar kylebarron commented on August 23, 2024

I think I found my issue here. I assumed that if you did an HTTP DELETE request on a collection it would delete all the items in the collection, but that’s not the case.

Here I tried to delete a collection that contains some items:
image

Here's the log from the server:
image

So I gather that it's necessary to first delete all the items before you delete the collection. It would also be nicer to respond with a more accurate error message, since the collection does indeed exist.

from stac-fastapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.