You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
현재 파일 업로드 관련된 Supabase 의 스토리지 API 가 만약 실패했을 때에는, DB 에 데이터를 insert 하지 않지만,
만약 Supabase 의 스토리지 API 가 성공하였지만, DB 에 데이터를 insert 하는게 실패했을때에는 스토리지에 데이터가 남아있게됨
Describe the solution you'd like
파일 업로드와 관련된 작업은 Supabase의 스토리지 API를 사용하는 것으로, 이는 데이터베이스 트랜잭션과는 별도로 처리됩니다.
따라서 파일 업로드와 데이터베이스 삽입을 모두 하나의 트랜잭션으로 묶는 것은 일반적으로 불가능합니다.
하지만, 데이터베이스 작업 자체는 트랜잭션으로 묶을 수 있습니다.
다음과 같은 방법으로 코드를 수정할 수 있습니다:
파일 업로드가 성공한 후에 데이터베이스 작업을 트랜잭션으로 묶습니다.
데이터베이스 트랜잭션이 실패하면 업로드된 파일을 삭제하는 방식으로 일관성을 유지할 수 있습니다.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Is your feature request related to a problem? Please describe.
현재 파일 업로드 관련된 Supabase 의 스토리지 API 가 만약 실패했을 때에는, DB 에 데이터를 insert 하지 않지만,
만약 Supabase 의 스토리지 API 가 성공하였지만, DB 에 데이터를 insert 하는게 실패했을때에는 스토리지에 데이터가 남아있게됨
Describe the solution you'd like
파일 업로드와 관련된 작업은 Supabase의 스토리지 API를 사용하는 것으로, 이는 데이터베이스 트랜잭션과는 별도로 처리됩니다.
따라서 파일 업로드와 데이터베이스 삽입을 모두 하나의 트랜잭션으로 묶는 것은 일반적으로 불가능합니다.
하지만, 데이터베이스 작업 자체는 트랜잭션으로 묶을 수 있습니다.
다음과 같은 방법으로 코드를 수정할 수 있습니다:
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
https://supabase.com/docs/guides/storage
The text was updated successfully, but these errors were encountered: