hashicorp / hashicorp/go-dbw

Delete for composite PK resource doesn't work for sqlite

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
18
Forks
4
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Resources with composite PKs can't be deleted using `RW.Delete(...)` since the SQL generated is incorrect. See: https://github.com/go-gorm/gorm/issues/4879

**To Reproduce**

In delete_test.go/TestDb_Delete(...) remove conditional in `multi-column` test that skips sqlite dialects and the test will fail.

**Additional context**

Once https://github.com/go-gorm/gorm/issues/4879 is fixed, we can update the gorm dependency and enable the `multi-column` delete test for sqlite

Contributor guide

Open the contributing guide

Research direction

Start with delete_test.go and TestDb_Delete, focusing on the multi-column case and its sqlite skip. Check the linked GORM issue 4879 and the dependency version before changing the test. Done means the dependency includes the upstream fix and the multi-column delete test runs successfully for sqlite.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.