ingest documents
This commit is contained in:
@@ -2481,6 +2481,51 @@ func (q *Queries) UpdateDocumentLocation(ctx context.Context, arg UpdateDocument
|
||||
return err
|
||||
}
|
||||
|
||||
const updateDocumentMetadata = `-- name: UpdateDocumentMetadata :one
|
||||
UPDATE document
|
||||
SET metadata = ?1,
|
||||
rev = rev + 1,
|
||||
updated_at = ?2
|
||||
WHERE id = ?3
|
||||
AND deleted_at IS NULL
|
||||
RETURNING id, kind, owner_id, created_by, parent_id, name, name_key, path, depth, position, head_version_id, metadata, policy_id, visibility, acl_inherit, rev, created_at, updated_at, deleted_at, deleted_by, trash_batch
|
||||
`
|
||||
|
||||
type UpdateDocumentMetadataParams struct {
|
||||
Metadata string
|
||||
UpdatedAt int64
|
||||
ID ident.UUID
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateDocumentMetadata(ctx context.Context, arg UpdateDocumentMetadataParams) (Document, error) {
|
||||
row := q.db.QueryRowContext(ctx, updateDocumentMetadata, arg.Metadata, arg.UpdatedAt, arg.ID)
|
||||
var i Document
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.Kind,
|
||||
&i.OwnerID,
|
||||
&i.CreatedBy,
|
||||
&i.ParentID,
|
||||
&i.Name,
|
||||
&i.NameKey,
|
||||
&i.Path,
|
||||
&i.Depth,
|
||||
&i.Position,
|
||||
&i.HeadVersionID,
|
||||
&i.Metadata,
|
||||
&i.PolicyID,
|
||||
&i.Visibility,
|
||||
&i.AclInherit,
|
||||
&i.Rev,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.DeletedAt,
|
||||
&i.DeletedBy,
|
||||
&i.TrashBatch,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const updateDocumentName = `-- name: UpdateDocumentName :one
|
||||
UPDATE document
|
||||
SET name = ?1,
|
||||
|
||||
Reference in New Issue
Block a user