| 1 |
(in-package :cl-user) |
|---|
| 2 |
|
|---|
| 3 |
(defpackage :bknr.datastore |
|---|
| 4 |
(:use :cl :bknr.utils :cl-interpol :cl-ppcre |
|---|
| 5 |
:bknr.indices :bknr.statistics |
|---|
| 6 |
:closer-mop :alexandria) |
|---|
| 7 |
#+cmu |
|---|
| 8 |
(:shadowing-import-from :common-lisp #:subtypep #:typep) |
|---|
| 9 |
(:shadowing-import-from :cl-interpol quote-meta-chars) |
|---|
| 10 |
(:shadowing-import-from :bknr.indices array-index) |
|---|
| 11 |
#| (:shadow :cl #:get-internal-run-time #:get-internal-real-time #:get-universal-time #:sleep) |# |
|---|
| 12 |
(:export #:*store-debug* |
|---|
| 13 |
#:*store* |
|---|
| 14 |
#+(or) #:with-store ; currently not exported, does not work with indices |
|---|
| 15 |
|
|---|
| 16 |
#| |
|---|
| 17 |
;; COMMON-LISP overloads to make sure that transaction |
|---|
| 18 |
;; don't access time information |
|---|
| 19 |
#:get-internal-run-time |
|---|
| 20 |
#:get-internal-real-time |
|---|
| 21 |
#:get-universal-time |
|---|
| 22 |
#:sleep |
|---|
| 23 |
|# |
|---|
| 24 |
|
|---|
| 25 |
;; session |
|---|
| 26 |
#:session |
|---|
| 27 |
#:session-status |
|---|
| 28 |
|
|---|
| 29 |
;; store |
|---|
| 30 |
#:store |
|---|
| 31 |
#:mp-store |
|---|
| 32 |
#:store-guard |
|---|
| 33 |
#:store-state |
|---|
| 34 |
#:open-store |
|---|
| 35 |
#:close-store |
|---|
| 36 |
|
|---|
| 37 |
;; transaction |
|---|
| 38 |
#:transaction |
|---|
| 39 |
#:transaction-function-symbol |
|---|
| 40 |
#:transaction-args |
|---|
| 41 |
#:transaction-timestamp |
|---|
| 42 |
#:current-transaction-timestamp |
|---|
| 43 |
#:in-transaction-p |
|---|
| 44 |
#:deftransaction |
|---|
| 45 |
|
|---|
| 46 |
;; store-object |
|---|
| 47 |
#:persistent-class |
|---|
| 48 |
#:persistent-xml-class |
|---|
| 49 |
#:persistent-xml-class-importer |
|---|
| 50 |
#:define-persistent-class |
|---|
| 51 |
#:define-persistent-xml-class |
|---|
| 52 |
#:defpersistent-class |
|---|
| 53 |
|
|---|
| 54 |
#:store-object |
|---|
| 55 |
#:store-object-store |
|---|
| 56 |
#:store-object-id |
|---|
| 57 |
#:store-object-last-change |
|---|
| 58 |
#:store-object-touch |
|---|
| 59 |
#:print-store-object |
|---|
| 60 |
|
|---|
| 61 |
#:delete-object |
|---|
| 62 |
#:delete-objects |
|---|
| 63 |
#:cascade-delete-p |
|---|
| 64 |
#:cascading-delete-object |
|---|
| 65 |
|
|---|
| 66 |
#:initialize-transient-instance |
|---|
| 67 |
|
|---|
| 68 |
#:store-object-with-id |
|---|
| 69 |
#:store-objects-with-class |
|---|
| 70 |
#:class-instances ; convenience alias |
|---|
| 71 |
#:store-objects-of-class |
|---|
| 72 |
#:all-store-objects |
|---|
| 73 |
#:map-store-objects |
|---|
| 74 |
#:prepare-for-snapshot |
|---|
| 75 |
#:find-store-object |
|---|
| 76 |
#:create-object-transaction |
|---|
| 77 |
#:tx-change-slot-values |
|---|
| 78 |
#:change-slot-values |
|---|
| 79 |
#:store-object-add-keywords |
|---|
| 80 |
#:store-object-remove-keywords |
|---|
| 81 |
#:store-object-set-keywords |
|---|
| 82 |
|
|---|
| 83 |
#:convert-slot-value-while-restoring |
|---|
| 84 |
|
|---|
| 85 |
#:persistent-change-class |
|---|
| 86 |
|
|---|
| 87 |
#:map-class-instances |
|---|
| 88 |
|
|---|
| 89 |
#:store-object-add-keywords |
|---|
| 90 |
#:store-object-remove-keywords |
|---|
| 91 |
#:store-object-set-keywords |
|---|
| 92 |
|
|---|
| 93 |
;; operations |
|---|
| 94 |
#:execute |
|---|
| 95 |
#:restore |
|---|
| 96 |
#:snapshot |
|---|
| 97 |
#:with-store-guard |
|---|
| 98 |
#:with-transaction |
|---|
| 99 |
#:store-objects |
|---|
| 100 |
#:store-stats |
|---|
| 101 |
|
|---|
| 102 |
#:blob |
|---|
| 103 |
#:blob-type |
|---|
| 104 |
#:blob-mime-type |
|---|
| 105 |
#:blob-timestamp |
|---|
| 106 |
#:blob-pathname |
|---|
| 107 |
#:with-open-blob |
|---|
| 108 |
#:blob-size |
|---|
| 109 |
#:blob-to-stream |
|---|
| 110 |
#:blob-to-file |
|---|
| 111 |
#:blob-from-stream |
|---|
| 112 |
#:blob-from-string |
|---|
| 113 |
#:blob-from-file |
|---|
| 114 |
#:blob-from-array |
|---|
| 115 |
#:make-blob-from-file |
|---|
| 116 |
#:rename-file-to-blob |
|---|
| 117 |
#:store-blob-root-tempdir |
|---|
| 118 |
|
|---|
| 119 |
#:find-refs |
|---|
| 120 |
|
|---|
| 121 |
;; Subsystems and subsystem API |
|---|
| 122 |
#:store-object-subsystem |
|---|
| 123 |
#:blob-subsystem |
|---|
| 124 |
|
|---|
| 125 |
#:initialize-subsystem |
|---|
| 126 |
#:snapshot-subsystem |
|---|
| 127 |
#:restore-subsystem |
|---|
| 128 |
#:ensure-store-current-directory |
|---|
| 129 |
|
|---|
| 130 |
;; JSON serialization |
|---|
| 131 |
#:with-json-ignore-slots)) |
|---|
| 132 |
|
|---|
| 133 |
(defpackage :bknr.datastore.tests |
|---|
| 134 |
(:use :cl :bknr.datastore :bknr.indices :unit-test)) |
|---|