{"_id":"cache-simple-orm","_rev":"34-8f2cb0f9e75246a8d0fe6d455a0f9fe5","name":"cache-simple-orm","dist-tags":{"latest":"0.0.20"},"versions":{"0.0.1":{"name":"cache-simple-orm","version":"0.0.1","description":"Minimalistic ORM for Intersystems Cache","main":"index.js","scripts":{"test":"mocha test/**spec.js --reporter spec --full-trace --timeout 5000"},"repository":{"type":"git","url":"git+https://github.com/theconst/cache-odm.git"},"keywords":["orm","Intersystems Cache"],"author":{"name":"TheConst"},"license":"ISC","devDependencies":{"chai":"^4.2.0","console.table":"^0.10.0","mocha":"^5.2.0"},"dependencies":{"bluebird":"^3.5.2","generic-pool":"^3.4.2","lru-cache":"^4.1.3","cacheodbc":"^0.0.1","winston":"^3.1.0"},"gitHead":"a2fe02288938966d7702be39874f2e40382c962b","bugs":{"url":"https://github.com/theconst/cache-odm/issues"},"homepage":"https://github.com/theconst/cache-odm#readme","_id":"cache-simple-orm@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"theconst","email":"k.kovalchuk2017@gmail.com"},"dist":{"integrity":"sha512-POJM4iMA1WvbFxuQO/DjB0A/3iaUFwHOx76u5CLiKm7YJevYi0WjJohjbEz5Wh8wWDnI+4I6rWU5Hwct3F9a1g==","shasum":"f6b19ece298e14714b2553dba717c98e6719de1f","tarball":"https://registry.npmjs.org/cache-simple-orm/-/cache-simple-orm-0.0.1.tgz","fileCount":14,"unpackedSize":24285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4e1wCRA9TVsSAnZWagAABMYQAIfp2I31WYH6PbXPuNgB\nc2BM1IwVBAlCnBXb46VQfcCJOYj0VsAgBaqqg/Gttj0r4t0Gh7umyzP/8Bnx\nyAWb3HnBxrrgea1JBlcW8k6FgwC66wbZXx+3czE3CGEWkmNS+vdkXk8zOYvd\n5nKzQzqjtRCaxXju4XCxF//C00ybibwM41+jlvKpyvxq9RNU7ezWZKquTntJ\ntva6ZXy1LC3vml5GeSqEVNuDcFiQEYjG3CTMeGig17WHKXQSzH/OGR6d6Ijd\nillwlqW4tvAlc63xVQanPMinFhBfkiaRBaD105zEBiry3bs4mw99kiKVT6Aq\nSllZX/B7ckV48IpmEnigSTo0e6aX/wMXPc0tcIIOZfPYJAWGA6zlYPXBJB6m\nVgrOASmQDLMnhyfX+n7g4KuJxTuU1zGf1Umx2n8kXdhKBKYLbfbEWORLq9kO\nOgynnfZGWNLJcuFWmIDihWpRKk0JjdSv5TOAz/KBhgB6NcTamzF5cfMYJuUa\nF57/1k9LqfGnptT5huMWZZ/jaS0i+e6Uak8qD7nI2IKXCCf3ghcg/HY7vO8P\ndZSQWWDGHXVRXqPJzXoKaXsRuZO8VGnlTDia/xoYYJdQ/oHtFUVkVFSLG4uq\ncqrhjY+a/r7P0u3lH5+r8QQmungLHWKWNpz/imTw9LbB+GVhA+DCsqwxPF9A\nCP3t\r\n=H+R7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzuVfzvBNbSyrgKChtgcufd2hRYGxnSFWworwxc7NnwgIgHe6z5UzsDo0Wqf4tvaZ6x98/RvTntv+rDk83BPxbdVY="}]},"maintainers":[{"name":"theconst","email":"k.kovalchuk2017@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-simple-orm_0.0.1_1541533040091_0.44946799879762356"},"_hasShrinkwrap":false},"0.0.9":{"name":"cache-simple-orm","version":"0.0.9","description":"Minimalistic ORM for Intersystems Cache","main":"index.js","scripts":{"test":"mocha test/**spec.js --reporter spec --full-trace --timeout 5000"},"repository":{"type":"git","url":"git+https://github.com/theconst/cache-odm.git"},"keywords":["orm","Intersystems Cache"],"author":{"name":"TheConst"},"license":"ISC","devDependencies":{"chai":"^4.2.0","console.table":"^0.10.0","mocha":"^5.2.0"},"dependencies":{"bluebird":"^3.5.2","generic-pool":"^3.4.2","lru-cache":"^4.1.3","cacheodbc":"^0.0.1","winston":"^3.1.0"},"gitHead":"ffcf18387301271d0c7869b34e4fca22fa34547c","bugs":{"url":"https://github.com/theconst/cache-odm/issues"},"homepage":"https://github.com/theconst/cache-odm#readme","_id":"cache-simple-orm@0.0.9","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"theconst","email":"k.kovalchuk2017@gmail.com"},"dist":{"integrity":"sha512-oWwqbIoCxOvaIWCXD83so/+bj5yW4pcPQzP3/AI0F39XwwCm+UxgG3wyM2baofSGJOWF60ZoIiw89uM0CsH1ZQ==","shasum":"92f4908d391be98ea72bcac5779a2c25e8b7185b","tarball":"https://registry.npmjs.org/cache-simple-orm/-/cache-simple-orm-0.0.9.tgz","fileCount":14,"unpackedSize":24285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5oF8CRA9TVsSAnZWagAA2rQP/RequzuA4/JUp6OupjsS\nj5r/lLm1t53csdqYu2dLnCzlgm+Ogdodkkye29rR0KcIh8DWWPAek1QHaoIs\ntnEEz6xSSdyYSd6bq/tQMTOGTBnvnIoE2Uo7UF9nIw5cFVBtwahb8RsWxrsh\nMiRxtu2zjGKyLCm8UVKFMVUNOqR1d8KJjDaqiswoT9MosdGTP+YEN9ujkOkP\nxOpXu+M35mFgxcVsoVHsASbqhDqy/ea6NZR+AA2hoq72egnaRzl2nwjIuXmN\nfVahF7LE8gu67AuWjEdg4KgsJpL3kI75XYb3i8G4y3E5Jb5q1GET6UKS2q+l\n6JtipE7abZbXbe8c84EZw41OPx/U6SoMykh9gJnBSmonQcz8fERQbSxvhez5\nrisoMJzBfAoarg1XHENjuaEHDTU4qEAl5vuXValybOQ0AV24lCSto2asdGSm\ny1PqOgoutLJErQx5RaVgpvYXIEnQnsOuIUIEDLUkyPnn7txKnY5niTb/2fqF\nCrLHpE9xyY8QZckeEijsLia3mHmvjd36habinh2C4w9SvmCVqUXUbxba7EJp\nnid7DYSCQKawmZii8jYD38dGsOIkJzJd+Pp9dfxAErSC573ZfYxFO3HegLgn\nAg4jqXO4OkSHJA+OQJ3P9x/4eE/3wrQx5ARiD7lPMp7wNTQhI6OWgN9hhr8X\napwj\r\n=RQMM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHWDFmMTeAYQzH3Mrkpq1lSOTbArPBpW+1mi0wCCOzFJAiEA8pLZcUbnicvT/mg2Adyc57GoeY75wdeIfTWgGhRBWIg="}]},"maintainers":[{"name":"theconst","email":"k.kovalchuk2017@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-simple-orm_0.0.9_1541833084156_0.06133822569357461"},"_hasShrinkwrap":false},"0.0.19":{"name":"cache-simple-orm","version":"0.0.19","description":"Minimalistic ORM for Intersystems Cache","main":"index.js","scripts":{"test":"mocha test/**spec.js --reporter spec --full-trace --timeout 5000"},"repository":{"type":"git","url":"git+https://github.com/theconst/cache-odm.git"},"keywords":["orm","Intersystems Cache"],"author":{"name":"TheConst"},"license":"ISC","devDependencies":{"chai":"^4.2.0","console.table":"^0.10.0","mocha":"^5.2.0"},"dependencies":{"bluebird":"^3.5.2","generic-pool":"^3.4.2","lru-cache":"^4.1.3","cacheodbc":"^0.0.1","winston":"^3.1.0"},"gitHead":"930e6ba04168fc0ab50e6ab1d4e60b75a00b78cf","bugs":{"url":"https://github.com/theconst/cache-odm/issues"},"homepage":"https://github.com/theconst/cache-odm#readme","_id":"cache-simple-orm@0.0.19","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"theconst","email":"k.kovalchuk2017@gmail.com"},"dist":{"integrity":"sha512-R3BFr7JesHIKocGBSoTb1uFu/dbtRF4OaWN4zGGzXXFPA8aZ7xGnN8jR0PkgsCre1SHkqOYF1sAzCTpk1tayhg==","shasum":"3b75f387e98ec4332dd6b3b8f08bff73baa69789","tarball":"https://registry.npmjs.org/cache-simple-orm/-/cache-simple-orm-0.0.19.tgz","fileCount":14,"unpackedSize":27008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6kdFCRA9TVsSAnZWagAAJDMP/3q2zK6bhRIHZbjqBAen\nfPc7F1d0UKY1ywNH3j/w3M1PfOTy8hp6X4mwzDpm7a9ISdCl1lIj7yT1DVyv\nltmh4Bd9btRiwsC4ItSbEv8K63bFVIWPzQVYMStslo7osZLmTivIggg8ozz2\n6MrabT+3O8dRrG3naKgTiFKQwcqCsMCxDp4xNMW0SOvXTMwtLi7uMtPxZvOH\nyIfTKUWhuQWTOx7j599EH6DX+GHdCQvaRfPF2a0wvIzer32gaWMltK+3wWzI\nQg6+LZN3Yr1F0Zx8zuTZHUXl/uLDGGSXopCNnH3iiOh+JyUMIo461UJxmDvE\nbdTAbLyOPLBSf09BucVz83cqD/t6L31/VVFJPXeRkUF7JyYZHZvEdwbXlbSR\nVWwenFECb1mAWm4jUlL1DVqECnpVZq7n8xtw7pzYTsQsoHpNfHD2HxJR4qEr\nzPvqV6pPKGVcsjyZQxosz0CrODecUR6fey/G22Xvl+/5+8qHMO/IaeL+7mqY\n/mSVr7zhDnCPqVsS2nW7ujuseloDAoTqigaxgPDXW96bl/5ECc8kLCgpkfZn\n3ZjFX8u/i0S5kpPlPpFwnZ3Y194EjXF9X9oo6+0bfHC1qCQC60pAPbTiMDS8\nmmfdArZT4bP0DexHYH1kDd4rd/SAsQvIgQNCwNWU3hpXheBDfIc8Ura20e0O\nT1CE\r\n=mH+J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW7NFVqehkML7rF8tEW7mApO9t6rkMOgPEkPDVraoJwwIgUWGSOcZrl+Se/lHzM9s8h6cK29syv7v5RpsvNdhqdYs="}]},"maintainers":[{"name":"theconst","email":"k.kovalchuk2017@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-simple-orm_0.0.19_1542080324521_0.3794688043443877"},"_hasShrinkwrap":false},"0.0.20":{"name":"cache-simple-orm","version":"0.0.20","description":"Minimalistic ORM for Intersystems Cache","main":"index.js","scripts":{"test":"mocha test/**spec.js --reporter spec --full-trace --timeout 5000"},"repository":{"type":"git","url":"git+https://github.com/theconst/cache-odm.git"},"keywords":["orm","Intersystems Cache"],"author":{"name":"TheConst"},"license":"ISC","devDependencies":{"chai":"^4.2.0","console.table":"^0.10.0","mocha":"^5.2.0"},"dependencies":{"bluebird":"^3.5.2","generic-pool":"^3.4.2","lru-cache":"^4.1.3","cacheodbc":"^0.0.2","winston":"^3.1.0"},"gitHead":"2fc16890aa59331593545da338d876be4a53e7b6","bugs":{"url":"https://github.com/theconst/cache-odm/issues"},"homepage":"https://github.com/theconst/cache-odm#readme","_id":"cache-simple-orm@0.0.20","_npmVersion":"6.4.1","_nodeVersion":"8.11.0","_npmUser":{"name":"theconst","email":"k.kovalchuk2017@gmail.com"},"dist":{"integrity":"sha512-mHiDk2jZ53uY37V+RABRe/shTQBBZxgS2DN0yeGk5tmvg7DXq/BezCsBlNOim/SxBrAJxzKMJcpqJ2mJt+InVQ==","shasum":"077d504df0046b34598779e17d1959630c61fa3b","tarball":"https://registry.npmjs.org/cache-simple-orm/-/cache-simple-orm-0.0.20.tgz","fileCount":14,"unpackedSize":27875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8SspCRA9TVsSAnZWagAAzswP/3GaOzuhpV3S+tAbGrqJ\nM7LrCo5xGHFBBYwaFB19pSV+qDFGgLT1RsbP6bOUhuNoRkWJa3LAGVfaCcad\n05JPQQHfm2xFDIaZGjhyJqumiITy5V42pscOXdFRzB3gUWJHdMrcKS5tkOAm\nq01UhoBJl6fo0sbmZt6ZV899hm79rJoskWAKX9UTQZOuCjPD6RxHicRbBOs2\nZugKa7Pth+AvTDc+mkqRt30fhVK6wauRlOThbYeNqC2g7ZbXXe1tIK58m6PS\n17H4JkIr+ePG04yHqZ4BUA3xvz4U8Snh1W5gpaofWBqvfHvz4yO2+aW1yDtb\nbkgzyKVkJAqHaYuOvidEXfNo5UgUjhCbW0JnFVyeeEW6EQtEGy15gajPSWX1\nDukljt854IBALViicy+0iwKlFKSedMIN4DqCAYUPYlRFKCd8UzS17T+NaQk9\nljBJRCJY10zFgzCKl0unHN0F94C1VjoN57licKaddw4zytEWg8X3yCIbtZq2\nZ3B73ZxJiXB4DgXlerG56q9eXEvyHqQEtLf15CPGkDeNe8M1sCtc5hsObSBW\nEfqSTqZNLvw/+5wtOgXXvXmHQIt8rpHwpB+tAdAQqymVZUMOcpvTk064zbBL\nfeuY8Sxm5T7pw9oiSZ+m6U5Li6J5MQr5bx1dZf764SV3oqpJkcZGPzk8Afwn\nM1oK\r\n=hFDc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6L0pmn0h4J0klqWAiwiL8cVf8DJLWXBxMaGExjPtU0AiBNwdVXdpp12pY2YUIL2Lp8KSHFAVj8/ww9EgeC5nlN4w=="}]},"maintainers":[{"name":"theconst","email":"k.kovalchuk2017@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-simple-orm_0.0.20_1542531880834_0.22668247262280228"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-06T19:37:20.091Z","0.0.1":"2018-11-06T19:37:20.174Z","modified":"2022-04-12T04:59:45.940Z","0.0.2":"2018-11-09T19:38:45.816Z","0.0.3":"2018-11-09T19:47:38.503Z","0.0.5":"2018-11-09T20:17:19.136Z","0.0.6":"2018-11-09T20:24:15.483Z","0.0.7":"2018-11-09T21:01:31.151Z","0.0.8":"2018-11-10T06:55:25.160Z","0.0.9":"2018-11-10T06:58:04.292Z","0.0.10":"2018-11-10T07:09:13.627Z","0.0.11":"2018-11-10T09:21:03.339Z","0.0.12":"2018-11-11T14:31:27.243Z","0.0.13":"2018-11-11T14:32:47.015Z","0.0.14":"2018-11-11T16:18:08.799Z","0.0.15":"2018-11-11T17:33:29.623Z","0.0.16":"2018-11-11T18:22:01.786Z","0.0.17":"2018-11-11T19:11:12.047Z","0.0.18":"2018-11-11T23:07:31.407Z","0.0.19":"2018-11-13T03:38:44.728Z","0.0.20":"2018-11-18T09:04:40.935Z"},"maintainers":[{"name":"theconst","email":"k.kovalchuk2017@gmail.com"}],"description":"Minimalistic ORM for Intersystems Cache","homepage":"https://github.com/theconst/cache-odm#readme","keywords":["orm","Intersystems Cache"],"repository":{"type":"git","url":"git+https://github.com/theconst/cache-odm.git"},"author":{"name":"TheConst"},"bugs":{"url":"https://github.com/theconst/cache-odm/issues"},"license":"ISC","readme":"## ODM for intersystems Caché\r\n\r\nObject document mapping for intersystems Caché database.\r\nWrite node.js code just like you would write ObjectScript.\r\n\r\n## Current status\r\n\r\nAlpha quality\r\n\r\nCheck out the example below.\r\n\r\n```javascript\r\nconst Persistent = require('../js/Persistent');\r\nconst Session = require('../js/Session');\r\nconst Reader = require('../js/Reader');\r\nconst ft = require('../js/functools');\r\n\r\nrequire('console.table');\r\n\r\nconst log = require('../js/logger');\r\nlog.level = 'info';\r\n\r\nconst aviationDescription = {\r\n    namespace: 'Aviation',\r\n};\r\n\r\nclass Crew extends Persistent {};\r\nCrew.description = aviationDescription;\r\n\r\nclass Aircraft extends Persistent {};\r\nAircraft.description = aviationDescription;\r\n\r\nconst eventId = '20010608X01122';\r\nconst aircraftKey = 1;\r\nconst crewNumber = 1;\r\n\r\nconst id = {\r\n    'EventId': eventId,\r\n    'AircraftKey': aircraftKey,\r\n    'CrewNumber': crewNumber,\r\n};\r\n\r\nSession.transact(() => \r\n    Crew.openId(id)\r\n    .tap(result => {\r\n        console.table(result);\r\n        console.log('updating incident info');\r\n    })\r\n    .flatMap(result => {\r\n        const injury = result.Injury;\r\n        result.Injury = injury === 'fatal' ? 'critical' : 'fatal';\r\n\r\n        return result.save();\r\n    })\r\n).then(() => \r\n    Session.transact(() => \r\n        Crew.openId(id)\r\n        .tap(result => {\r\n            console.table(result);\r\n            console.log('incident info updated');\r\n        }) \r\n    )\r\n).then(() => \r\n    Session.transact(() => \r\n        Crew.findBy({\r\n            'Injury': 'fatal',\r\n            'Category': 'Co-Pilot',\r\n            'Sex': 'M',\r\n        }, ['Age', 'Sex', 'Aircraft'])\r\n        .tap(deadMaleCoPilots => {\r\n            console.log('Dead male copilots');\r\n            console.table(deadMaleCoPilots);\r\n        })\r\n        .flatMap(deadMaleCoPilots => \r\n            Reader.sequence(deadMaleCoPilots\r\n                .filter(copilot => copilot.Age < 30)\r\n                .map(copilot => copilot.Aircraft)\r\n                .map(aircraftId => Aircraft.findBy({\r\n                    'ID': aircraftId\r\n                }, ['ID', 'AircraftModel'])\r\n                .tap(aircraftId => {\r\n                    console.log('Found aircraft id');\r\n                    console.table(aircraftId);\r\n                }))))\r\n        .map(airplanes => ft.flat(airplanes))\r\n        .tap(airplanes => {\r\n            console.log('Result of search');\r\n            console.table(airplanes);\r\n        }))\r\n).then(() => \r\n    Session.exec(() => Aircraft.call('Extent'))\r\n        .tap(result => {\r\n            console.log(`Called Aircarft's Extent classmethod`);\r\n            console.table(result.slice(0, 10));\r\n        })\r\n).finally(() => Session.destroy());\r\n```\r\n\r\n\r\n## Current Status\r\n\r\nSee the https://github.com/theconst/aodbc for configuration details.\r\nWork in progress. Not ready for use as a standalone module.\r\n\r\n## Configuration\r\n\r\nChange configuration options in config.json \r\n\r\n|Option            | Descritpion                        |\r\n|------------------|------------------------------------|\r\n| dsn              | DSN for ODBC connection to use     |\r\n| poolSizeMin      | Minimum size of connection pool    |\r\n| poolSizeMax      | Maximum size of connection pool    |\r\n| cacheSize        | Size of query cache per connection |\r\n| evictionInterval | Connection pool eviction interval  |","readmeFilename":"README.MD"}