An object attribute can now be a symbol.
parent
09fb2b7cf4
commit
98793adf63
16
src/dodb.cl
16
src/dodb.cl
|
@ -82,12 +82,20 @@
|
||||||
(concatenate 'string dbpath "/data/" (number->filename number)))
|
(concatenate 'string dbpath "/data/" (number->filename number)))
|
||||||
|
|
||||||
; Example: returns "./storage/cars/indexes/by_name/".
|
; Example: returns "./storage/cars/indexes/by_name/".
|
||||||
(defun db/index/get-directory-path (database name)
|
(defun db/index/get-directory-path (database object-attribute)
|
||||||
(concatenate 'string (db-path database) "/indexes/by_" name "/" ))
|
(let ((name (typecase object-attribute
|
||||||
|
(string object-attribute)
|
||||||
|
(symbol (symbol-name object-attribute))))
|
||||||
|
(dbpath (db-path database)))
|
||||||
|
(concatenate 'string dbpath "/indexes/by_" name "/")))
|
||||||
|
|
||||||
; Example: returns "./storage/cars/partitions/by_color/Red/".
|
; Example: returns "./storage/cars/partitions/by_color/Red/".
|
||||||
(defun db/partition/get-directory-path (database name value)
|
(defun db/partition/get-directory-path (database name object-attribute)
|
||||||
(concatenate 'string (db-path database) "/partitions/by_" name "/" value "/"))
|
(let ((value (typecase object-attribute
|
||||||
|
(string object-attribute)
|
||||||
|
(symbol (symbol-name object-attribute))))
|
||||||
|
(dbpath (db-path database)))
|
||||||
|
(concatenate 'string dbpath "/partitions/by_" name "/" value "/")))
|
||||||
|
|
||||||
; Example: returns "Corvet".
|
; Example: returns "Corvet".
|
||||||
(defun db/index/get-filename (database index-name object)
|
(defun db/index/get-filename (database index-name object)
|
||||||
|
|
Loading…
Reference in New Issue