draft
Philippe PITTOLI 2022-10-14 20:26:54 +02:00
parent 25239281b7
commit 284e3a951e
1 changed files with 17 additions and 5 deletions

View File

@ -106,6 +106,14 @@
:hard nil) :hard nil)
)) ))
;(defun db/index/update (database index-name object file-name old-object)
; (let* ((struct-name (db-struct-name database))
; (new-value (get-object-attribute struct-name index-name object))
; (old-value (get-object-attribute struct-name index-name old-object))
; (symlink-path (db/index/get-symlink-path database index-name object)))
; (if (not (equal new-value old-value))
; ())))
(defun db/index/del (database index-name object) (defun db/index/del (database index-name object)
(delete-file (db/index/get-symlink-path database index-name object))) (delete-file (db/index/get-symlink-path database index-name object)))
@ -264,16 +272,20 @@
; write object to temporary file ; write object to temporary file
(util:write-object-to-file object tmp-file-path) (util:write-object-to-file object tmp-file-path)
; TODO: either remove the file or read the documentation on rename-file
; rename the temporary file ; rename the temporary file
(rename-file tmp-file-path file-basename) (rename-file tmp-file-path file-basename)
; handle indexes ; handle indexes
(loop for index in (db-indexes database) ; (loop for index in (db-indexes database)
do (db/index/new database index object file-basename)) ; do (db/index/update database index object file-basename old-object))
)
)
; handle partitions ; ; handle partitions
(loop for partition in (db-partitions database) ; (loop for partition in (db-partitions database)
do (db/partition/new database partition object file-basename)))) ; do (db/partition/update database partition object file-basename))))
; ;
; TEST SCENARIO ; TEST SCENARIO