Overview
Comment: | wip |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.70001-multi-db-rebased |
Files: | files | file ages | folders |
SHA1: |
3c8cc5078c2700f095d8f27494790c7d |
User & Date: | matt on 2022-03-02 19:46:54 |
Other Links: | branch diff | manifest | tags |
Context
2022-03-02
| ||
20:46 | Broke out stuff from db.scm that is used for db file management into dbfile.scm check-in: 77c71d1c14 user: matt tags: v1.70001-multi-db-rebased | |
19:46 | wip check-in: 3c8cc5078c user: matt tags: v1.70001-multi-db-rebased | |
2022-02-27
| ||
20:21 | wip check-in: 45bc17bcaf user: matt tags: v1.70001-multi-db-rebased | |
Changes
Modified common.scm from [b30cfc533e] to [cf6013c9c1].
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | ;; (define *alt-log-file* #f) ;; used by -log (define *common:denoise* (make-hash-table)) ;; for low noise printing (define *default-log-port* (current-error-port)) (define *time-zero* (current-seconds)) ;; for the watchdog (define *default-area-tag* "local") ;; DATABASE |
︙ |
Modified db.scm from [dea5f62aee] to [087864cb5c].
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - | ;;====================================================================== ;; each db entry is a pair ( db . dbfilepath ) ;; NOTE: Need one dbr:dbstruct per main.db, 1.db ... ;; (defstruct dbr:dbstruct (dbname #f) (dbdats (make-hash-table)) ;; id => dbdat |
︙ | |||
129 130 131 132 133 134 135 136 137 138 139 140 141 142 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | + + + + + + + + + | (if (eq? err-status 'done) default (begin (debug:print-error 0 *default-log-port* " query " stmt " failed, params: " params ", error: " ((condition-property-accessor 'exn 'message) exn) ", exn=" exn) (print-call-chain (current-error-port)) default))) (apply sqlite3:first-result db stmt params))) (define (db:generic-error-printout exn . message) (print-call-chain (current-error-port)) (apply debug:print-error 0 *default-log-port* message) (debug:print-error 0 *default-log-port* ;; " params: " params ", error: " ((condition-property-accessor 'exn 'message) exn) ", arguments: " ((condition-property-accessor 'exn 'arguments) exn) ", location: " ((condition-property-accessor 'exn 'location) exn) )) ;; Get/open a database ;; if run-id => get run specific db ;; if #f => get main db ;; if run-id is a string treat it as a filename ;; if db already open - return inmem ;; if db not open, open inmem, rundb and sync then return inmem |
︙ | |||
207 208 209 210 211 212 213 | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | - - - - - - - - - - - - - - - - - - - - - - - | (db:generic-error-printout exn "ERROR: database " fname " is locked. Try copying to another location, remove original and copy back.")) (exn (permission)(db:generic-error-printout exn "ERROR: database " fname " has some permissions problem.")) (exn () (db:generic-error-printout exn "ERROR: Unknown error with database " fname " message: " ((condition-property-accessor 'exn 'message) exn)))))) |
︙ | |||
420 421 422 423 424 425 426 | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | - + | (else ;;(common:on-homehost?) (let* ((dbstructs (make-hash-table))) (when (not *toppath*) (debug:print-info 13 *default-log-port* "in db:setup, *toppath* not set; calling launch:setup") (launch:setup areapath: areapath)) (set! *dbstruct-dbs* dbstructs) ;;(debug:print-info 13 *default-log-port* "new dbstruct = "(dbr:dbstruct->alist dbstruct)) |
︙ |