Add placeholder derivation source file nar procedures
This commit is contained in:
parent
ff32aa899e
commit
38d5501233
1 changed files with 34 additions and 0 deletions
|
|
@ -57,6 +57,8 @@
|
|||
fix-derivation-output-details-hash-encoding
|
||||
insert-derivation-sources
|
||||
insert-derivation-source-file-nar
|
||||
insert-placeholder-derivation-source-file-nar
|
||||
update-derivation-source-file-nar
|
||||
insert-derivation-outputs
|
||||
insert-derivation-inputs
|
||||
derivation-output-details->derivation-output-details-ids
|
||||
|
|
@ -1507,6 +1509,38 @@ INSERT INTO derivation_source_file_nars (
|
|||
(number->string uncompressed-size)
|
||||
(string-append "\\x" (bytevector->base16-string bytevector)))))
|
||||
|
||||
(define (insert-placeholder-derivation-source-file-nar conn id)
|
||||
(exec-query
|
||||
conn
|
||||
"
|
||||
INSERT INTO derivation_source_file_nars (
|
||||
derivation_source_file_id,
|
||||
compression,
|
||||
hash_algorithm,
|
||||
hash,
|
||||
uncompressed_size,
|
||||
data
|
||||
) VALUES ($1, $2, $3, $4, $5, $6)"
|
||||
(list (number->string id)
|
||||
"lzip"
|
||||
"sha256"
|
||||
"placeholder"
|
||||
"0"
|
||||
"")))
|
||||
|
||||
(define (update-derivation-source-file-nar conn id
|
||||
hash bytevector uncompressed-size)
|
||||
(exec-query
|
||||
conn
|
||||
"
|
||||
UPDATE derivation_source_file_nars
|
||||
SET hash = $1, uncompressed_size = $2, data = $3
|
||||
WHERE derivation_source_file_id = $4"
|
||||
(list hash
|
||||
(number->string uncompressed-size)
|
||||
(string-append "\\x" (bytevector->base16-string bytevector))
|
||||
(number->string id))))
|
||||
|
||||
(define* (backfill-derivation-source-file-nars conn #:key
|
||||
(batch-size 10000)
|
||||
(loop? #t))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue