aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/data/get.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/data/get.go')
-rw-r--r--pkg/data/get.go18
1 files changed, 8 insertions, 10 deletions
diff --git a/pkg/data/get.go b/pkg/data/get.go
index 09d4587..8dafb24 100644
--- a/pkg/data/get.go
+++ b/pkg/data/get.go
@@ -108,6 +108,8 @@ func (f *FillMany) documents(ctx context.Context, rows *sql.Rows) error {
return err
}
defer rows.Close()
+ } else {
+ // TODO: check if rows.ColumnTypes() matches expected
}
var id int
@@ -273,11 +275,9 @@ func (f FillMany) tags(ctx context.Context) error {
func (f Fill) links(ctx context.Context) error {
rows, err := f.Db.QueryContext(ctx, `
- SELECT path
- FROM Documents
- JOIN Links
- ON Links.referencedId = Documents.id
- WHERE Links.refererId = ?
+ SELECT link
+ FROM Links
+ WHERE Links.docId = ?
`, f.id)
if err != nil {
return err
@@ -299,11 +299,9 @@ func (f Fill) links(ctx context.Context) error {
func (f FillMany) links(ctx context.Context) error {
stmt, err := f.Db.PrepareContext(ctx, `
- SELECT path
- FROM Documents
- JOIN Links
- ON Links.referencedId = Documents.id
- WHERE Links.refererId = ?
+ SELECT link
+ FROM Links
+ WHERE Links.docId = ?
`)
if err != nil {
return err