Skip to content

Conversation

@adi-QTPi
Copy link
Contributor

@adi-QTPi adi-QTPi commented Feb 2, 2026

resolves #3 and #4

Signed-off-by: karma <captainav0608@gmail.com>
Signed-off-by: karma <captainav0608@gmail.com>
Signed-off-by: karma <captainav0608@gmail.com>
Signed-off-by: karma <captainav0608@gmail.com>
Signed-off-by: karma <captainav0608@gmail.com>
@adi-QTPi adi-QTPi changed the title Karma/db service Database and Secret service Implementation Feb 7, 2026
@adi-QTPi adi-QTPi marked this pull request as ready for review February 7, 2026 22:37
Signed-off-by: karma <captainav0608@gmail.com>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Combine Create, Update, Upsert

SecretColUpdatedAt = "updated_at"
)

type Secret struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Look at gorm implementations on how validation strings work.


// NOTE : the values of constants must be consistent to the "column" in gorm tags.
const (
// table name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as secret.go

WebhookColUpdatedAt = "updated_at"
)

type Webhook struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as secret.go

}

func (s *secretStore) Create(ctx context.Context, secrets []models.Secret) error {
if ctx.Err() != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should/Can we use ctx.Done channel here.

Copy link
Contributor Author

@adi-QTPi adi-QTPi Feb 11, 2026

Choose a reason for hiding this comment

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

using the channel would result in writing a dedicated select block in each of the function, where the default case would be the execution part. also in the error we will have to pass ctx.Err anyways.

checking ctx.Err() directly is comparitively straighforward and readable.


db-run:
@echo "Starting database container '$(DB_CONTAINER_NAME)' on port $(DB_PORT)..."
docker run --name $(DB_CONTAINER_NAME) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

make a bind mount for the db data

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also add --rm

makefile Outdated
@@ -0,0 +1,26 @@
DB_CONTAINER_NAME=shogun_db
DB_PORT=5434
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use default postgres port for now

Signed-off-by: karma <captainav0608@gmail.com>
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.

Create the Secret Management service

2 participants