Merged in feature/track-filesize (pull request #200)
track file sizes for all documents in system * feature complete needs dev testing
This commit is contained in:
@@ -191,7 +191,7 @@ func (q *Queries) GetDocumentLabels(ctx context.Context, documentid uuid.UUID) (
|
||||
}
|
||||
|
||||
const getDocumentsByLabel = `-- name: GetDocumentsByLabel :many
|
||||
SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath
|
||||
SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath, d.file_size_bytes
|
||||
FROM documents d
|
||||
INNER JOIN documentLabels dl ON d.id = dl.documentId
|
||||
WHERE d.clientId = $1 AND dl.label = $2
|
||||
@@ -205,7 +205,7 @@ type GetDocumentsByLabelParams struct {
|
||||
|
||||
// GetDocumentsByLabel
|
||||
//
|
||||
// SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath
|
||||
// SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath, d.file_size_bytes
|
||||
// FROM documents d
|
||||
// INNER JOIN documentLabels dl ON d.id = dl.documentId
|
||||
// WHERE d.clientId = $1 AND dl.label = $2
|
||||
@@ -227,6 +227,7 @@ func (q *Queries) GetDocumentsByLabel(ctx context.Context, arg *GetDocumentsByLa
|
||||
&i.Filename,
|
||||
&i.Folderid,
|
||||
&i.Originalpath,
|
||||
&i.FileSizeBytes,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -239,7 +240,7 @@ func (q *Queries) GetDocumentsByLabel(ctx context.Context, arg *GetDocumentsByLa
|
||||
}
|
||||
|
||||
const getDocumentsByLabelAndFolder = `-- name: GetDocumentsByLabelAndFolder :many
|
||||
SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath
|
||||
SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath, d.file_size_bytes
|
||||
FROM documents d
|
||||
INNER JOIN documentLabels dl ON d.id = dl.documentId
|
||||
WHERE d.folderId = $1 AND dl.label = $2
|
||||
@@ -253,7 +254,7 @@ type GetDocumentsByLabelAndFolderParams struct {
|
||||
|
||||
// GetDocumentsByLabelAndFolder
|
||||
//
|
||||
// SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath
|
||||
// SELECT DISTINCT d.id, d.clientid, d.hash, d.batch_id, d.filename, d.folderid, d.originalpath, d.file_size_bytes
|
||||
// FROM documents d
|
||||
// INNER JOIN documentLabels dl ON d.id = dl.documentId
|
||||
// WHERE d.folderId = $1 AND dl.label = $2
|
||||
@@ -275,6 +276,7 @@ func (q *Queries) GetDocumentsByLabelAndFolder(ctx context.Context, arg *GetDocu
|
||||
&i.Filename,
|
||||
&i.Folderid,
|
||||
&i.Originalpath,
|
||||
&i.FileSizeBytes,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user