{"_id":"@atlas.js/objection","_rev":"28-4e25a4eba5c4184e667b906d26f013f8","name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","dist-tags":{"next":"2.2.0-alpha.9","latest":"3.0.0"},"versions":{"0.1.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.1.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.0","@atlas.js/service":"^1.0.0","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-uGbwGpu2mBrxe9loIztEMhNWcWzXKdGAK+DdwIIjefIkfdMt5nF726FRILXJhC9etS3tLVAsajdtrc//nYa4zQ==","shasum":"c6ffdfde2fbdaff2ba45822fea6edf2f9a697c27","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZCSLuv5Ha9Ujqab2Z4H+4Zz+f64xyWC8ZAtQ9NkkwdAiBWE5TUW9QSjAIDv1mA7MsVn8QAHWxLzH9PjfjSzfBpGg=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.1.0.tgz_1510216045376_0.41299878573045135"},"directories":{}},"0.1.1":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.1.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.0","@atlas.js/service":"^1.0.0","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-VDrFHQPo1RpWGoUUbnrEv/ZQ6oTtytbFDaA7yUomkRQk10XyNbC3jUEKpmcKcLrzDfr5OMpvFLtSDdhnALBwsg==","shasum":"c13b09c3919034015c6c824e2c74e2716fcf9d07","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo1NL7EGMe/z1zMMnf1w7SCffKUwSDqgDTbJ1/j1TiVgIhAKMw+NpvEQT43aIIMoSduH0BmebV4yEA6FvwvKgRuP+4"}]},"maintainers":[{"name":"strvuser","email":"licenses@strv.com"},{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.1.1.tgz_1510228030411_0.5534990790765733"},"directories":{}},"0.1.2":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.1.2","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.0","@atlas.js/errors":"^0.1.0","@atlas.js/service":"^1.0.0","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.1.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-hbmUHV/khy4HKbvEQUHrCDHv0b62Vs7f7gzhhsUwN8SBogosSx6R7ahKScHYpibYj9WA+rbC+Xp0oAc6wo261w==","shasum":"2153fb8df6ed0cb260cf85ddb5ee9ed0b70dfc41","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdxZExwOECHuR+QwDwPi0hx0WRynwSQFXH2+8xdx5w4wIgIMFoaoSw8/Yd2v3i6FyHgvcuuyCwCXtMcZS8VfSLAHA="}]},"maintainers":[{"name":"strvuser","email":"licenses@strv.com"},{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.1.2.tgz_1510695147623_0.4942969817202538"},"directories":{}},"0.2.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.2.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.0","@atlas.js/errors":"^0.1.0","@atlas.js/service":"^1.0.0","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-szBTXWCDOOroJTM5npLyWAztqZOIYXXz0BP1d2T958AKfPfgIolHp4932tiQN728NjPbCpxnYNd1WStnapABoA==","shasum":"753c5380304df064160db4e6c04e9de487c6627d","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrJFke8Oi6XKv9Imtvn6tk+/HTyZB78m5o6Jy5E52kIwIhALFg/f5msQFLfY0h7lkMS57vGLUh13pAH6O92A378/fQ"}]},"maintainers":[{"name":"strvuser","email":"licenses@strv.com"},{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.2.0.tgz_1510744746367_0.716047951253131"},"directories":{}},"0.3.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.3.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.0","@atlas.js/errors":"^0.1.0","@atlas.js/service":"^1.0.0","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.3.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-dJiiggUlwOVtKRbTtoj/0tmFPriA+YInzAI53l3lQuIWbIB5XSZssQ8rXn1vM47EgwTwYVuftwrUuXxqQpCA0A==","shasum":"ecaa34265c525316c31d54f7c2a7355c44a484fc","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6sFwRtEfq7gpD7jywKhxJT4euplwiTxohwJ+VY2ADlAiBW1xuZZT7nZfTVJhwRoLEF3dzc1/oQaupcr9ZjDaw6dw=="}]},"maintainers":[{"name":"strvuser","email":"licenses@strv.com"},{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.3.0.tgz_1511531466177_0.610130189685151"},"directories":{}},"0.3.1":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.3.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.1","@atlas.js/errors":"^0.1.1","@atlas.js/service":"^1.0.1","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.3.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-mWHrnR0hkVe6rsGCaaZHewfKyJkxKF5hk+qhU4K2eQHWs0eMEuZCD7D8V6Z+hmINacv11SiB/nJuwIoXYUjy3g==","shasum":"a33a2b58aadf9ef22954308b257b862b1b25991e","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwFzpS6uXPadDyVo1QmCq8EwyFASfWRzyt69y8G8qKpAIhAIEypwReji/MN7VXxiEvB02hEiOnnJ9RNpfGwhz/f6YN"}]},"maintainers":[{"name":"strvuser","email":"licenses@strv.com"},{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.3.1.tgz_1511776463280_0.4253598020877689"},"directories":{}},"0.4.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"0.4.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.2","@atlas.js/errors":"^0.1.1","@atlas.js/service":"^1.0.2","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^0.9.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@0.4.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-rAD9iQpCbn0uBNo4WaSe4ocQsZXWQzEB9Sp1KUgED/Som+rOKhsZ1AQAUz2v7rmTDrDOQgNuCQRjlOUNOEduAw==","shasum":"b2dedc40e1daf14cd9c55a84fc219e3279fe3da8","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-0.4.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQuFJROecLcnXHQaqSVqs1CHJDpvfM9fl9684V8OHHpAiEAvdmn5WpNS9pSSOiHKC2TOsE66j4jIo28m0qxYpPQOt4="}]},"maintainers":[{"name":"strvuser","email":"licenses@strv.com"},{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection-0.4.0.tgz_1513166193218_0.9156313370913267"},"directories":{}},"1.0.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"1.0.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.2","@atlas.js/errors":"^0.1.1","@atlas.js/service":"^1.0.2","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^1.0.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-YMtcuN/Pc4lzECTxc3vhUFxQBKWs3MN3RZ/Dm98q1OLRIOe7fY65Htg+n9TbfcCQ9m7p+Rv+I/jXjb9E8e/2xA==","shasum":"aa7fb0ce89d0e84f53c12bf71f965fb283f3a39f","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-1.0.0.tgz","fileCount":32,"unpackedSize":72000,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyjmJa0r8GBpC/AroPbOvE8BoIYOY1S6nvFbQNWfvUHQIgJXVxGdb4cy48ri4Y7RjCKILRjIIK8+VqXYqXpYhGILE="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_1.0.0_1518704949691_0.32580775829501474"},"_hasShrinkwrap":false},"1.1.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"1.1.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.2","@atlas.js/errors":"^0.1.1","@atlas.js/service":"^1.0.2","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^1.0.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-loVxIUKrGJHunSmF7Rg6xhf67u6Swi/vZvPR53+bFd+sJDkgmVtf1nGGosOQzLJTkpEtvJQaikZpt43XaomZnw==","shasum":"a444e201826510cd0f4676957c56525a56c1d452","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-1.1.0.tgz","fileCount":32,"unpackedSize":72494,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID8TVInu9Ilomf8wJvNU4GKSs+DzqXX+M3MzwiHz+pJ8AiAZmldQMDwCbqHNeCnAwPRDxBL88FuPz2jzifA/Nnu20g=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_1.1.0_1519375711248_0.43828950771954633"},"_hasShrinkwrap":false},"1.1.1":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"1.1.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.0.2","@atlas.js/errors":"^0.1.1","@atlas.js/service":"^1.0.2","knex":"^0.14.0","knex-umzug":"^2.0.0","objection":"^1.0.0","umzug":"^2.1.0"},"devDependencies":{"sqlite3":"^3.1.13"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-XTC5Ky0f2mxTQfvnNX/G5+VIRI1iVSMayOWuaA8K1j6oB5MWQcBsRUR5oCH2L2FBdxCou+kDs0hs1zOpxgc2Sg==","shasum":"127dcf6291a0a53c0fde600988e93cb2f98ce9f4","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-1.1.1.tgz","fileCount":32,"unpackedSize":72828,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0V9gOHrJkCsoUzok9MTMPdqCpPyH0gdvatafRLRn06wIhAII8o9p1cyRdSac9QU50W7BG2oFLRs30y82AlraeHEep"}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_1.1.1_1520417921912_0.7310053157354031"},"_hasShrinkwrap":false},"1.2.0-alpha.a596c671":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"1.2.0-alpha.a596c671","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.1.0-alpha.a596c671","@atlas.js/errors":"^0.2.0-alpha.a596c671","@atlas.js/service":"^1.1.0-alpha.a596c671","knex":"^0.14.6","knex-umzug":"^2.0.0","objection":"^1.1.7","umzug":"^2.1.0"},"devDependencies":{"@atlas.js/atlas":"^1.4.0-alpha.a596c671","sqlite3":"^4.0.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@1.2.0-alpha.a596c671","_npmVersion":"6.0.1","_nodeVersion":"8.11.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-jeHgNGsbjST+JfwKwuc5CJ5nRKICt3EzkC4zlPLnizioGG/jJviYBv8nuEklu+VUEM7uT94NeaKUzdBDx8jbUw==","shasum":"63e1e39c680b15190380f9b7d45063703b38f2e1","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-1.2.0-alpha.a596c671.tgz","fileCount":32,"unpackedSize":86590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+aTOCRA9TVsSAnZWagAAOGsQAJWoD3UZJm53yuukelkr\nADteXdOOUyIx9ClII6QnVOwfENCYHYl6oDonDFfuw30nXuvWpYdcDRpQqHOz\nmoEbpWotlU3joZbPmQUip8+S7aorrqpm/n68c1GgtdV9Ztdaus8FmuqPZ49S\n73nbZFT3SML9vTyPeV4NAszN/Xtjvu2Vauci5C7MuPjXGfy6jHgCL0PNPhs8\ncejdaKIwnTP+/bc3kciiqvpRM71nAoimug2wsMT+0wM8rqHz0PnulnZGaTq3\ny8LxAqq/IuVDaMORg1+PNBbPY2sSx4mgUdHUcn0iho1H9bXIEa3zSBH9yPmV\nswQy83QCCfq7pLIk4srzs9cidRv9Bk+KCKfLeVSJyEoO0KW9lLyBqqvQz8TI\nVt8hvUWgli5ozjMAmestyH6pv1xbzuGUle686QqaLjY1yEqkn8+Oabp3fOYO\nRKJCgwmz6oymhNyA6aL0xObHB63q1CuqZyO1HOcz2VLGbk0pudVEdi6Y83vj\nkVAZtjyAm6v0rAnqj7vlJPRM8WPG60xcKAm/M/6PvJhwuXXuWayEPEAzUZXN\nzlKaMZXhXteIwFgBaNsute7aMMamp8gBUvd0Ji6SlW1/Ozl42OCZZztD/L5z\n5H4qr45wK89CNdY1/76SH8NhbDI4T8Rj27uGooORA2ey/PBQP4fvV+wjIz1Q\nMogT\r\n=NK36\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVHWuUY5Xr7fb+4RpZF8Bz6mP5Sh3JGGEFroGFAAF7uAiEA5gyN/kx+eyFo2SIWHzbtVTDphS9CTEeT5TDaF0Cb6Lw="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_1.2.0-alpha.a596c671_1526310094026_0.8692325721379339"},"_hasShrinkwrap":false},"2.0.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.0.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.1.0","@atlas.js/errors":"^0.2.0","@atlas.js/service":"^1.1.0","knex":"^0.14.6","knex-umzug":"^2.0.0","objection":"^1.1.7","umzug":"^2.1.0"},"devDependencies":{"@atlas.js/atlas":"^2.0.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.0.0","_npmVersion":"6.0.1","_nodeVersion":"10.1.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-HFg4849CwmTywwvCXbYfZhhc+g1hcwR0tnQvTfs4errOa5UCT8dXFeWHyPKxsxiQcR3BLyjeXbd7GDeJhvr9dQ==","shasum":"268b79b9433cc47104a71c3a8dcf34723b850dc2","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.0.0.tgz","fileCount":32,"unpackedSize":86593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBDkkCRA9TVsSAnZWagAAtpAP/03aCcoeEHVYA16fgZrj\ncjTiyidRKjBD8QDjRnetkGg3a4WqpmrK0KhlxybYrLPSa6StvHtYfTPhPshB\n7cZDKOcvljcmPKNVx3v+/FKqJwA0rm5ByQmE/aO/ogHu9o1bRg4Enj+tpxze\n6oyoBCdmxSN+yFhzY1vn+E9aQvkCpXe6yDxrsctb0f6C9guDLX3/PMKX+XCu\ngcv7NpZXIxpdE4ZIe120mWpOnxEHGg+kWedfG2SJXBWkOkPIGYGS4LbWBoTw\nJbK+jksjYCnZqVo/hL2kp0l5Pmm2lf7Xqa82HA9+dZrY3ByZjqeYb0eL1ZTT\n+8G3IkYXy5iQX0H3k8RDA7TQZjzY8MyYJ+bvcty5DhuWR8lSxQoDNAXEjneo\n3Bm8TN2IPxqEDpti6n9vetTZJBDv5CUZcdpvGf07vCBbPV6vaxVnSjaMtTCf\nToTkDv8lCNB+eolE8r9iu0pV/jucSd0ONsh17W67m9oTZmi8bWdI09WNp2Gb\nSUejWMK8th11At9Q0dbvTTDhNQNKIHWhZ2FKi4SP1wj6fyUipoHLnc7uNKIC\n04PM9syw75jkiUY15kRgJiEtdwnZlHiiRMQYeKl1C//enik/rmYnCICjvN07\nf+HMbIZvF9Ah3kpy8MVaYvF62yBm1koPoWt5jo7CkoUUj1J27cqEPvPsdkVP\n2fv1\r\n=ENMp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9I+g0nDLBS1TnTqhxwuoPvlDA67WHVd2AHjEkT/kxaAiB/y0BkrIipb1Vz9r05lO/o4VzKvhO4Bq7pxoUQHwMc7w=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.0.0_1527003428607_0.9279453816874514"},"_hasShrinkwrap":false},"2.1.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.1.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.1.1","@atlas.js/errors":"^0.2.1","@atlas.js/service":"^1.1.1","knex":"^0.15.0","knex-umzug":"^2.0.0","objection":"^1.1.7","umzug":"^2.1.0"},"devDependencies":{"@atlas.js/atlas":"^2.1.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@2.1.0","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-Es5kcnD5PltGcdLxga9twbnIKhmIpvmck4datQucv7+ShKtWi+8ZdUm4I9QVS0GlObJlgy1YdvM1cMhFcH1uNA==","shasum":"d6acb3cd2c884005c22f5acc998fb1fc3473bd56","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.1.0.tgz","fileCount":34,"unpackedSize":93061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbR0o7CRA9TVsSAnZWagAAsEIP+gPrBZ0o32at2sDz4J9f\nwhoalq93ywQ7U2PM9gnFmh4LPDVgSjQYYKjwlzSkULm9+IZSK9z7MEN9D2au\nwpyTqXWquVQ93mdvut5y+Tb1mFjcKs8ATwprgepXdi0q4B2gLk9NilD6pj89\nkE7aeaWDVnDjfnC3wtn8jKbhaZgptqreVmGldfcwewnHRfBxXRN8lkydm0FV\n36vKQK4OLVTmfI9Shxwev+E5LIX+Ox6wE2/TEvxCKeV5CDfOP+TmjX7DfPLU\nWRmfmNF7lK1lyy1PGQRobHS7hw7cOUXfJAR6LKQBN4BXxqLyZcMYbMo2Jmqi\njiFbfLRRXxr5mEjSjvcooFk1cyEg46cbbplXuvyqzbwJW2m5pG4vJyiKMXjJ\nJ88FFrr/bz9A6fbZAO+2i5KxtxIjCWGWrXUrpaHxHWbkIGJAjM9sdaXuiqjo\nZt6PsrqrF/dXbr1LJZOwuc/iL1OVaj8jSNuW0XGhKQZfodKTG2HepZctX5Vc\n8uPG0UfLVJE6y5E3TS/gqXqfjcP+GSQlz5ONVHCyNfdNf9WDs/2tagXF+nXI\n1vM0u7KbMXV4leXXSiGTbG0OczFvZN9FYs6bpFZbe4vdl4erpO2C0gfMeByl\nPYAtfEolcQnlmMxaNfA9vEg20464lUVrVhqi4egO9rXmiGUb6yNazjqV/VB4\nSQ2e\r\n=INlu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAudlmJAFKuxzjvSSFlpnCGlJ+d0oMqwrYEroALsPh1+AiEA+phQvJQslEKglUjkw27L36mHJPPz1cqfvFCKTWNJupQ="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.1.0_1531398715309_0.8253579889939695"},"_hasShrinkwrap":false},"2.1.1":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.1.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.1.1","@atlas.js/errors":"^0.2.1","@atlas.js/service":"^1.1.1","knex":"^0.15.0","knex-umzug":"^2.0.0","objection":"^1.1.7","umzug":"^2.1.0"},"devDependencies":{"@atlas.js/atlas":"^2.1.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/objection@2.1.1","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-rYDAN14ZSTrndmwHEPKzob7xXBiIxluv5f6pszAmrsperO3FsQrJieTMy5nl3FY/CQQ28Il6jmNfMFzwcgwmWQ==","shasum":"ea5cea2695af77a7bdb686c8b00f834cf80a382a","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.1.1.tgz","fileCount":34,"unpackedSize":93797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTeEMCRA9TVsSAnZWagAAQkQP/jHv65BYzhGl0P9DabjR\n7spCdILBdHbXqWZrb82POO0rZiQlZ8TFUNS/1aoPpP8LfsSDtVwLhcuT4qn3\nEme8cZNPaCbM/priOl84B2+nnq0egU0aCeGSAAlIHmPtre3mGwpQ8LEDtQBh\nP6rjPae7ETAnDedf++sCVyeWX7OfzTTTAg8H5PA7eth7yQ4/DzVeLU0IOjhX\nEXDJUWBCS3Ok5yb+Olai5vFh3VVrgK8w5h4YkUAzo8/69gVNyC8B/wP0CR2Q\neWaq0nxqQCK5jx1FUCb38XdLqWFlXPp8mKId677aUbcj+G942uh+x+nj8MrY\nkBv26+9EWDvdUNgDoE4R2CRQNx4Qluaw5NOvTjOLlJaQL6ALg/1v1CfoMmZF\nRF+O5gUYXpKlvXTpwgwDg2myxgoROsw0xRKU1V/LAKjMGtC9y63bVd92fnBH\nni3LsIEQv51/cgSfDSiLHkgQAkVI6tq4Ps2d6pslYqusjG1JdT7Y9ywZGlhc\n3oo9oM5IGKk2c1j0Wbv7la/1zrXdfov9i24NnqE9i/YQQlstTP0+fMJZZbWv\nYXdXbJPw2Q+05peQjsR/gkeQO38MbEaGV3Negwd0Ty9TKPeP3XrvwCmHsxAh\ndzCqP//+K7bFPXMipM4c9AMIlGp+HmDoOyl8Zj6iaV5XlC/eaTN8NuBfvX6y\nE/KI\r\n=zWZi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBD2+jATINPnTW5xFOA8CII8aKs/mcIwVh6i+WGwKDbAIhAIstboRkHrJyAUwf3KmkP+BrlhwAQUugMaa13Mz3+0XS"}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.1.1_1531830540427_0.6334340344256773"},"_hasShrinkwrap":false},"2.2.0-alpha.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"8b6af27b5ca8e64ba5dffa05e92c01d804dbf6f1","_resolved":"","_integrity":"","_from":"file:atlas.js-objection-2.2.0-alpha.0.tgz","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.0","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-6AzLcCF5flJHH42jspv0jqH0r1rav22eUqEAm4js7Js0I9FygIVYi9A1Y7L+5w4/XlRB5H5YUu66qnTX3Xeg3g==","shasum":"cb068fc54eacb5eed5d43528110d2371f2e05c4b","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.0.tgz","fileCount":37,"unpackedSize":101777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCnM4CRA9TVsSAnZWagAAntoQAI04REYaX5+NM4rhy8k1\ngk2TzuIInGy9YM2+QleE3YCj+mvpC/3s9KQv+3Pdufv7RTtr5oVKz633mYw5\nWtKcadNdtJn3YIGgJqITiydPS8yBApbzEh9d7+ueAqe/oVJbtrG8WOgXr5lr\n3Olzg72Yy/9u20LVpOkHF3AITnohmz9chCDFt5X4DAGrFWOgZbfZzmQmsun9\n8WKuYNoNzM/5hB4CNp4G22WfFTDgBR+h1xAWRxt3Duk/OgpGDgMjxpiWdwfF\nInU2W2tjYdOgDbmDpfCpDrYokXr0xJN7GRRHyUOOh4kdW8da2yiu03zjyQy8\n5OpZ14vvUlnkmgruoWIhpxJX/ZTaplM5MP0gyHBZ5wcWlYy/atCVgzKpoymw\nLVwMJ3FHj20sAWoGlT5mBncqC5iWjNcYoepVYi0oApZKp+Q2fgr+Xz3v+ZCP\nNu4gJBa+eueOJ6F92h8zHOKYbLL69/1LnvXGt7LOhJjnAbTgowu+YGUWEHID\nEhaS1zBAS1x8eAtOyjB2g7SopNc5TZ1NsSM1O2WnFouAuHvzdZrfYt3IXQKX\nL0hCS1mGQVWXp8W4g9diQKH6Ik1ke7OII9NppG0VQPQ/Mddl9DzBydwbLPdZ\ns29dtmf1a1N9jfW5NNvpelpggh+6YeB/GMZf1X2n4gdo+wZcwGmB2J9oepcM\nnSqa\r\n=k2uQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQXhC/NIkxerNfjjsJbzX9+vCyVuztPTMA8ntOkDVUDQIgBY5OJPrVfP4nPJ8N2phND0o1CXSodwr83222yGIwU+4="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.0_1544188727902_0.0478876608330574"},"_hasShrinkwrap":false},"2.2.0-alpha.1":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.1","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"e58999d8f2eee67c5e5e0f079f273f65ee9932fa","_resolved":"","_integrity":"","_from":"file:atlas.js-objection-2.2.0-alpha.1.tgz","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.1","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-+tPykNowX38ofXhy9ZZo5onv1vcWOG7xKvLlLqGbL9WKufe93Xq1MuzkHA2MijBhtKLuPwRbXzoes/Kw2fDwiQ==","shasum":"f2c929fdfccc47acb19a5e043438f91f53c40a90","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.1.tgz","fileCount":37,"unpackedSize":101771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDi1kCRA9TVsSAnZWagAAzX0QAIlHXqsdf/6UGsc++/iO\nrXb7FQJm2a9DyaeAo01T6mU7pQStEdEHv3ACUt6qHkwbRQRql9rrbIdrLomZ\nhVgQks+4D6EgOykDZejqlygB4nFMRQ++obI815rX3UT5GFzdCqxbmdoPGHf/\ne5ZzLmFW5kgMzvOxZZYtZbH0gl7J4J8Nbj1aTryYCKjT1vKv8JZ5yvZuRs0j\nU1VwjXXurtbmwe8P6bmr2aQexVk2MR5+l3nDxWCq1tCt6jqbkvbFnxHNWBkL\nLLjQp+Rcxv8X3KCj44lM3fUcNH2SaTvO4/DESG7pwL8E2cClHT48fRFRp5Ed\nAVxP2zSlwAg3zP27CdHmtJGPurq27EsccPMF/pAaM/Axic0700XNHaWrI278\nR2k0hidInnpHsGfnEZupxJ2uzOiE0SqT+lyPc/G2SRWZXGN7HwXdkHW9gR8j\nJ/L1KC1QfjK/hiCpAON+kP4r36VarOhfhUQAsioE37PUmO4znfZNyhkTZsBd\nalO9KjrSOBMqtF1vB2ByVsQzHNtvORhqG7NBn+5cC9mSuraSEFbbQG/M58k3\nJZXjv9ZIfh/4oXw3WoaWCMtrcRYXeTcF1NO7cDGyNJLk5zzsYIJdG6K688HK\nIK3pFCk3iWwzrEONGwklvneRHFGIdYIMvlXkXPcR4OyXya5I64hiOuZ9hl9j\nEhvd\r\n=2IBC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7lc393nUWGHmwwBmPzYURW7CQFtN1YDwC7qgdZQahGwIhANuEWrfYOkKAo4QeYrcW59JDrE9BGxSuDFM4n1wLaCZ9"}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.1_1544432996047_0.8917566737079405"},"_hasShrinkwrap":false},"2.2.0-alpha.2":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.2","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.1","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"63f310da00ce969d92f1547d7635e09a56dd57fb","_resolved":"","_integrity":"","_from":"file:atlas.js-objection-2.2.0-alpha.2.tgz","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.2","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-uGJCNjj1QVytzUnDh/9SUx064jkY92BHN9tt5trE+KygjOztZ3pmD3j4fuzImujTsU5WIUFEnqQd5MAQXvdBRA==","shasum":"22fc1162b2f5173e64375352b777c9252e6f22d2","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.2.tgz","fileCount":37,"unpackedSize":101805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD3sxCRA9TVsSAnZWagAAQoIP/0sTEdG1lSl2cMCY9igl\n4Mghk3fosmgkTM+0+s2BiGvsuxIGIgFjL/VShO/PtCk3nkHp1nDTFI2ataqo\n8yKWgcUlqpSmjM/yJ3Yz3DMLHJZEts/l/0XFanvnqX6yGHzJytfMwjTgWEQh\n0E2/dmvgP0l8hPiyfMYUD+47M/7eynnBF9T9ID6Hpp4RF9m2VkwuD1F41qHJ\ne0pqpx6z4XbezAsULP9u/tovU8ReKcn1/fQojsYSsyksqd7z9w8QUqvj+tov\nR6JkTx0EypbVZF+IxaXN8A1wE87FR8NOJFp+UKwFB3EXD04WbObgId0F3RWt\nqveMI6tt2vbI7cJ/JmKMYedc12f9LZLsWG2DEv0lEyOT6VEUCU/HeEp7Bkil\n45pXfVxIReTtFq9vJ+yl9dCtYoedWrixlqMh97uvdk+QJvgS7ammCGQ4f6FX\n3NTZ4R2metdKuiz2JlF0Xovzjbx+Teem/c4otnRj0VmGCBilAm0bWJ3cuVb2\n6hQ8sUkTjhAxgG9aiG1tx8l74Gp0BpeUzukhNTVWG5D1dzrR4KuNxpshwsVn\nGiv0rlLLE2ukNKJfkmeYZINfUSVmuWy+45Ku1/0m5xcNOzTDvJRPjJpvHeFo\n5FZrPE1V2B2lsOEnigXzb4BHpa22u3P34LssIm1URepyGjpOwYC6DmFlgUpE\nMAx2\r\n=E1ZM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDz33uc5VkV8pzkXRYrrN2lQPErDVUeQ/b2RqwyLPscOAIgVJayGmZ5fE/6JssaAD0Hcy17d7jvkjWVAAN4nsL98Jg="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.2_1544518449138_0.5048040763235893"},"_hasShrinkwrap":false},"2.2.0-alpha.3":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.3","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.2","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"7b27ac160fb022b2f275b850faa70b26347c339a","_resolved":"","_integrity":"","_from":"file:atlas.js-objection-2.2.0-alpha.3.tgz","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.3","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-mZQsf40Dm2JNh8nUr0mqz2ciJW+6R2fpn/dFPFjOCZlBfSeRHBLLWBBbrgLfjzmn8ifjgDDGsv7vg3dvoyyKJQ==","shasum":"a36d00ff2f20a2e27cd82972f7d44a387624d8df","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.3.tgz","fileCount":37,"unpackedSize":101805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD7fACRA9TVsSAnZWagAAp0kP/ivq/BjF3HdCV40r74V1\nZ4l/HAlulYP+E9ayNQne4QLbAQDoFdBcRDFHyc8qtKUzupE2HOjkR6ZGDfYK\n5n733skqOMjBFnvQ3808CCvu9jSdnfAZYsJaLG4Q12hyG4pCXvzmGL8mcBcE\nUlOqsMoE1kkva6Jia2EpOYW+4Zz4jkYwiT1i/hDLPTjgk19Q6FBdrT1adaDq\nXDw7sDd5WxFMCWJyAjBHmwFAxievTFpBGIVjclGeDw7TbRvAxwMwmvqKWdgd\nc0bQvg1/DjYHEAqdzi6RssjIaCFauLFORA8PLHtfGtnWUiPV9bNzzOlAZHHZ\nFpPD03C/kY8+dmrzj0uJ0S15xhYUqD4zPoqOw+ky6JaXSZ9LLSjdgoGPbceI\nRQYkbx6jlL0V0rUQOxIVRwmRVU4P/LjyseQUwYH5cCEaJP7y9vx+DbHYj57L\n5gwyy3//kjxCKjXspmxR2H8a2jicUws1FVP79R9f8kk7TKsYrCSfL2IxmYeD\nhW1T1Rsg7IQbyH5vWyFFVZWfW9y4mU4hD0ChXRodABrQEHHHWv5cfRhSA888\nuobFwbt+eJmVjODEbigaiZhsI4AHVWBUGrs3rY2exKMxU/M3CZtLnrtiipfy\nflFDIozSprFEn6OC1tYXGYJ0XzihVB9+XA6he1IiaBWD0YGiVaHBwawcBa0r\n1K6H\r\n=gE6F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFvHTQcE0OKuV+JvkA+9mNLM9MmZnB6gBpdXW3vox4hzAiB934xEbkKkxJExTOTJW7byBjiUSTxlzpOqUBMotyLw4A=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.3_1544533952157_0.7914848569578106"},"_hasShrinkwrap":false},"2.2.0-alpha.4":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.4","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.3","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"ee441a017595bb0b88e20eec1df9cacddfdae96f","_resolved":"","_integrity":"","_from":"file:atlas.js-objection-2.2.0-alpha.4.tgz","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.4","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-fNTdyNLr1DXtnKnz4RmOawJthY/70YwbQZr5Wfy1BWYCv4P7yHI59NwnpiQpIrLgNKlRoyGA/A2ZV46gsOO6rA==","shasum":"6a5424508e52d5bdc4975728df0340f86be02dbf","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.4.tgz","fileCount":37,"unpackedSize":100092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEqVOCRA9TVsSAnZWagAAGf0P/1/hR5zoElwGnp/bxU9U\ndVKGYLLf7Ry0T0PWG5vGm3ND72+jrMSSzlCuMIIJIW7wvrZh5bB6K0ShuqJV\nBzvOGKG+okBYQujZLJttsbI+gcHAMpHBGpTBSpTCczYyZLDvm8L0Jg667GJU\nXL5gxKgrW2Gmjzi8LxNRJ8UMDwL6lQDXlimOJLFE4LSRNRhXugEOSY3QoTnM\n+4/CNyPoKr2+ZUDV20iCqQFw+BS5EeOOrC9OPCMGhyp/XRTdQHU3mTerLGr2\nrYcXFs/Shoyy0rT5nqfw2UY0ZUtExukHiJ/GgchjLC5MHJLQJDB1mRGDb0QU\nrbxTt05pokyz+772hmntVRQFnK/xc6c8hgiVU2m+77bUsJS8fnc0msXuOZTq\n0taFG+wA3wUlIyXFXkjwJzWJQRvAEoA/I8ph/tPAYMEdC2ETmsdS2mDvTUt+\n5eGllSR3+tGsp44WbHKETwwq/kZQb25oMtxQTKn/2/LXuViufW0RI8+KEBZR\nXcHlDhHRpdT6zqVEZlFcHBcT9FXYYwJqb+T8ZZy7y1NQ8SPnJNFS2DiLNXvs\nG5K5DLF8eF1MKWbk7P+YPTP7gAXQnowWmjrVoecSK2zKVhraa47WTNWZejlu\n90e8j5JTWE6bAQd2jNjv2fsRdKvhryT+rdcUb20gHn3LUHFjpURFhGZyelN0\nWe39\r\n=jQOR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXbqpXF8lAvDlloyTf0l+b9YBTSCqfA2APuEdX8m62AAiEAy655m8G4dO1pA/Ecb9yOqo/rUfclhYoDMf6rPyj3GRM="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.4_1544725837967_0.14157301605432293"},"_hasShrinkwrap":false},"2.2.0-alpha.5":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.5","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.4","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"5a7ec5098e521b7d14d2ecdf584d1bef188c9bbf","_resolved":"","_integrity":"","_from":"file:atlas.js-objection-2.2.0-alpha.5.tgz","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.5","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-w/q196yJuNlN71VAJPJV22UJqvPka6MTquwsbmfmpHKGILV7uuLgQ2zBT4Madfm9PPUaaH9LtcPcNRREUa098g==","shasum":"b9b4533216d72eef294f5f11572b24ee3264cd9d","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.5.tgz","fileCount":37,"unpackedSize":100092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGNckCRA9TVsSAnZWagAAKtgP/0CKnlSYrsatynbo4MAg\nFRVt9Yd9p5M4YgNgY0ZXJNf30qvSjP2DJe7BhsK/mYkAG1RrIqNt7W/8MMlf\nJmzX6BmD1mY6hnrui71t+kGT/Ob62WVU9sh3cfFokEqSM/7jnhtZNhYSExij\nG/NoRCWPoBtNQwo/LMUQmo5pNClJ+xM4P1LrWxPwfd/HYwCyz3GlhWbMMEUS\ndibZBAP0PYiEr8QVIEIJ+K31T24i4RvFpcWugJGTDmbogRDqPiDR3+IXMR+o\nooR2SPl7WNNAfci1X4LgT+iL2bRDtiJWB7odtzjfwTlFq+hoh89nRlswu6Jf\nzhdT65Mm5kmPBWmlkiyx4ceHl4n0AQr6vx9IvjAXR8oQT+et+7s1vLjt2PIy\nKow+vBHpTwRAOahhlOk2eB3OTg8ngFcmKGbTfv8hwHNAofDBrX498vd0ksu2\nJ3dNUV0Lyk1YMKw3C+NXKqWRMcA5ahJUW+j0wp0OhhdZ4Z6KuQoIeetl8fZg\nPWbfA2+LEfczwlVcmOU74Gco6aA1nY+aaVhDZoMWWXJdscFmi73iUQx9k4PD\nUp2YCFTjNNwC3ald/4NoxOzBmeSHgEPJWXfWY1Er3d2dwpB8+0KMLC+vWX6A\nkdLr0AUZEzq6dJRGhRX95U8X4wB+wnf1smTWgHc88dx+qcMLW/rezC2dDFdX\n4J51\r\n=ORtz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDj2RMfSJd9LaHkdfx59w9BmgR+YICGDw8UBkaiPYiL4AIgIkwW7Ds8r5wp/LBvb8aZxPiFZfcrHmwhwacF4jm3eRk="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.5_1545131812371_0.37314368186821145"},"_hasShrinkwrap":false},"2.2.0-alpha.6":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.6","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.4","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"151ced75e67ba1ab81d09363bf5017cb0fad2ea0","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.6","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-U673C61RK2gtVyDurSx8HrUSfXRsPe2qCYVJmymn7EoPWA5kkkkBSUT4iFYJSsqo+ZM/298qTD0otm6IT2GjKQ==","shasum":"5f0bc26a1ef2a07023f3827294e791a90050bdfb","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.6.tgz","fileCount":39,"unpackedSize":107197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPfKnCRA9TVsSAnZWagAAz88QAJY6la9cnxz7pyMMJgnv\nEdM1xhmYbZxap7MNR/U6EikgKoJjkSefUHdN4FoTBQZjBR38hJMcvF2tBOyM\n2daUCsbUUT9h19Ukf2VBlsLH+YHA4GlqQepFNjjJRfGSt+8DB9a3NV+P5rad\nJq5h5ZKa1ShT1e//bCTf65ctTGIZscA7zc2P/qbA8WbzybETrLIBeqiPIFsN\ncE0ynQSlTDPrF0nEcdzEBvojN9gkADAOOlUUEdi1K1pfUP6tS/CZU2iMhK2e\n0mIIJUPAjE0fJ/QaqxsjrhqNLs4yPYWStb9HWxm1+Y3pzfRWuwOSG3139BKP\ntF1/+Ktsn0HR4CAHk9MS/1F0FXr7NShEAV4WdVmJ8l/P92ukLAps4VPwppsy\nSa3eJjUmua0TpEyx0mFZYYQ8Z/7Geyisgo1PnGWCk7Rwnsne7mNWq2aNfajK\nZF/cMZo2dJwnkQc4YXi3/HQeNev7gp+8MkhI/Q4Dusov56AxmWbnGdwRMdZO\nly1jAmBvvLrLsrdFq+zJPOeQI/bsrQ4je5rV1aYGIrcx9bR0Yak5mjwT5yQb\n3QajhSAQO4HszKiWKtdYdSy/8Pmv7uJQZ0GxvUIaT2mnuKgi53L5U9yiQmls\nBXFxwJMdahaDvHJgdqJUmX/irIDfimRh+mEGIp82Cw7xyTUqAsdRmLRLhKLf\npIPq\r\n=smBi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHr6CryNnEN0LNL6tXMao+/3SLBEdknuIprrV1O1jk7uAiAuRUNnKCjyb0/jyje8jz0n3Pb+cy/GN9uNSwssFFWIbQ=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.6_1547563686935_0.8337048769903845"},"_hasShrinkwrap":false},"2.2.0-alpha.7":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.7","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.0","@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.5","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"8b27d87a507b5ce31392fc7c02b4b3f22b14a163","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.7","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-VFSZFFzIUcWKw44YgkBae88rif0rVL85o98L9dZ9bVHc1cfrPAElpX7xAF01yAd/XDU8Dx2obJgHuRlxkoYbvQ==","shasum":"de4d2156ee1655a83db864dae5c746b84aaa8945","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.7.tgz","fileCount":39,"unpackedSize":107409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPvQnCRA9TVsSAnZWagAAPF8P/j/KBjxvuJR0weaXOHOo\nsLiFdJuczHjZMSv3zxZO9P+Q0o2DyxiEDBgLzdsS3I7SlQaNofZcwWzHGXCt\nND3AZWB/53qk44W4HkWA09ArqqVHFDmiybufjXNFVVzWxrnbeHkRR7Oy6kdF\n+OE4xzWZs4+91Kd2fsScy4TDxhIBqp2kwaaqOZqlimCXeWdPN8XEipXsa3Rx\nXO2k64vwtgt5M5c3u3BOzYs4uNX94ShvijtGRUSz+n8ssf5h5WJ51HvloBfv\nnWs8Is7fj4pxUUNvzG1+qGGQq51UKWLp9rv+lC6+NRcEiDuFlw4PTwHqRZzQ\nZHkMEOKrWy55NW4ChyGSS0bvatKr/c3W/SrQ+4t+RP5mOALMtJSGQ0Ggc7WZ\nvRLBasEJF/usVGmu1WyxIddYfg+K0dbIfbMTJZxlQNTCz0rVwEtpd5rcDyox\nasAnq3TiAYHPpMkp7GJySjLVokzmewP1zXVeW7nWkPTwlJFeMauZGxX2RG48\n1EU+FG+PplCAJjWDvh1p2u4o22JwRvkdOgg/10Eu5evbsw8bFjjZI/T1QcX8\nDdeQ//5mOfS5m6fCSy0X6LtSCsubKCguY+xo8kdlCJGNDtL4d0XRINAgKSgu\noP/a4zG72Xw4hNOxJwRYk4nertapeyi3NkryoHcdg4IwSWUlxvV2Sq0kg0IR\npqT4\r\n=PTcE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrO1iZqqOwacY6k/dtbGGaOkPRN+Stx1n/cWW76vbxyAiBJlLV9ZXW8hqirAroIQNVrep0sZg5VXoNHsyYek93ARg=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.7_1547629606682_0.6146641302279268"},"_hasShrinkwrap":false},"2.2.0-alpha.8":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.8","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.1","@atlas.js/errors":"^0.3.0-alpha.1","@atlas.js/service":"^1.2.0-alpha.1","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.6","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"39c0427aa76e1003d5f4acf19cee927925ca0ad3","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.8","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-+zLU2FpHLfD6wfLGmLSUdyFKLhVC0VVY5RrB9Cy87iCBWVn7Pk8WWd+gJU9IMrUQf4sWSi1hNY0U7JREkq1jeQ==","shasum":"d2167182a436d165bb6f067e1ebd3f17947d37eb","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.8.tgz","fileCount":39,"unpackedSize":107692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTt7QCRA9TVsSAnZWagAANTMQAJ+cqXvQ08m9c5cX5/HZ\nMrwK6t7MV9XYblmeA4EiMpyhEPXBW+M1VW39sRcEfDvOoK9yfAU+85CvfUfy\n117cT5dVPEgdklUEJ0n8q87J+7udMCqUhZ6fE5o7m2vaWtA14tTv+ihLAPvA\nB6P0ufM/dQ2J8JMXfH0f/ZPuia611LnNPUFvAohxCM5OXfhIGBTN8r5XkUNz\nnutpdqH4ZN/3ZPdAFKFYDPf6gchh1GF40MxpA+om/zUlTBBNUs0mnd8KEMAz\nzowSxBSnYXlpqt7XPQrdw1O0DJBIi1eTqpx4nsb96ImcUhXZXLZYXor5wvpy\n6U//CJwIt5hUsGPb4/rGV0QgHjBMOlRwODzTXT2mEkSBl6tdkkSRYVuAMze3\nY6dRqEemCiXppEvjM1KkkvLmbJhNh9f6tdKr2cO/danDMQnbgpM1jRbKUGBh\nXBD4EuPaaSrrbzCIcb6DiOqfGQ+nwlRZUYlJvIOcDsPXNA3tXdJtEQeJ2b0Y\n4eUs6XrN6g8PgTSvJQt1gMzn/9p6Pe2jS3F3rUN6cFvzGTK8udNhahG2Hf2c\no406BlyY/DEBEJKgJJ1Gkdzh5YOKXUZd2AlDME95mALb/nlAaXeTsg6E6mze\nP91TVJROCOpRMVDyVqrvmvmsHAx29W9ehLDB6jkQbJMmOoYhgN7r+SEZr2ru\nOyEh\r\n=FoiR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLpAKCa0sNiWXM2G9wbMooT8lxRu7iM6737rkYZ+obuwIgDY1ny2rpztQh/PsDfEo3JUR0u4/3ZcP+QyxagcGQX70="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.8_1548672719548_0.09681288881125028"},"_hasShrinkwrap":false},"2.2.0-alpha.9":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0-alpha.9","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0-alpha.1","@atlas.js/errors":"^0.3.0-alpha.1","@atlas.js/service":"^1.2.0-alpha.1","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.7","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"20fa27bf205f83baaae14c5ef99c6ff8e007b214","readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","readmeFilename":"README.md","_id":"@atlas.js/objection@2.2.0-alpha.9","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-BtWwWVTkrbKtiYO9+Gnf7dTAVe5Mj1dIrAlOjn86XYTQqme7MEHploesHgIUwwCuYvTKCzNNGZwuKJ21eT8G7g==","shasum":"00e3e363d9da3981b00b7afed18dbf575280d4ee","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0-alpha.9.tgz","fileCount":39,"unpackedSize":107904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTuJ1CRA9TVsSAnZWagAA0WwQAKHMQKMX2/engI6OpAZ+\nmR+qWXy/ZbDVcvxvn6Asl+g0QHixQyDiD8YGnRCbZS5SBMhCh2Z97lOyri2S\n2oPS5ZlY3+LUe5qm2F0QL7pAmD3/y3iC8P1ZvfuRJuN86+TPeyyWqcPDXwpi\nGjWE+M3HD8iipEAC/iaHYvDv3LOAuB/8hpvb4/5cRHBG7rgEqmP/PgAKaa+u\ncNOyGFBkdpA0jtTkHoYAavETk+WSU7HqyEin6yNnxt+WHlJbC1/yFegxya4o\nyMLcNkVLTKEo/ZfqOZpTB5jIrA2SP89OEFsPbLjTHouUhzBLgcsiNZvG97aW\nIvh1qt894lBj4JCxaiIV94uEnv3C5ecandOu1e84Au17CAUwYspATzTlDFXI\nsvLc6PonlAijcAufhizqNRO05+VkekLAGj5Lqcb+0i0zcatCi1IMNiIe6jwk\nLubgFPe4s5asDjPKUnHW0+USf0y5Z8/7XjGwPuSOpJw7OY0vjfCIG2c1TsKe\nAAkuGEL/zpdH+u3ZLXYZlVb35ArPbhui4yNjGz2nw1TNUEDdrTopd/1F7P60\nazxe3Lz3QAoDE2CSTRyshcnfc8HWjSzDwMmvrA5AsHTTQ0pGxJtLbw4TECtv\ncPeueWvuW9u7im4G9CtITsC6cwZW00PTjnk4Ni/bCru8zpX520ge/Zlq/ZxE\njEdH\r\n=W0bV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG85E9k4fDkoapm7tj7RLMn3iCcmdG6SZhvx7hk8Xo0QAiBx6rWuM8duZHPBLQRTrL1cdR/COwjGc3VB2d1zqrwY+w=="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0-alpha.9_1548673652583_0.19039542560518452"},"_hasShrinkwrap":false},"2.2.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.2.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0","@atlas.js/errors":"^0.3.0","@atlas.js/service":"^1.2.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.2.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"e67f1220a6aa157ef078f26075b6aa5bfad5ee18","_id":"@atlas.js/objection@2.2.0","_nodeVersion":"10.15.1","_npmVersion":"lerna/3.10.5/node@v10.15.1+x64 (linux)","dist":{"integrity":"sha512-LlZpsdOm+s+cx1aLAylUByrtWUEO+OxrkeRKldj13U43yd5Kbb5E/8+SkX6rPVotpQfvaCK7EHdDnTUS0o6KzA==","shasum":"d961cb0e7ce76a639ad41ea283ae2d0100636b65","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.2.0.tgz","fileCount":39,"unpackedSize":108798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXWHpCRA9TVsSAnZWagAAk8gP+wXxu9h6GzCMByDAmEIl\nxaPaDhhFjMd/VIJM5mRpIlpob7yYWyTbJDr/e0i8n7hLG3aFiLDKqLMlekwy\nsn7Xz0au/PcSOtP+sK7vrVvkyR2zyjxqnT9CCxs8s/uxKKOtDdNZGSMV6jHT\nHb+Ei6Pfbt5FCtReD2kwcOpjrzmb1hxon9OlgpkSeCV6hRXyREdUVXb3pORL\nJYPOvqzJUk5hZYIR3zuS5t9X92ltoDfOfjnCkADHrwgQFw05jjGuSvo127XV\nVTz8LR/pTxoDuQ2eKEjBF2xwXMqbYRl3HuIrw3hw8LdyZF0qznPPw8JEmyh/\nyYw98s4uBKEaTYnNHuBvspnrfFhJGAMc9CmG3NJNLGP9sKbblQUNljOjef6P\ndfnyOsHMQ3X1OXqpesSmDDT5SYP+fw8w1r2bx/95IYa5+l0QDH2xFWUi2yWH\nfp3nn7bmeAvn7TBsZYBhCAGO4cnj+hJQZzuKt1bJm5UK4+GOGW4f/Qj/U9zg\nBInUJKxNQb/9Fa5ACxOTkpN2VSWsdYxwB8Y+5fc049yymT3AuDezOVksN7Ny\nefV3vhzpC9gnxz/+5ADQbhxIvvGRwmKeMy1afXTooe0JIPGv/Uj11wcq+X7C\nqcx50V8SN2n0WbrsbGJImfF+zn2M/qwauZT9gW29AFt/7JG6ZAmJgpZf+UIS\n9P46\r\n=HXdN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDm71jfxxzWMcbxyR/BetigBT2OID9C42sCl2Ch1eTx9AiEA7n7xZ7nvfi+TRolQ3WAHnvh8u+WtIHNihYSor+JuEC4="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.2.0_1549623785140_0.6077976510071967"},"_hasShrinkwrap":false},"2.3.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"2.3.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.0","@atlas.js/errors":"^0.4.0","@atlas.js/service":"^1.2.0","@types/knex":"^0.15.0","knex":"^0.15.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.3.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"5c97a07bd8836b5ec1324990def51e7a310154af","_id":"@atlas.js/objection@2.3.0","_nodeVersion":"10.15.1","_npmVersion":"lerna/3.13.0/node@v10.15.1+x64 (linux)","dist":{"integrity":"sha512-9uVQErXr/X31jtY2tBkmZ81F9enqWCRAvnQQ7MEoWeR72FlcTahLmKEgZ+kg49hdIIRuwDeuINlZnf87Vqj5cg==","shasum":"7a275560fdf1d186f35bc3a32d6a6ab0710ca2f4","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-2.3.0.tgz","fileCount":39,"unpackedSize":109392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbUmOCRA9TVsSAnZWagAAz28P/ip5eC0c6jvPgBjI+j5U\nnrAHhO5Ggh3bcXp/rtwZ1LECo3sSDfvgOeRmHyTZQSi4VaRujd5iCexbvPi7\nLJha3eyTzNf82gK8kR5HutQxtvT3+tk8x43nXyjxwRJfgxk0BCbKWoAahmQj\nB5eBJuH6XY0Aiuk1jiW+d714KuJvUoJkqTb+lIzYYpVfYon8jn29FdowRa/T\nnz0+xQh2vL11eIX4jU6SV9jO8uHH2LMNBeRIjIPnegRTYV3PZP1B0qTd51/T\nSr5d8zkqITj2x20CuOlseffjNzDFvYGLc7Sc+iwhfhQYh2dbRCdteab6FPHE\niyEgzwXt1qr/3mGY61hiPVdW/5FmlhoF8F7Cmih2NCN84m0vWk0oV66iMs5N\nt8YRP26WWHjhpVOE4E63Z3Pg6CsDR3KkCbp1UdYHHI7sEk8QxCFsTemxIqTu\nN5Kxh7drxk4aOXWZ86EOw4jrdgAXUPFBH3BL0UBAZQ+yR/WPwtfmdWG08HH2\nwiJ4EGP9+oxwvAsyyTkO7wY4PgCy7YiMiXZDpEsxrIr4a9pi+nXqCTrfU+Fq\n7UQ6UqK1ZuqudTQWwwDhmsegXdfjtwsYRYfBQdakWfPJyyyaEI5k1E7hZdJn\nRTHTwjgFq8N3k5Py4D7/3mG08PEp3wiEMsIIIKqkHgd60KLSpA3YJNaGJPPb\nzrzF\r\n=i/hr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqdaLFURcCLo8YxvaNiYHLrZScr2CLOz1zm45XrkcXPgIgaLWQBrA20NfGrlKTyWsSghdEPt549xsr9ebjRmFQ0zU="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_2.3.0_1550666126399_0.6438990523963468"},"_hasShrinkwrap":false},"3.0.0":{"name":"@atlas.js/objection","description":"Objection.js service for @atlas.js","version":"3.0.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/action":"^1.2.1","@atlas.js/errors":"^0.4.0","@atlas.js/service":"^1.2.1","@types/knex":"^0.16.0","knex":"^0.16.0","knex-umzug":"^3.0.0","objection":"^1.1.7","umzug":"^2.0.0"},"devDependencies":{"@atlas.js/atlas":"^2.4.0","sqlite3":"^4.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"6c9ce4041de9f5c386b205e72c656443101327b0","_id":"@atlas.js/objection@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-MEmXJSnJBw0U9c9oMiPWrAe6GrjgsJ9WlqV/MazHjy9jaQAykmHj60KMTv2v1857FoC6fGpKJicfRdiMso8YHg==","shasum":"ea72c1cb9399a5a83f1a4540798cf0181c1d4663","tarball":"https://registry.npmjs.org/@atlas.js/objection/-/objection-3.0.0.tgz","fileCount":39,"unpackedSize":109822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpz1MCRA9TVsSAnZWagAAVgQP/3cYFVxQNnls2G507xrw\nxYYfgar7cjjo7xPkACOO5/qZBVeVc/l0N6oxUXovgnKv19Hh9hnZ60yOuDms\nJ6sVJTgAJoqaqGv78bQq6dhnK1fGKTKtuhC8KcZ7j+Ohst5uklTQDdhdqq3G\niu1XWRVbrY/1AZuB1TFtzmkXtFkq/BOyY7EqzSooLNCiknMLP4l0D2sQn7Wc\nRmwnaCthfaU21HshBMiGm+CfDn/HjgIDi4+reGb1klxyrJWorqMOWUKANyPU\nHtVW3wiuwCBxzt957+cyQryTgFx1IP5M7/QvfDMFeLxbMqdooOTOiZJudE0d\nVWpoJGg2webszTdkpBeNW65h6qiiO6EvYPuNzaEEqyW1dXnC2L1enByG7vPb\nhAnb530JkpAvMqApWmVPuWpkmoKbRWpJV5LZC9+8I2kpQInGrkr3r6V+lsuS\nJCNX1kGZUDVWb6JxAF6gyTviwarIhvUKvhYy9ERP12W+sE0u1jAhNz6U2aEb\naY9t2llLAx+SacTkcH0KNHM36TxAuG50eWhQP1v72iAW0tjxHPnkhmn7fbaT\ne+xzinC5jtpDkS3rSA0fQzAVvhX8nUKM8OyRbMjEjQXiOQWgCpgAdUCM6Zig\nvkrqFZMPlGZMSOz6HMFx+iwpoatNtMw58tyhcfJ7xUOfHAtyLewB77SBh2uC\nEW3S\r\n=MmvQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsPIL2+dUVCU2jRjrmsuSplB6zF5bbWMpFMVCMnSpVPAIhAIVqrlIa7Fjnlqhc0I/rArKW1EAXWgs1j3ji7MST/3NK"}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objection_3.0.0_1554464075998_0.6953283807558694"},"_hasShrinkwrap":false}},"readme":"# @atlas.js/objection\n\nObject.js service for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/objection`\n\nYou will also need to install one of the [supported database drivers][knex-db-drivers] on your own.\n\n## Usage\n\n### Service\n\nThe service accepts three configuration options - `models`, `knex` and `prefetch`.\n\n- `models`: A path to a module, relative to application's root, from which to load database models. Each exported key is expected to a model.\n- `knex`: This object is [passed as-is][knex-config] to the underlying Knex client to initialise the connection.\n- `prefetch`: (default `true`) Determines whether your models' table schemas will be eagerly prefetched on startup to avoid fetching them during actual requests. See [Objection.js docs][objection-fetchtableschema] to learn more about this behaviour.\n\n```js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      database: {\n        prefetch: true,\n        models: 'path/to/objection-models',\n        knex: {\n          client: 'mysql',\n          connection: {\n            host : '127.0.0.1',\n            user : 'your_database_user',\n            password : 'your_database_password',\n            database : 'myapp_test'\n          }\n        },\n      },\n    },\n  },\n})\n\natlas.service('database', objection.Service)\nawait atlas.start()\n\n// You have your objection client and all models available here:\natlas.services.database\n// A knex instance\natlas.services.database.connection\n// Object with all the models you defined, ready for use\natlas.services.database.models\n```\n\n#### Accessing the Atlas instance\n\nFrom within your models you can access the Atlas instance as both a static and instance-level property on the models. This is set up as part of the model loading process during the _prepare_ step.\n\n```js\nimport { Model } from '@atlas.js/objection'\n\nclass User extends Model {\n  static doThatThing() {\n    // this refers to the class, ie. this === User\n    this.atlas\n  }\n  doThisThing() {\n    // this refers to the class' instance, ie. this instanceof User === true\n    this.atlas\n  }\n}\n```\n\n### MigrationAction\n\nThis action contains methods for applying and rolling back your migrations. The migration files must export an `up()` and `down()` functions. Both of these functions should return a `Promise` and their first argument is the `knex` client.\n\nIn addition to using plain JavaScript migration files, you may also organise your migrations into a folder with an _index.js_ file inside, if the migration requires more data or you simply wish to organise the migration in a different way than a single script.\n\n#### MigrationAction Dependencies\n\n- `service:objection`: An Objection.js service to use with which to apply/undo the migrations\n\n```js\n// index.js\nimport * as objection from '@atlas.js/objection'\nimport { Atlas } from '@atlas.js/atlas'\n\nconst atlas = new Atlas({\n  root: __dirname,\n  config: {\n    actions: {\n      migration: {\n        // The path to the module from which all the migrations should be\n        // loaded, relative to atlas.root\n        module: 'migrations'\n      }\n    }\n  }\n})\n\natlas.action('migration', objection.MigrationAction, {\n  aliases: {\n    'service:objection': 'database'\n  }\n})\nawait atlas.start()\n\n// Available actions:\nawait atlas.actions.migration.up() // Applies all pending migrations\nawait atlas.actions.migration.down() // Rolls back last applied migration\nawait atlas.actions.migration.pending() // Returns names of pending migrations\n```\n\n#### Running migrations on start\n\nMigrations are not applied automatically on application start. You will need to implement your own hook which implements the `afterStart` event handler and run the `up()` method from there.\n\nA simple hook doing just that:\n\n```js\nimport Hook from '@atlas.js/hook'\n\nexport default MigrateHook extends Hook {\n  static observes = 'service:objection'\n\n  async afterStart() {\n    await this.atlas.actions.migrate.up()\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[knex-db-drivers]: http://knexjs.org/#Installation-node\n[knex-config]: http://knexjs.org/#Installation-client\n[objection-fetchtableschema]: http://vincit.github.io/objection.js/#fetchtablemetadata\n","maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"},{"name":"strvuser","email":"licenses@strv.com"}],"time":{"modified":"2022-04-04T16:08:34.689Z","created":"2017-11-09T08:27:26.373Z","0.1.0":"2017-11-09T08:27:26.373Z","0.1.1":"2017-11-09T11:47:10.580Z","0.1.2":"2017-11-14T21:32:28.654Z","0.2.0":"2017-11-15T11:19:07.402Z","0.3.0":"2017-11-24T13:51:06.280Z","0.3.1":"2017-11-27T09:54:24.315Z","0.4.0":"2017-12-13T11:56:34.104Z","1.0.0":"2018-02-15T14:29:10.496Z","1.1.0":"2018-02-23T08:48:31.372Z","1.1.1":"2018-03-07T10:18:42.071Z","1.2.0-alpha.a596c671":"2018-05-14T15:01:34.123Z","2.0.0":"2018-05-22T15:37:08.697Z","2.1.0":"2018-07-12T12:31:55.416Z","2.1.1":"2018-07-17T12:29:00.547Z","2.2.0-alpha.0":"2018-12-07T13:18:48.007Z","2.2.0-alpha.1":"2018-12-10T09:09:56.314Z","2.2.0-alpha.2":"2018-12-11T08:54:09.279Z","2.2.0-alpha.3":"2018-12-11T13:12:32.526Z","2.2.0-alpha.4":"2018-12-13T18:30:38.081Z","2.2.0-alpha.5":"2018-12-18T11:16:52.492Z","2.2.0-alpha.6":"2019-01-15T14:48:07.153Z","2.2.0-alpha.7":"2019-01-16T09:06:47.063Z","2.2.0-alpha.8":"2019-01-28T10:51:59.728Z","2.2.0-alpha.9":"2019-01-28T11:07:32.732Z","2.2.0":"2019-02-08T11:03:05.290Z","2.3.0":"2019-02-20T12:35:26.543Z","3.0.0":"2019-04-05T11:34:36.130Z"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/objection","keywords":[],"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"contributors":[],"author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"license":"BSD-3-Clause","readmeFilename":"README.md"}