Overview
Comment: | ATTACH Sync not working. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.80 |
Files: | files | file ages | folders |
SHA1: |
692ebd2f401bca3873b965395a4a4b31 |
User & Date: | mrwellan on 2023-02-28 20:27:43 |
Other Links: | branch diff | manifest | tags |
Context
2023-03-01
| ||
07:41 | ATTACH sync working ok. check-in: f803cb519f user: matt tags: v1.80 | |
2023-02-28
| ||
20:27 | ATTACH Sync not working. check-in: 692ebd2f40 user: mrwellan tags: v1.80 | |
2023-02-27
| ||
21:25 | Added function for using ATTACH for sync between db's. Not yet in use. check-in: dca3a45c98 user: mrwellan tags: v1.80 | |
Changes
Modified db.scm from [ba30cc2cdc] to [e3db33630a].
︙ | |||
930 931 932 933 934 935 936 | 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 | - + + - + + | (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_rundat ( id INTEGER PRIMARY KEY, test_id INTEGER, update_time TIMESTAMP, cpuload INTEGER DEFAULT -1, diskfree INTEGER DEFAULT -1, diskusage INTGER DEFAULT -1, |
︙ |
Modified dbfile.scm from [0905d9cb9e] to [a3424eedef].
︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + | commonmod ;; debugprint ) (define keep-age-param (make-parameter 10)) ;; qif file age, if over move to attic (define num-run-dbs (make-parameter 10)) ;; number of db's in .megatest (define dbfile:testsuite-name (make-parameter #f)) (define dbfile:sync-method (make-parameter 'attach)) ;; 'attach or 'original ;; 'original - use old condition code ;; 'suicide-mode - create mtrah/stop-the-train with info on what went wrong ;; else use no condition code (should be production mode) ;; (define no-condition-db-with-db (make-parameter 'suicide-mode)) |
︙ |
Modified dbmod.scm from [c0d005cd6b] to [e21b719c87].
︙ | |||
137 138 139 140 141 142 143 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | + + + + + + + - - - - - + + + + + + + + + + + + + + + + + - | db)))) (tables (db:sync-all-tables-list keys))) (dbr:dbstruct-inmem-set! dbstruct inmem) (dbr:dbstruct-ondiskdb-set! dbstruct db) (dbr:dbstruct-dbfile-set! dbstruct dbfullname) (dbr:dbstruct-sync-proc-set! dbstruct (lambda (last-update) (sync-gasket tables last-update inmem db dbfullname syncdir))) ;; (dbmod:sync-tables tables #f db inmem) (sync-gasket tables #f inmem db dbfullname 'fromdest) (dbr:dbstruct-last-update-set! dbstruct (current-seconds)) ;; should this be offset back in time by one second? dbstruct)) |
︙ | |||
305 306 307 308 309 310 311 312 313 314 | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | + + + + + + + + + + + + - - + + + + + + + + - + + + + + - + - - - - - - - - - + + + + + + + + + + + + + + + + - + + + + + + | (lambda (dat) (let ((tblname (car dat)) (count (cdr dat))) (set! tot-count (+ tot-count count)))) (sort (hash-table->alist numrecs)(lambda (a b)(> (cdr a)(cdr b)))))) tot-count)) (define (has-last-update dbh tablename) (let* ((has-last #f)) (sqlite3:for-each-row (lambda (name) (if (equal? name "last_update") (set! has-last #t))) dbh (conc "SELECT name FROM pragma_table_info('"tablename"') as tblInfo;")) has-last)) ;; tbls is ( ("tablename" ( "field1" [#f|proc1] ) ( "field2" [#f|proc2] ) .... ) ) ;; ;; direction = fromdest, todest ;; mode = 'full, 'incr ;; |