{"_id":"@achtjs/sql","_rev":"3-828f0897f9f34825d5532129d9187ce8","name":"@achtjs/sql","dist-tags":{"latest":"0.2.0"},"versions":{"1.0.0":{"name":"@achtjs/sql","version":"1.0.0","description":"achtJS Database Module","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"Pedro Harbs","email":"harbspj@gmail.com"},"license":"MIT","keywords":["nodejs","rest","api","http"],"repository":{"type":"git","url":"git+https://github.com/achtjs/database.git"},"bugs":{"url":"https://github.com/achtjs/database/issues"},"homepage":"https://github.com/achtjs/database#readme","scripts":{"build":"tsc"},"dependencies":{"mariadb":"^2.4.2","mongoose":"^7.2.1","mysql2":"^2.1.0","pg":"^8.3.0","pg-hstore":"^2.3.3","sequelize":"^6.31.1","sequelize-typescript":"^2.1.5","sqlite3":"^5.0.0"},"devDependencies":{"@achtjs/router":"^0.1.1","@achtjs/ts-config":"^0.1.0","typescript":"^4.3.5"},"gitHead":"7aaadc74fc056976de4741dbda9f214038d5fc81","_id":"@achtjs/sql@1.0.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-eTmWNCnv2IjK88QANrfHMH9zvRUnJRJT4UGsmtA+hqEbfl5kPvvU/sVJ3KjhQ9CuSFfUCYVTDQIh1S9V5BXiIQ==","shasum":"adc253ed43b890ba4dea49b8f84ac73b561aadb3","tarball":"https://registry.npmjs.org/@achtjs/sql/-/sql-1.0.0.tgz","fileCount":13,"unpackedSize":10510,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDldR+HlGy2792GBYJ7aW41rMazHBxmwcB4stkyRZfNugIhAL2pKSvJHnxwdmLFCsr5bV/FVi+W6lMP0r47KyFvaLzn"}]},"_npmUser":{"name":"jharbs","email":"harbspj@gmail.com"},"directories":{},"maintainers":[{"name":"jharbs","email":"harbspj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql_1.0.0_1692549438414_0.5542673815318744"},"_hasShrinkwrap":false},"0.1.2":{"name":"@achtjs/sql","version":"0.1.2","description":"achtJS Database Module","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"Pedro Harbs","email":"harbspj@gmail.com"},"license":"MIT","keywords":["nodejs","rest","api","http"],"repository":{"type":"git","url":"git+https://github.com/achtjs/database.git"},"bugs":{"url":"https://github.com/achtjs/database/issues"},"homepage":"https://github.com/achtjs/database#readme","scripts":{"build":"tsc"},"dependencies":{"mariadb":"^2.4.2","mongoose":"^7.2.1","mysql2":"^2.1.0","pg":"^8.3.0","pg-hstore":"^2.3.3","sequelize":"^6.31.1","sequelize-typescript":"^2.1.5","sqlite3":"^5.0.0"},"devDependencies":{"@achtjs/router":"^0.1.1","@achtjs/ts-config":"^0.1.0","typescript":"^4.3.5"},"gitHead":"0ddaa93f31581613e9913753da89bfca0ce54ddf","_id":"@achtjs/sql@0.1.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-fOPv+fnDgcFacJyCl0EhxhyR/C2GDGJL1S0l7RkkWGvmaMBVH54W46SFTN9SDmODm22AKUux8zUK8SdPYnLdMw==","shasum":"25be7c3dfa248b638c6f404ddbfa2800f5399993","tarball":"https://registry.npmjs.org/@achtjs/sql/-/sql-0.1.2.tgz","fileCount":14,"unpackedSize":12090,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECsT9qns3bhhbbYLqdNMUCjTFuSBmgpavl+XvY8X4X5AiAimIkr59+okgUug/MVVuFx1Mxa7f01oZ0WAHUgGrRsCA=="}]},"_npmUser":{"name":"jharbs","email":"harbspj@gmail.com"},"directories":{},"maintainers":[{"name":"jharbs","email":"harbspj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql_0.1.2_1692557299118_0.3312210382925642"},"_hasShrinkwrap":false},"0.1.3":{"name":"@achtjs/sql","version":"0.1.3","description":"achtJS Database Module","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"Pedro Harbs","email":"harbspj@gmail.com"},"license":"MIT","keywords":["nodejs","rest","api","http"],"repository":{"type":"git","url":"git+https://github.com/achtjs/database.git"},"bugs":{"url":"https://github.com/achtjs/database/issues"},"homepage":"https://github.com/achtjs/database#readme","scripts":{"build":"tsc"},"dependencies":{"mariadb":"^2.4.2","mongoose":"^7.2.1","mysql2":"^2.1.0","pg":"^8.3.0","pg-hstore":"^2.3.3","sequelize":"^6.6.4","sqlite3":"^5.0.0"},"devDependencies":{"@achtjs/router":"^0.1.1","@achtjs/ts-config":"^0.1.0","@types/sequelize":"^4.28.9","typescript":"^4.3.5"},"gitHead":"7d241eb9c3e03190539a09dc4184250ab5815608","_id":"@achtjs/sql@0.1.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-S3tSJxfEm9+e0Y6jRJPtd7MwE0l1swACeop/ka8EEABrjACF9d0JbPlnMtOhA2sHCsGTcChGZaS0sn/JZz7WLQ==","shasum":"410fad54d0ece3521a989a59e7d71138e9b269d4","tarball":"https://registry.npmjs.org/@achtjs/sql/-/sql-0.1.3.tgz","fileCount":14,"unpackedSize":11970,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn0T25X7DTHQ2DyHFaMvKrgqS3SoPlAwDyRqztixqFqAIhAKknsvDRso7eUDvK9kOUEV3MUeHT4EotST9bk6DGur5u"}]},"_npmUser":{"name":"jharbs","email":"harbspj@gmail.com"},"directories":{},"maintainers":[{"name":"jharbs","email":"harbspj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql_0.1.3_1692560160903_0.8032972214155796"},"_hasShrinkwrap":false},"0.2.0":{"name":"@achtjs/sql","version":"0.2.0","description":"achtJS Database Module","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"Pedro Harbs","email":"harbspj@gmail.com"},"license":"MIT","keywords":["nodejs","rest","api","http"],"repository":{"type":"git","url":"git+https://github.com/achtjs/database.git"},"bugs":{"url":"https://github.com/achtjs/database/issues"},"homepage":"https://github.com/achtjs/database#readme","scripts":{"build":"tsc"},"dependencies":{"mariadb":"^2.4.2","mongoose":"^7.2.1","mysql2":"^2.1.0","pg":"^8.3.0","pg-hstore":"^2.3.3","sequelize":"^6.6.4","sqlite3":"^5.0.0"},"devDependencies":{"@achtjs/router":"^0.1.3","@achtjs/ts-config":"^0.1.3","@types/sequelize":"^4.28.9","typescript":"^4.3.5"},"gitHead":"9b21a0ad4c48a0e2e75f6d7642b52b1029e5a0b4","_id":"@achtjs/sql@0.2.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Ubza8Bz9oFpP+KIXPUEjZLzedsqpmFmLVqExKSQTHDW8muYY+nGV4X7jw72eLDYQ/BlEz6UmYdsR9/gACjGC9w==","shasum":"884d3b52910e5f813450c5e168cd0092d37e9f8d","tarball":"https://registry.npmjs.org/@achtjs/sql/-/sql-0.2.0.tgz","fileCount":10,"unpackedSize":9319,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF28347d8KhSUy71lMwMbeBfEt1CFBdImsWC6RfH/yXPAiATmEUwMIPoDcSsOWyzdRhnhUvDEzQG8aU6GB0IPQGUaA=="}]},"_npmUser":{"name":"jharbs","email":"harbspj@gmail.com"},"directories":{},"maintainers":[{"name":"jharbs","email":"harbspj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql_0.2.0_1692565132629_0.9194319214568203"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-20T16:37:18.286Z","1.0.0":"2023-08-20T16:37:18.571Z","modified":"2023-08-20T20:58:53.007Z","0.1.2":"2023-08-20T18:48:19.327Z","0.1.3":"2023-08-20T19:36:01.081Z","0.2.0":"2023-08-20T20:58:52.811Z"},"maintainers":[{"name":"jharbs","email":"harbspj@gmail.com"}],"description":"achtJS Database Module","homepage":"https://github.com/achtjs/database#readme","keywords":["nodejs","rest","api","http"],"repository":{"type":"git","url":"git+https://github.com/achtjs/database.git"},"author":{"name":"Pedro Harbs","email":"harbspj@gmail.com"},"bugs":{"url":"https://github.com/achtjs/database/issues"},"license":"MIT","readme":"# @achtjs/sql\n\n<h1 align=\"center\">AchtJS SQL Module</h1>\n\n## Installation\n\n-   Install AchtJS Sql plugin\n\n```sh\nnpm i @achtjs/sql\n```\n\n-   Install [Sequelize](https://sequelize.org/master/manual/getting-started.html). AchtJS uses sequelize as an ORM.\n\n```sh\nnpm install --save sequelize\n```\n\nYou'll also have to manually install the driver for your database of choice:\n\n```\n# One of the following:\n$ npm install --save pg pg-hstore # Postgres\n$ npm install --save mysql2\n$ npm install --save mariadb\n$ npm install --save sqlite3\n```\n\n## Sql\n\nThis will creates a MySql Database that will be consume on AppModule class. It accepts an object of settings for mysql connection. This database will be consume by Mayajs in compilation and automatically connects the database when the `start` function is called.\n\n**Import**\n\n```javascript\nimport { SqlModule } from \"@achtjs/sql\";\n```\n\n**Implementation**\n\n```javascript\nconst options = {\n    name: \"main\",\n    options: {\n        database: \"achtjs\",\n        username: \"achtjs\",\n        password: \"achtjs123\",\n        options: {\n            host: \"127.0.0.1\",\n            dialect: \"mysql\",\n        },\n    },\n    schemas: [sample],\n};\n\nSqlModule.forRoot(options);\n```\n\nAdding `Sql` on `App Decorator`\n\n```javascript\nimport { Module } from \"@achtjs/core\";\n\nconst options = {...}\n\n@Module({\n    declarations: [...],\n    imports: [SqlModule.forRoot(options)],\n    providers: ...,\n    bootstrap: ...,\n})\nexport class AppModule {}\n\n\n```\n\n# Examples\n\nCheck out [live examples](https://github.com/achtjs/samples/crud/sql) for more info.\n","readmeFilename":"README.md"}