diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2025-07-02 00:06:10 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2025-07-02 00:06:10 -0400 |
| commit | ba68130862dc004a7a1b50d99fc70872d39fd065 (patch) | |
| tree | ef4f08b1d91ff86f717fff4b30474048f77ae4c1 /pkg/data/get.go | |
| parent | 4582265de0c0472755880652dc7b390b342cf3e0 (diff) | |
Add link parsing
Diffstat (limited to 'pkg/data/get.go')
| -rw-r--r-- | pkg/data/get.go | 18 |
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 |
