Skip to content

Commit

Permalink
Generating SQLite code via sqlc and refactoring local store to levera…
Browse files Browse the repository at this point in the history
…ge generated code.

# Conflicts:
#	sdk/component/store/local/store.go
  • Loading branch information
andream16 committed Dec 16, 2024
1 parent 1db57ef commit 4043283
Show file tree
Hide file tree
Showing 12 changed files with 485 additions and 66 deletions.
6 changes: 0 additions & 6 deletions sdk/component/store/local/enum.go

This file was deleted.

52 changes: 0 additions & 52 deletions sdk/component/store/local/enum_enum.go

This file was deleted.

31 changes: 31 additions & 0 deletions sdk/component/store/local/sqlite/sqlc/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/component/store/local/sqlite/sqlc/migrations/package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// empty file used to track migrations
package migrations
17 changes: 17 additions & 0 deletions sdk/component/store/local/sqlite/sqlc/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions sdk/component/store/local/sqlite/sqlc/query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- name: FindingsByID :many
SELECT id, details
FROM finding
WHERE instance_id = ?
;

-- name: CreateFinding :exec
INSERT INTO finding (instance_id, details)
VALUES (?, ?)
;

-- name: UpdateFinding :one
UPDATE finding
SET
details = ?,
updated_at = ?
WHERE
instance_id = ? AND
id = ?
RETURNING *
;
100 changes: 100 additions & 0 deletions sdk/component/store/local/sqlite/sqlc/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4043283

Please sign in to comment.