{"_id":"@apollosproject/data-connector-postgres","_rev":"499-8b2494d242dc601941f5d54466bb9262","name":"@apollosproject/data-connector-postgres","dist-tags":{"beta":"2.0.0-beta.1","latest":"2.43.1","canary":"2.43.2-canary.6","next":"3.0.0-canary.59","v2":"2.47.9"},"versions":{"2.0.0-alpha.15":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-alpha.15","_id":"@apollosproject/data-connector-postgres@2.0.0-alpha.15","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"dist":{"shasum":"0d28335a2d7ecb2404bf9ef295f64a357aafaeee","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-alpha.15.tgz","fileCount":24,"integrity":"sha512-44YRQqv9k0PX81amlFcoRCEGG/uAh3zfTEcoqmHNjublBzsB/amjXRKUozKZYZkLYz+lm7Xr71h8Ze3LpDO7kA==","signatures":[{"sig":"MEQCID3ZLP7/2t5lmSk7C1xzJ8SQGDS9Qjqi+ry3pkrHsX4IAiAzAPz/er/InUGBlKasXcBWZOxMUSXdy8eYeBpa75FTtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9zU7CRA9TVsSAnZWagAAt2oQAI0HfcBQcot09O0nQWuT\n4puvbx35o1ia2z2K9RXR00cB1GWkP4TgWWwZ4gZ2lYTBEKfGjfAt3owN42C8\nmIX4Rfp5be5p0S1HzOq1M62TxkUyxBJ2sreqKnvfK4whsrZjhVCg+0nISpYg\n8FYbWnPwkov0ODROv1mVnbbk3XJdkmEJnq8gJs9uZ10jOvFBGRA/ZL2+zlK3\nBWsW3/tLNPcoPzpGTU0o6BFsz0coch+TdNopzax1oYHD0V3c+XVZH0VxgGSs\nsG0Dt4DWU25kkXCmAJ26nUwQRpPWOB1rfCHQOoE94BOlQmDZLzJBdb8RtRKk\nxnmDXB+iuPYwgD5D5D9fwBX0wOXE2Ktw+maZsYQpU+ovbLFP9Ijss4FUEjcj\nb61Rf5tQtQVx61vj7pSP8RLooHLYkgHEfmFbzjAss/Eqdtw4pLoBhdFONa4j\nEC1S2Ra9cDzljEzbWzdnSoIlt9nPxcaGqCMGnhDyF+BanvCZ3Imm3yebQsht\ncG/QoS/grCKnmnWBPdh7FiR0pMGIxsK18aFmQSG3gOtcbnvhlQGzu45uIdIK\ndZzebWcFTBZujvLeqMJAmxAcC7LrxOrdJzaEDj0NWzbZaoEoIgSyhlGFDyJn\n1h/q4h540nlpN2vG4IkxrR4hf8KPII2+GdeUulP6mPr4osdbE7aeWJ8qVYnb\nNwDg\r\n=6f8e\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"eb803583da83beeab7756baddcae3adca7650c39","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"description":"Provides a connector to Rock for the following parts of the app","directories":{},"dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^1.7.0","@apollosproject/server-core":"^1.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","@apollosproject/babel-preset-apollos":"^1.7.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-alpha.15_1610036539237_0.21150634542467994","host":"s3://npm-registry-packages"}},"2.0.0-alpha.1":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-alpha.1","_id":"@apollosproject/data-connector-postgres@2.0.0-alpha.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1952acc0e2a9064737d1b940f5ee0cc7e5c1041b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-alpha.1.tgz","fileCount":19,"integrity":"sha512-fRB0ZR3yIdfotvnF2ra9aLy09pzFTFvZADpB+n66t3/l9Tvjl2wWEB/vWZBk+pKmEiOA9cd5IcE1fNCsR3V24w==","signatures":[{"sig":"MEUCIHJw9RITUy0FL0pLFRv89OAusmXSNibV0uMFR8qWbFGuAiEA4NXxYUpGURwZUe+27EMx98uvLPFpqK0ooCAoQP7AJv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":57363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCGMDCRA9TVsSAnZWagAAQ3oQAJev+Y20t1vGbnvw3wnX\nUrePyFtGkngR6V525AeyTgVDPjpKp5fcJCn2XogVfylOtzRX+tLmUg90u1Rg\nT7Zdr30h5ZxNko4eN/Aj8ABJhIKk1PdrzM1Loxku2LLjZ6JxVnaqMriX+Md+\nTl8AhZJH1PVJJF4c8oFbg9dxDcdOc/21Vd49i1XfessD/C2wpXk78VsEYxOf\nMKnK4+02vlmg5adCNKa2ejjjOtMljuANsz6FoXwf6AkUNZOLKrJve2V5X9av\nMADpjBfi52luuvd+k5g9wCujvd4712+FrOmLj57aT0ZhPNRKaO8l51CxrWFX\nOjAnEdP0q2H7GDEsoTZUBmxcv9etM6dNky4EG2tyUwYx7kbYj7JG0aNMcivt\n8oT8SGXBEz7rR2xM7C4Vb1dv3V9cst+Aj6n09NBKgiZH15LIBwc01sD0a+aw\nUq0NcGVxpaMvFYX/JIOpgZNEMge1Oqu1l+YULuEvPrZ+SvCscxbBuCDLFvmn\nlNdcXECBKKl1g91gKtH4hiHVeYnP5BdrN6LIXkE2hlkKu6wie5E2wwdWa15o\n0STGZ9R07lR+zTmCE6lI+BoQ9VeWwPXFh/EpsM3frQGb61hu+N6JIUG9hYa6\nJ6XeGW/YYl9V8DuVkxMOIZfUHlt456fOsILAWmvsrNif+d+qXCDt/8ScUkJG\nxc7n\r\n=6CLl\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"9e12b69d167f12fa42df2937cf636191b9653cb4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^1.7.0","@apollosproject/server-core":"^1.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^1.7.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-alpha.1_1611162371039_0.1699207661347082","host":"s3://npm-registry-packages"}},"2.0.0-beta.1":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-beta.1","_id":"@apollosproject/data-connector-postgres@2.0.0-beta.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6576a885e2306b22b537c91bd6d3bdef88e16ae6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-beta.1.tgz","fileCount":20,"integrity":"sha512-t9dtQw+PpoaVa8h31LjFF2RRHavGCLmc6NSHUUEIp8ClMPqHRL8sMQa3mhnVY1OLwedjyXrCpDNWdym2BT0iog==","signatures":[{"sig":"MEUCIQDPNHzd1EnKJHEzW/RQRlChkZfgD6uJMDNwAvPRidynpAIgRwJiIuRnutveK9OMrO0FmyutqlsrTqPo1s8MbAAllo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":57841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC0LsCRA9TVsSAnZWagAAG3oQAJ6d6s4VC9YHSQyYgSak\nuKK/L1dHgGThsArDDt9dTslrz9SETTO6ezASxdIy2nuqnJ1Y44c6lhiL25le\n4rIfwURidakKmDSZ+ZyT1pyaLn7CWZcL6Oe4bvjSR9RtRBsAe2lIl9aEo+qY\n+9a1MczZCUi1GUGJ31n7UAa/MuculW3ASJ5tZshHwc3rDA5Vummu8BM1uCow\nc0knFtRi7FNrcbpIcPysnB3uKgZJIyJiU6Zqa5aIu3tRhM3igzTFthrYuAL2\nPHoaFVUpxaf/E5osDv6R6fH4ppdRLHrti3Ts+yc8mifueBCZGSZe5Hq1oWtN\n1BszIrv95S22Omzq7gWzplgkZzhuFPaGJ/lx/tKt0cbPJc+9FFfjjmFZqqPx\n5MowqHSNqCnCek59qxfIs/j67RfS3i4L8q/GoPH1UZnDtOqohIa5wjzeKOlm\nYUy4q2oaXv877WVgxVvNMtYRN7FK2IveeCAczjvGBp+Z+lfugC5mXBP6CXYc\nddk1nmU/kaR3qUa9Vu7K/9pvnQzi6I4urbHi1D/5un+ZsCBUT7hszIXZ+EAh\nHmT8OCihvTy69ZWZoMYdpacV/WtHTw9ZEG/FoClvzCHjBZ+yOPIlHonHPM91\nRuk4T+piyEV9t5rQjK5zXxThrCImvFMa49VPs4O22ICoTa6OPkX8CRV7N5G8\nU//1\r\n=NzcK\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"9c74a4d9e0a9bb64e1099b71d27968c95decaaa6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^1.7.0","@apollosproject/server-core":"^1.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^1.7.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-beta.1_1611350764152_0.32631900085586585","host":"s3://npm-registry-packages"}},"2.0.0-beta.2":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-beta.2","_id":"@apollosproject/data-connector-postgres@2.0.0-beta.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5ba18500a96176dbc7f7261fd493ca96445635c2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-beta.2.tgz","fileCount":30,"integrity":"sha512-zF4AS8v+7A4wzaJZalPlgpKTOtlhYGIbTaypybzY8rnJkOvUVADHcM/dlNns7DyVEt6kF2aDrv3y+nEqUw3nYQ==","signatures":[{"sig":"MEYCIQD3QOgLolCxQCT8Ji/fKRP4NLfcb1nwOX+ux33x6OlQmAIhAL4zaSg9HfW4PIH5B0rSFcjfBoTiCOD9RjWdSU1QiAr7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEbexCRA9TVsSAnZWagAAQHwP/2WlTxvMrWH3twIL/wUC\n413+1tRsTM9Nig/CzLwrMGPkPHGkvGupkj0NjWVulydt5tRNiP3fZ1xeCEeB\nTWMjgJO5rrVbvdAfJk4OBXvd6z2ZMuHlt4mYbwqNvG5+BVwrLs+qWpBWI2Oi\noETTbjOgU4OKxuR201zHXiOpfmNaB9gcqba4xwF9CjV7xfdIL+gMfK7wJDwk\nvw/UUOGtkC/mGisIJMWMxjScepnjxp2fO786H8ES+AEY32tVtDqsriU6K2Db\nVCLbBj+Bk5Cy/qCMBwUO5qmeDhT0xpeVTSE/A/KC3aRbGKzB1ufs1gqoVv75\nhYu1u+NcnlFljhjkIFT44/xVWi6iC72cquZgp7awtE3miulsJw2JeNhcDua+\nNYZqwg2y+ct9x1MNB5AXsRPkcI3CWroc+ShiIc9IGOem6cU8nJSdJ3qpfAsJ\noues3wBsLl8Q9M7EJO4bkMdm2ykUgNOdwpJVcJfMiah6oHeyzTDNOXY8hKY6\nAuZx7m9yZPsmqpMk9hQ+fUdHFfd5AJ793Cm8Dhpamy5WrBwejufHOMDnKTO/\nK5mYzYOpcUque0y5S2FjdXsznNAhlN3B6ZWX4+P1tpyonck/sA2d/qbNYU+L\nNnsLzy0TUgOInDbu5/6/0ZcqbHqo95bBxY//ZrBwHzQaVyrwXXUh7Iqsk08q\ngUkI\r\n=QScT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"a2f8f4e9b187b2884c0ee51e78c263ba053ee7d5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0-beta.2","@apollosproject/server-core":"^2.0.0-beta.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0-beta.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-beta.2_1611773872802_0.6453420528730711","host":"s3://npm-registry-packages"}},"2.0.0-2.0.0-alpha.16.0":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-2.0.0-alpha.16.0","_id":"@apollosproject/data-connector-postgres@2.0.0-2.0.0-alpha.16.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5461181a04479e33289b50bfe8663fee43812a5c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-2.0.0-alpha.16.0.tgz","fileCount":30,"integrity":"sha512-jw6y3hFw+TW1OtecxtCEqMgk7WTrj1+onPlOLKKcmyW7HIyKnfrGdEhPVhMgSeK1pcsU/G6BWwj26a3aNUziQA==","signatures":[{"sig":"MEYCIQDwFcyShGLiR0Z1RhdLEDikal3+vMaxbXLxts98wJLPYQIhAJS1Tf6CLQTGPK6x97KYM++fAgnE3+cCEgbPu6zBas96","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEc75CRA9TVsSAnZWagAAbNcP+wUzey88dirODlH57ait\nGZEy/jt0bRGsI5+kXHsYUepgaDEmqWEGsboMDhKbcQGDONEityGT1tJHSRJ3\nGtmMBdq3vmhDnDcAoBVXFfS6RBekdvoyGljmRjmXVd7wI5huKkegNDQdW2jK\nm9xvWXMyINIOycgSI3g9btkoEcMSWtt7AD8wisOr/fpAaFAO8fP/QpMmpWZX\no3/OuzdN0QrAH7FJFxVkduhnZK2Ecl5q8RulfteZg5YvMhWM6hk8v8P2sYoE\n9zEfYozjJTLS43V6hp0vPM92ccFE4PFXYAdHOe4paAefezAkbWJk9x3x5pzc\nPDfRPKQb2/ATee0TWustnPAQESrQDyCgGm5MYU+KBYJ+9cxBw4aKgVrAKStb\nmA6GfupK7ygKeS74Jf1+V2S1iO7rrU1Xs63JEd5vMtKvhC+Y9QzBamsXkN7R\nuzM+llF/OjoVV4Pj1HYb2MKRPp2kvSGmSrDDwyey/qQ/gmcXAMRFaHSnT9nt\npBrpjGOoXSWNwCsAl+qNzQC8tDxEWrhB8g/cuBTDMOMR5usmkSdCfwF7Xjdp\n8CGqx3Wb9Xba8t7FM3ScLv9gK+LvKD49Fi5NGnx9hcp8frWDF2wldGmxyp7O\nT/EN5wZS6MfcRALtirifyZ3aWlJG9WV9neBt0kupM5TROzWLMKaWpHn0tUtW\nJbrI\r\n=N2Oa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"a49059ac4c22d9b315b6f94fc2a65775f7686603","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0-2.0.0-alpha.16.0","@apollosproject/server-core":"^2.0.0-2.0.0-alpha.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0-2.0.0-alpha.16.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-2.0.0-alpha.16.0_1611779832626_0.28128268106587373","host":"s3://npm-registry-packages"}},"1.8.0-alpha.8":{"name":"@apollosproject/data-connector-postgres","version":"1.8.0-alpha.8","_id":"@apollosproject/data-connector-postgres@1.8.0-alpha.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9ed09dfa4fdc6fb06ffaf21d393563032dd86532","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-1.8.0-alpha.8.tgz","fileCount":30,"integrity":"sha512-m3+pbSXOJEdxXD8ECYEuYOPKf9LtgBbYszrtCMOgktq/qC/yarqZm+eaFVURbUgwHdwzOD8yJuf7I0oP0tN0vA==","signatures":[{"sig":"MEYCIQCheuzjO1PNCUiQ+6pbfH8u/W4m5dxymdDmT8nlSHuj/wIhAILEwwch22dnXZ82ShTYIbSOsypSklT1BzTwEfyQjce0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGrZVCRA9TVsSAnZWagAA76sP/0T3W4EElm3KiNMuEMDO\nJk7xayWqqylnN/m8zYlqJ88Ofm5uHERDPvE+Cp2adDSmTz4FkfOJm/Z2aaQo\niGtIvkgZYWgQTn/LsEEnoOvwOAKm6nTxFZjfTc2dz3+3VgcddSrPQzHg9s+s\nstY7LKkIu9dIMxIzcuXZ45MzhL/Za4LIDkbHGyeJtePExvzZu5de5JnJllYK\nHVjR6bUjCVYFy59SBcXcDzw8RxlVfJivPsjn5S7MpwU/m7GlETjJ43TZkNFM\n+HFLUkpIsABbhG6O22vXgGQYPOBthBPQSRvDlMuclhz2J4CvjHVn2yodMLga\nXcx6p01Lgwkqv8SRegzcvtoWynaAfdOeR3osh5w3yrRBc0FccucWfdXIXdQG\ne/lLF7Cw3d5VUccM0hZO1Zj0t5gXynRcYsY2pKODo2Agycbwmt88TSzZU0wC\nF1qWylSaGGdqFisQnT+O/zCr7czD0LrHsj+Qw0wDIFAuV2CcJG9oGKM9OpPk\nsfcYLSyzCM6lRPB0wAmPHKaOW70/7XuG+sCbjIyNbcq3DSuEpN04lJOVMGnC\neo+KM0UGhd8FtGpnmnylwEoNKnFcWFnrUis9KY5Jskacu5rk4UCFaqCPhVu1\nLosTIBgj6foKfrfPi1B2uoQJUQPdLSDfs7vU8oVBWe9c2VIYkYTm6E+C6P/s\njXdb\r\n=2VUC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"4204912c982d6b217191e37769efac2aabc8cb50","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^1.8.0-alpha.8+4204912c","@apollosproject/server-core":"^1.8.0-alpha.8+4204912c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^1.8.0-alpha.8+4204912c"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_1.8.0-alpha.8_1612363349062_0.3914340137389263","host":"s3://npm-registry-packages"}},"2.0.0-beta.3":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-beta.3","_id":"@apollosproject/data-connector-postgres@2.0.0-beta.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"550be2e1496a398160e5001a22e7331a4f37bfc8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-beta.3.tgz","fileCount":30,"integrity":"sha512-DqO/LZ+/PCJ3NVnSdZe52wItobEeRJX+Wm/LmDw9SrqB+9UhnW+cPn9oLVzj5ZFjIUBH9/Myt8PtLKI1V4ZJcg==","signatures":[{"sig":"MEUCIQDtdSHuxIlGAdp6dznw3/P/8G8dHKS6wlOz6X03nQbelQIgLjT7ZKqfPFAYpRRHFQMLJEHOClo2Y7+Snf5IQdpglEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGreQCRA9TVsSAnZWagAAppoP/Ap5uMxLSsW+Z4yo1byS\n/NvW9etcfa4N6AN2P+Qksz99C1s0pRRgHUaKtkqeL8xoS4aaQwm0C/B/M2to\n0hYF7CHGJThfPPeNxf2Sf0JGe7R6TOfH2FGZqwOWb5fTzuI3J3DeM8qdSHoe\ncOddzPsvSU2icVtBuwkjwYmzZsR48qZASOVPLYA+OI0ZTKDwg1PNWWlJ5cFi\nv0nT4w8EW2Ls+TXuLbaC94HvO68JGX8/pn886UscrDcBUA3RuWPs4Mjr9yiZ\nDscfu3x4b5GbWcnwkMtuf/IwdHXh0XT19w+mFOsSsn6wSEnL3J9DqdHdc6aF\n4MgWLfTW9xi7t61m0aJ8J7AiiKrXtzU5l2Bc6+512XYeYduqWvWF4Dm5EBOW\nOGZhttIzKw1da8hkHD/D2jOKTq6wSgEDOJn6Yq1LGvFaA8crue04jXTKrHG7\nYnBKm3QXgy6Bnnou40zB6sGv2RA3U9YDJutauhz9bhqQlF4RL2ESQvxkt+5V\nYvpElq9uh2JO6EeLPcz4KS2zQ68J5NUxxycWG6NUimnHvQE+8l9UQYpE858A\nGRKoGaStf6Io+2vuWqzgA3BTLrnl7Ev9NZJyelIGs96OEz56sF2gNrC4QSl4\njKR37jq1Axw0AbC+tn9jGV0l0y86TFDioRZekvmipVhBQ7DZpqbd+PzTTKM+\nde0o\r\n=HWeb\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"7b5122edf49fae4b2118d242b41e12e38d5d57c7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0-beta.3","@apollosproject/server-core":"^2.0.0-beta.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0-beta.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-beta.3_1612363664446_0.9784328748280482","host":"s3://npm-registry-packages"}},"2.0.0-beta.4":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0-beta.4","_id":"@apollosproject/data-connector-postgres@2.0.0-beta.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"aa0e3608b085a8cdee5ba8c8b3e5debae3b168cf","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0-beta.4.tgz","fileCount":30,"integrity":"sha512-/pJ0WdwkUvRQ6rXgoCWP+K/2qtAwdk2UsYk88VvDtqwkuYulD5heIua7nbLGKhZidqgWiWbKryBCDnvzQtpyvQ==","signatures":[{"sig":"MEQCIALqZbSHFZp6mc3DeUJ3Vx2K2tSFo2qFrTGm2LIKfK6kAiBG6fG1FY6pyaM2oJP3Nd0e/91vajVzDpPDzhVS8h94iQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGstyCRA9TVsSAnZWagAAu5cP/3LAYZ8XN0qHECGCbxsl\nrt9LYJGNcbNtbPI83YMY1mwmrx7xgd6yLjqozd4UFIhDTYugBEwdkOGWVeMW\njx70TXsjPJSpbxqe3GkBTEFnWimDwzm3/LgO8/ezUl4ayRHcaLByHOate1hk\n3rMEFmCUNMp65ZzHxL1KmSRhoYwAwHLcF8m/PVCELL/jaBhQvC8lXr538iLk\n372WaJvyEwwmhHf6fMGS6dlxGbhW7hyVXD5E17DCjdRCu1jTJJOTKOO/77/X\nUsGExBJaWvLUpyyYORi5lwxiDB6BpyOXtJMSTvZOL9GS1T6ZLnZ8eLj9vhwp\n+MZSh2et+WbFv75mpGSPjlTc37Ef1RoXDVT4OOQypxd4tPPX/rz/hy4rMVZs\n2p99BOaZeITX1hp/qdxQOHm75J3CkKUt+8cfPqmykeAL5bLjXCKSDhPAp4PJ\ndXLlD5uxeOkhP80C8yQJ1ire7bG0f0X+UWG+c91Fcu2ww1L85ZzRnSUkwvaV\nBJTw8/Wszaa/InfEezAnlpVpWcuXtKzKnvvGyIcWYz2Z2GeMOs6RWTl3yvnF\nMAVJH99T8yZqQ3a4H2LqTopCm9PIyF7slzHXwuJvAggfbP75y+8E2V6mz9DS\njOY3aJM8ukCcn2jxHHKlITyFDLMfoPsT4xdEEVu2XWTjXF7Y6bDQY7hSzwRT\nRnyo\r\n=KPZ7\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"f3350f4b9e2498e7451199f5c146cf7e05c377af","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0-beta.4","@apollosproject/server-core":"^2.0.0-beta.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0-beta.4"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0-beta.4_1612368754199_0.2626726590915087","host":"s3://npm-registry-packages"}},"1.8.0-alpha.11":{"name":"@apollosproject/data-connector-postgres","version":"1.8.0-alpha.11","_id":"@apollosproject/data-connector-postgres@1.8.0-alpha.11","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"24c5b4447efbaeee53f8026a3e086122420a1e40","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-1.8.0-alpha.11.tgz","fileCount":30,"integrity":"sha512-pYif5DqvOuBB2nyHFUMqxj9W9LsjIsUSLugRqFal5xRcexe085F41YBlRZOkEEAtMSQoOIaY6euekZy/o6yK4Q==","signatures":[{"sig":"MEUCIBNo7flaVFzz1x8zNS28nNsONPEt+pJTnTR1H6S8qOvSAiEA9PSOr4pQN8ae/oRQC+ekMwmaGt0Hws4PMpSlXMqSHU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGs+ZCRA9TVsSAnZWagAA+ewP/RSHc3HfzQPoxtB+z1Gu\nW67BKsRPoK6gBlpK9ND7ZyAXVVFnYdjOmZuQyK87069oV13mnFEoDKc7WhvQ\nt3aP4t8SHimRJ4GjIT64xpFs7Fa/diNhXN/XRv/pICK1CG4M8JODMm3WUVJC\nh9nyOwgfxn0pX1SiZl6+nSAsEcqUIuJN4fyVAMDZhigVC/YE94Y784kG5eZ/\njvraiYHzZpkfOz4ieclObevI4Tam0LVJTZEP/yVK8LW+9EwfKmJ3vQcKUDg9\nqlJdX290CPVyYlm+/MgLRi830vnO1Vgi5zwlU9WDKxG9BV3ZbrZdo7BEQznE\n8DXsBqtAPEQHXgBo7f6tJ8jsX+qOzwnVjRk3C7NdOIgj2BRjNDZ11a+Najzt\nK4Ql2OPywHDQEYWL24mR2fCuVYqEa2t24EYopHlu9LZxUx3woBDUiX0qaglS\nk02Lw1/VX/mYoz9zheCMqIX1cAUl8yIoVag+x8yvjDqBVIMFAuuTx22OQUp1\n8RsB0SuM8kn3ILq4SqboX2SFvCuvEDFNEukGwKaJ7uTW+9JboPt++FlUhPVl\nrRQw4AXf1xfpuyCx047xzJgxQcziUddZe2WZfMxl0jfxgC4x4iLHnDJJDB0o\npkAtIpeZOXGZ/h01iDeyk3SjVVymaKwI00mZZZncFiC45zzSfRQMz1gl1c5j\nObYj\r\n=fTvC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"54fdcf6a0cb961577488bd8d67804ea05b00c137","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^1.8.0-alpha.11+54fdcf6a","@apollosproject/server-core":"^1.8.0-alpha.11+54fdcf6a"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^1.8.0-alpha.11+54fdcf6a"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_1.8.0-alpha.11_1612369817456_0.6625457335037417","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@apollosproject/data-connector-postgres","version":"2.0.0","_id":"@apollosproject/data-connector-postgres@2.0.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dc3a6199e3b2219b7815348d7f03a81ff49fdc71","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.0.tgz","fileCount":30,"integrity":"sha512-iofDShEQGmKnIslo/xkDZcNhRBqbsaIb51PPlxVC+JKNEHEfcb7Iun0bXEk+coGymRcOoSFPg3PC3LjXwRdJrw==","signatures":[{"sig":"MEYCIQD3o1qX9XeCAJT8aQfG5gVSGKlWS29PplV7UHIi10nurQIhAOdBkG66yUTQh4WP8yhQLWaXaRWYhYVB4H1TFoEFw0OG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGwavCRA9TVsSAnZWagAAKiYP/3rWHj2+EugB/vMcnnPX\n7yjCPcpkmSGYGTvAaDgGPOCYT14mowi+CE6KBOyTGMo0oN3paAaLIePMQsUW\nKWSS0oLynbzn6qMWFKD8hxwb6K0ffZSs/m62Cg/TreUpWZzjJ2y1+9nBEVGw\niGILWcm4uvEBt/Dc5hdUPjCy+TXnNjEGc7zyxEBVyhX/r11Z4vF2+KE5515h\n70mFojXfytdayevbB3yifgjS9kIvkiHUBeRC9w8Wb5TjE0vusFWIMPbVZSxC\nYLFX3tCUJiRfIC94P86ksBUCarl3FTJ+122GvQkVm7LmRpzKIdfgbE8b/sXy\nJIoj/S36Oe/YkB5u2yZYqDTUxPg9646up8QFiFhdNYNtxl4zlGD7JTE98ZTt\nutPOGJQn9zMeFf9WhaiiCikQwP9p7tMH8/A+EDIssv9cPX3fjRq40EbxLzdn\nVFvXiAQxg2TDvg1IJGNoDttw69QIBB97wdwZHkFnjmHWO/IoUrK48nLworAu\n6k/xL3CI7EyYKT1XyoW5K5dHt17bIAX0lL/m6Hfw1UrX4bnsPw/QZfI0Vh4t\n2cUWjL0ygyX3sCmZTC0ETBHkvW3GnlbYaRDDwprrGCQeCMozfLqKVVy2uz/u\n/4PHEuwsqJa9G6m4fEeU3yT/PnhHWso8RGX/gX79Bb4+dNu1kw/RUkHjbsBS\nMubO\r\n=mp7s\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"b008b911f273ddd7798d8607b9136a6d9422ddc0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.20.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.20.1","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0","@apollosproject/server-core":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.0_1612383918237_0.9684722474051599","host":"s3://npm-registry-packages"}},"2.0.1-alpha.0":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-alpha.0","_id":"@apollosproject/data-connector-postgres@2.0.1-alpha.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a11a712b7e03801a357a93aa0a0330fdf9f7f283","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-alpha.0.tgz","fileCount":30,"integrity":"sha512-nLjRMcOH8iT3B21qD7mZPDg2dH5755YfcjhrEok9ONeCoCu2dY/oAFtN/e8AoUL8dHHIkUIkdue8obUPEK9z3Q==","signatures":[{"sig":"MEYCIQCfdggkiD3ZwRKBw+jNSYVQy1H2+OsCBZ1pr+G6fy2o0AIhALZ5VX9s6EK6pSSHDm9rsSLOMJ9dEIXG1UwwZNEbjbxl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGxC5CRA9TVsSAnZWagAAaxEP/iRrcQYvadVUyPnL1VyT\nKiJrR+W3zUmSpgrtuZRb++S7fOI7x0c8eJvuyVGrFihWlq4HjSzCtm0x/zkk\ncQS4MrIhODamzghU4VU0F7GnCanE72c8i+VKr53Hog+P18rn98mc2432AQHw\nnH+SBVmsBPK9gEnu5k0IgioBBIYjkNAd95TiN8+RAvMVY3AbSVBNnzvH9NtX\nNoW0kHh27z5n74PNatRLmmAAyQJS+eG9moeTKpCQ/g1x4EfkypixwCoJM55C\nQ13fUdQVSQ6fHaAmhQuxfYEFwGSMAMiDg+7E1b+U1qbFT79rxUv/qwtWoAMa\nZRDQBfSCIaycC3jcEiqYs3AyJgqihFR7H+ZsYhKIo/GEyWPolCvH4tgGmBhn\npzP0L0TyJVjW2f4JxfCDSte6OQt6VrdA/+zF1udoX0LrBA8StfdP5TkJJvUT\nYdhI3EDnawhvCeiEJ3YZtZzXBFPQqQckQpn83II/X4B3w8wfYZvJ7WxO2sze\n64xOH5KqNGKFTqXii+ph1Ocg0FHB1luuJiinr8iNNV5qSbVPZaemX/4VPzgl\nYEAYXE57vsF4RAbKkJRzSSX3SJ/ia2mANTyffqssiZGz4bwcY2nihsiHlxQo\nuXWa+UnoiQB7oUSjeFOUh8kWZkpnwHV9xZ6r/CK800jGOoG1VhsDL94y5Z9W\nPl9d\r\n=x28f\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"a3bf30df838fecac082565705c599329da1cd11e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0","@apollosproject/server-core":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-alpha.0_1612386488468_0.21000283518927443","host":"s3://npm-registry-packages"}},"2.0.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3748bee604f77fe4cd7649ddeccf6b488b7f494a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.6.tgz","fileCount":30,"integrity":"sha512-5Xmwg010E1Ui5MD8LBFV8OSMuBfDvu/Tc4R01GsNkTOKUrV2QiEYwlkzF3z+fYepr9UApSc1eFD9P1i3ze9MIw==","signatures":[{"sig":"MEUCIBd5gv9mz0av7LVPV/zMCJ8/xbbUUDA/AVzPzh5/9QoEAiEA9rjh72coPTlQcgr0kT/wPWe72LDdcS4NF7iL+sf7gwA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIZL1CRA9TVsSAnZWagAAXDwQAIfnUMR1Zt0iYTpvSIx4\nUJqoiAXZO5se5wmlOEdoxs02H+r9FMP6Yk1a1AoQdvZKnKJT2A8VGl63Yvdn\nwIknqinaPzYbFZD+8gStaZ4RuHaXnE0kgYvqbTEV/neqVgayvMLV2zIsMQPG\nXYRFaXNyQ+v+xE/MXVt+idq/s224QuMC0MKsNwmAaLro9UYaB5Ma06Z3MY9E\nQ7uRHblsW1OOItpfhCgAt+XfwlpjmBKdNYROkCIcatrGHkegBtUwE9N9MauU\nDFIsG8i1dpzugro1DGesAQYp/dQWaU0eQP0uheB8jcy3URvepjpboPPQc+Tm\n5WM7Z5s4jk0PZnm/azh9BFVcg0+qpwPKGF+hMvgOYi2yxA4yT/sPtjwZyB7c\n/G1OUBli6Q8Gz6bSaMD+aPqytIbYFz/k8OP0r8Oy6z7fyGQmgQLka8vThcFJ\nz7MbvMayWR4ogZLcyRTknPwjoBkiSEyY8gkcSRY6tCk+9sXU2S776Ftz/GIi\nr4PL0WX1FM3jCFU9UvgOv9wrDU4STybZbRQoa+sxHu6XN8rGXFtx+whJ8YDF\nIuiRYAI5SmT1So2jlLxSyQUgU3Xh8Egx1KMT8u63uXyJlF+L7+fDxdeNp8p6\nP8QjturUJnH3AWfqoB/p7C3tSRwEGXCv2B5Sz4er7mRSDjApy0eGQ/+OakLF\nwz16\r\n=sxnr\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"501b284a2ccabf18b2b23c486742ee1959165070","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0","@apollosproject/server-core":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.6_1612813044768_0.8540877137613678","host":"s3://npm-registry-packages"}},"2.0.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cf3885a7df652383649872953eb2c83332726b8d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.7.tgz","fileCount":30,"integrity":"sha512-dEXth+F3Qq6O+//Iw75R04mC2ZUOvZuJzYC8QlZzGyOU/vALDYMIuhW7wV1GKbcN5PIMjoS+3zF9tNvHcmhEzg==","signatures":[{"sig":"MEUCIFyLJoZmZ8bjn7b4KfwU2RLbJ7n2KXdTpE4jmL5qnh+pAiEAvCQe9OqBT4rJ2CUrHKRWGq/zTysUdXMeBlcbX18BEc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIq7lCRA9TVsSAnZWagAAeloQAImBJG0Wu/5hz5afWtuw\n/i7XbeVcqHdWgIcUJlnG+YbNQpA7gcpwKosJJps3WPM/TXVBQXoMS0Is2oLP\nX+YegQC2eGFVCTPAaUg7J/1473vDfp7KWiD8i2yWqHl0II+t//E7LEBZZHWH\nrVKkJfco5ei6ohkWomrmG7Jwn+Z2i+NIdxcvqmBHnTbq3Im8ung2svys5FMK\nSYxQZuhuUXSyoHqTqB1/Mwgg7fE2eAcJGPqmd2pmg8Jw0xelc6uaBOBy8CF9\naiAdJq4LnApfE0MVxA/xwDVsymWdWDME4WtEI1DnWpzNFCIrYLCxAhdJ169E\n9ddfWoy3ZiLshgD9HPXoZj8DO1wk2vOKvvIyDKwjyYX6lFgrF+muRc45eHJz\nXd0okyOXSFfvjsi8fASOKcT0mPfFYKamtBejXp8pEf7foL7y55gPk87qyH0/\nFa93kWr54+z3hR18x003C0TeBliIF4dcfu+8kaX7ztdslPMsXJot813IOQm+\nGNROxbeJHgh8/lAzpwiWudfbv0lm7N4IAL46THanaEYBvfmfJRcYTBuQmx/B\nuyAOOJMvduzTmN8AFpjeLTuhANxgec7hwuslqq3w1WqA3ZkeDWO8ETcXfIzy\nbOVbiudfcpfwFaTq/Zk10H9igqTJHvQ/ktWnsObnsbjAdu55FpJ7Flw7oNkr\nyiJ2\r\n=0r4w\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"28dbd7c90bb25941d1ab128de319391ddbc2665e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0","@apollosproject/server-core":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.7_1612885732701_0.10683307933903041","host":"s3://npm-registry-packages"}},"2.0.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"29b992b749a33673f6a93de931b843f026048572","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.8.tgz","fileCount":30,"integrity":"sha512-CGqyZZXDLpEuE+AkWf0054PuTMFA1KmleFpx0CL4ZYWqZ18lPITxduCaOCsa/bt4su+1fa3ISeE2L0QqKrfOeQ==","signatures":[{"sig":"MEUCIEvSxn6EjREZZq5R+YEgqjWDwoS8xiWg3hUb3nG2HpZsAiEA9B7+WFRuPM6T48+7rE5+uWoOVaJ9jrqH3VWlP+RMHcM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIudrCRA9TVsSAnZWagAAJykQAI5IxmkpsmgeXlPx0LIY\njtD4QWtY1pcfOsuSSc2KzRmjn0qhG4zC6iu1rEbTjzkqwTG1wu+lw+/1y553\nAAoWfvVt18aa9nkH9Crom9wM+pxcKB8INotMVQ9DXCauExgGskhIuEwxMuWK\nZl9s1sHOhrjVZjMd5MI0l3n18xQH3+75Bvp0j/FVXyChdKd9Aq99+6IwjcJv\nXA7YYRdoDwb+Nw1HoEgjBC66tOO0busO+r8Sa0NKyEavnELiBWueJHAcqEu1\n1vVwVbif8B3Tg6zGJQvete0Z6XY9VYHDzaMd3sqbzaWVJvBOWaLvhHRhMUCM\nd8dKSnFxD6zddkE5xdU2KIm0CwjwDzUpR+97sh+dafKQTxNSLI/DaLhqusMq\ntIRdnRKSjIP7WT5RiN4XzK0oHZdwd/dlrtmqQxikUxQeIidUINC48gUOY+0q\nb8jx62muQDKxsVnDPeqfu+S5y/8Rsrih2PzMNPBLsBlXKz7gmwI+Xo6EVL8S\n9HVAKbI1+gs7hiLBBdh2YExa6Qx/MkPFI2fdeaZpv8q/3PNY3kjr9Il8qNhk\n0nrtUIPAsm3vtKRNx/oGpfTcOGa4qSvQ389OjskDlEQDdc6fWtjOiH5kwaCf\nAR6GXNTKW7wrJFnS4LFyPH+6MEhnmMUE+Rn5ZQc6sxJSavNp3Okz31/+DTPc\nyIHe\r\n=/8Ho\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"93488c5abda58e56099b786feecb999020f907e8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.8+93488c5a","@apollosproject/server-core":"^2.0.1-canary.8+93488c5a"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.8_1612900203502_0.22680645018852696","host":"s3://npm-registry-packages"}},"2.0.1-canary.12":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.12","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dacf2cdfab5e033017dade584c615f3786552e75","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.12.tgz","fileCount":30,"integrity":"sha512-j0bAGwMSM18Gdb5//1ph1CIMuXTVHdRjAJgQYQ6LDmuZxuxLzJKni3fJV8jGi1ZkeeyFT4Yrav4qScAP3Af82Q==","signatures":[{"sig":"MEQCIBTsiT8A+qy0zQ1AuUvKihNPpjC4IZfgXcdWeTaoQMvWAiAuoLXvLXf/zO3Dm1W3nUpVmSQhOpJtLURCu0T0fwMl0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJS73CRA9TVsSAnZWagAAjrYP/0xAazyHustlcGgNlDMk\nSdDlgGAnbGRUOpPDX1M3YJ8EGggzCPrb0MmNb3JEQjpplvH4I9cof1blQ4io\nQpPkzzX7gS4/7Azi9/vI87UWd8M67FlbTd0zulg7l9bg5yKwGtBBh7tmOuR5\nI/qGELH7bS4b6FOebUFASW2pWm0SEXqHeMcW/XwOTKpQBzwnOBoLr8GG10hn\nkmWLQ4fGyAI99KGOHf3jGp6gi4S6NZ1VkLN5h1sCPKRKwWJA5Ypo6yq97rrw\nC0zWa4fJzJAkfxDRdj6lEGgLAvNd18RVFfx2ynmEF8rOJWNJtTtIOkiVnBdC\nV94pceO/9U/S182lws4s4mX8kkU7Ob6MKFsnkopNCKwaAFygjG1zOgdWsVYg\noIl4MDvp3x2NlUg6R1F/XQefpSS7/E/HshmPu0GB5BGaUdiqgot4fo1moKIi\nNbRCTDc/rcP9kIYYxXxNTj8QGl4wFCbT3JD+7s26qhTEnYswUwc7B5zF41Et\nMWW1flM+n+dRdhMbqXBJ+3Iz2r6AmHELlfNxvK35elgyACtMbrWFdCKg7nT1\nHbKVO+qE+3CHQaSgxo8qdC2/qYiCIQ8akR+LQ513i4d82YEGqQl3exSrvMew\nqZ6VkF376RmayArLw5gYaqHBvbO4iCLshWJ+1oiZnQ4B3yQzYgvg6ffXYPgj\njXYb\r\n=kmbH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"e7f2962cda71c0bd84297cf3408e33112935fb9f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.12+e7f2962c","@apollosproject/server-core":"^2.0.1-canary.12+e7f2962c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.12_1613049591161_0.8076520988885594","host":"s3://npm-registry-packages"}},"2.0.1-canary.13":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.13","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.13","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2a3245cbbb575c4a59ff1daec0a4206c20dc99c9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.13.tgz","fileCount":30,"integrity":"sha512-uj5dvk89KqK8Hz2Kj15r5hlU1WUFbN03ldakC9DGCgU9ykkRrDZkzjtKnPmlW1CAJuYf+jKJ9JBPCvNfxggGrw==","signatures":[{"sig":"MEUCIQCvY77cXNVvExQ1QMbneuy6Rm8F4KddDJwMpRpgzTOUZQIgdGepU/UyYFlZxaQqkoVqgqiE3gJrAuvS6vCY7ExfF6A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJUXxCRA9TVsSAnZWagAAjAQP/0yT/vfgCfB0pcG0Vggo\n9wDbPo7d0LP/xP3zIiKth1GmebKZrbFwKRuhzaae9AwdUtFkZ1yNpV9f1W7t\nSRXrXpk75Bo1UqLcTPMABJi+oexdUE+dcUeoL6T4a0ATd7WOszjoXy/aHWnz\n2A97YHIgfDtDNlmfClmeVWcrtjco4q476tSeL2NYK3cFCmi5XfJ9y5VhnJpJ\n5Ir+wwfL0AGSJLb3riMwe27JFe+kWd4iW9MQgck13XLYSUARcECFLS7B59l4\nUCQ+U4JSL5LIowYJ6mpLwUPYrM3Os/OMS+7YcF6IdyOHK+Wkv8GqpV/OYPgo\naBgYVcpwmKazy2ehu/EDHn7X8bgeeigKE565rBVg6idtDYSwpa/1rGHa8v21\nbgM6AEnBrjA7PB5K4gOZTUYR4VmNPEevpP9wy/YvibSXRE6ISYy/wLL6Opgb\nPxsC2hAfeIZJwJFlal1KwOyjOyzWOCJxBx+XJmXN2zi+q0bfXlHOlCv2EcnK\nN7fofPzqthY8xDMRnT/pDaRJKgB0GiHY102Wx9WTK3iAQHAVeW4SrRxjo1Cn\ncWvQLakfctX0KVk/IGZGIAJk5/o2J4AzRySuW9COD4tEgMpdk8wFOCj/vH0m\njT0yLd3l/x15VOFW8+dJnTy8n8TM28PmaPI9Spvs8kNd4fJBC/RQS1XgZJso\ntDNM\r\n=vCNo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"526ad8b0ce25edc1a41557a1fea147981ce297f5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.0","@apollosproject/server-core":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.13_1613055472998_0.09833514343141903","host":"s3://npm-registry-packages"}},"2.0.1-canary.15":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.15","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.15","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7263058ffc4fcae31bafd6cf86b64e398fedc575","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.15.tgz","fileCount":30,"integrity":"sha512-fOxFWnnTzwK0G2BZ3AZbVyVtiQ6KHjqqxEA1uJF3OoTUMtkQMXcrwaMo5VQQ6JPh6G07mNhOCY5PkTWf2ryi2A==","signatures":[{"sig":"MEQCICoHLasElHbcAQm+ZgJ+/LMeBKRbjMbZ5bX+YPG6Dy0aAiAbLYTMz2E65T6J4lpGB8P1rCVZpIdRFV/t2qxP9iMtsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJZ5dCRA9TVsSAnZWagAA1FQP/RLnSZy363azLyoBl3Xi\ndkaYEaC3P8RE026NnWnhaWHnnOuz4QQsSXENaWs5/Auhvc0h3JSCC2oMhGdR\nBnoWFpL5RY4jQpX6MGTqVqX4eKC1L7AOJ4ri57EQmvgrQNfK8v25nxgbRv13\n3rZkMdyaREcxsUTr3iHeieOz6m7qBjnfpuxo8A+xlxieloZLpgiu+GrUnQJO\nZfT8eSwscX/PpTxFi4W6zwcQwNyhOvJHwsTMfFxHSIIq+OwT+kGRpL/MUn94\nsDeoObuSNHa9/AawYcRhq0h25c7kaUKL+3sXef7bP5H27Q3/QEzCgAVTmszi\nipRv9yRfKw+qULFF4tHJmD6Jz9zH5vhpVzFHFjzPJML+WPDBSOiTUyqSViHw\nqjX+BZy6Sbl+95SlfIe3CRl0HBPFTAt5xpVeVA07+Fnxb8EJe6abjJVvB3Dr\nHe39KXMXnVe7+g2PpfrbV2TeAgg/6XC69dZjgyXJQkZzNZxmqnDCTWrhVoAi\nhSSVNjPa3e+C8oeQ6IX34EXg+si8JkQXUQ0Kxz/WQjEG6kNfzYrL09+06epO\nQLGZlbQR1T9ikpaUTyMOUcThXzTLNrgDoU9rXjkgs8EmOZP/QWOLcIlpaSb3\nkusnaPub5GO6kyglJV3pXV0cKJGEpgND02DMwPZWX5LKqUgjlbEs67Bp31h3\nZ3RZ\r\n=8Pmc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"da6539d839b2d2f78871dba674a66aa76a39627c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.15+da6539d8","@apollosproject/server-core":"^2.0.1-canary.15+da6539d8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.15_1613078108921_0.4047486974171597","host":"s3://npm-registry-packages"}},"2.0.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ffa75feccbdca5410d9440e0bd3930b743a18b85","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.0.tgz","fileCount":30,"integrity":"sha512-haQ1931k/AxAsZ7yCAfdc2D8W05hjyIdTVJFz5PXvt5LnSTJwiFcwrs3OsGAa4gM/lKJAq0WOQdgLdct1jtajA==","signatures":[{"sig":"MEQCID9nti3NDEqKBx8qe7Y1SShYfSo0IOGZ2UxKX8f0LPfjAiAM193+5o23/2PaF753vJ0nlqiKSwO16IOGQCj4tzbW5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJr2sCRA9TVsSAnZWagAAACsP/2UJBQjB11MDGm//njjD\nkeNG9klDnS7yQ3Uh61FAHZn9r73wwMKoaVVXAgtZnhXEct2Fhu1mZgKyW5qw\nPPtS0AGQtKCr5JZ2jnc5i6qjEvNpMWA/BTMVRL0cqnEdN530zXDaTSVXrmZ9\neYpnc7QVUrlBmEyHDuh+5ZLCFFZ8N2XqxHt1uht4OEoIHu2yLHSt7wJAVS+0\nDmhGEr29hhu6ipWSlXRjpF4qNsNK+XKRkx6SvfM6rf+IKytisdsFTvlV8aNn\nF+aMbNQWsSXTm6xVtjNuB6VK5hrkTjlkdLiQ20OfkzhEujX4UyHYkTo5U9HO\nisJclZEzXxoENz2s/F8fqKu5agqhBpgxQzpEaTN5g/3vzcOKyD5cZpS4ma/O\n80nVgnLtoD0zrzsaavfJxxvOs2zjVLkOVagEnxCzETlQeCMdCcpD5O83MwZp\nXutAPaNBKqWbrN//nn0cqom6mgn/SHrFMShyfBxZ84malilIQaNQT2ARihgL\n4P/DHYRBPnL5w/Q/4ElDZyaCRsXZecSdV0TWjidshulkjQi2Y6aTZdszGFKc\n0va9Vgt/5siuGS5DhdM6afQp7CEUGSX3Ah2QX/Ed7T66gkBXxCJqsZK+OseM\nXz8pir5YzY3dx2bQ+MQlhRCq13xyPQ8HyjU3fJBxVBg20gynTH4uv4+ZyUsc\nfYd5\r\n=nlXg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"7c2905a86f080cefaa219a771ec15d660aedf39f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.21.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.21.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.0_1613151659896_0.20545006982200342","host":"s3://npm-registry-packages"}},"2.0.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e7a1ab557d9814f711c115fb7a177fea8f0a2f21","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.2.tgz","fileCount":30,"integrity":"sha512-qD6ij8yc2RDaCQRWvGLzq3Xkjhy3GUnffWF/31OldbTRrZGdt5+Qxrr+3yuTYF1c8wTUyG0ggx6f126HpJajDA==","signatures":[{"sig":"MEYCIQCFkickjhorh64dnYoYHxFZyx5k83D+2kH2hZ0IC8d1ZAIhANmOzDMk1E07hAVCCVza7KlDsbHCRWoVZ1TI5UsPxWeV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKpFVCRA9TVsSAnZWagAAAysP/2KcLVbTY+ZR4S0fShDv\nLNApxw42+mqqlW0u12gFOimzSH/PNwwFt6dnHyT3JANAvf1XyA0beV+dLqnv\nys6/zl6KvDTAm91US3x8nAOhxseeQ5V79yiquRIba16EsjOFoHhLlH+q7V1T\nDy6um45mB4hhcHxNsHafZo88if/YLQ+OWFhNrTrHildeYeN55Xi4isvX1Tvs\n0HtVIZ5r2ULOrGVHJWsK5Xbcl53Y+EZytbJEFYpQkEOElYOuK0UeMqAFhmE1\nt1g5bxkXcUG4vwU06sna8PjbXdRxzl1Vz0kYUsoj6WVgCEewJJuEOcujCA+p\nd2dTTbABczJAT9vOBZP5A/J+9lmVpnl1AqmdOkEdngqi7n0XFwL2wKult+u0\neuLlxx4eO2l8pALWztMe0rf65pKYjJTF2LO8Cw73M8O5uj0yz+zd54+sETxJ\n+5GIMZyt7T67pK9auukiDb/eaiJbI8y8BT47VsJEp0B6Jb0loCbkT2jNI2wp\ntSJt1Yx0HqwxdT3epZVCgFkmyeB7/nyBtMC4uAeQBXIJz8KmCV95StH73MFt\nZ3VdhzIJvc8+WcEYuo/0DV4bVOKJBr/ga5O7gr4gx5MBtu/3L5UtO7A0txar\n8zBhhFPx5sqXeXW+zxqnbp7YLQQferIuUwlFYK4hwUiwsAA3FQfL1edkipvQ\njqtS\r\n=tgE5\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"22100a9239ba0b6b0da5cece24a74aa18554709c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.2_1613402453119_0.8777974917523503","host":"s3://npm-registry-packages"}},"3.0.0-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.2","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9159cec79cf5ef7458fc995ceee3e4d71913c91a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.2.tgz","fileCount":30,"integrity":"sha512-B8lfr0udf/6A3OG2pby44UCCk0zhZcYD6jk+1rqDQq0XWv4DlyXL2LVW2s7pObAwtqMUKd7QE6/RLoRk8nohyA==","signatures":[{"sig":"MEUCIQDb+h+hYqaTgGb5LaP62Rn5Iu9nggJCc4hAR6I9oVbHXQIgWfg8EX/NDCfzvS9alnXNcfOE+hV+ihLphwYuqj1osDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKqx2CRA9TVsSAnZWagAAJDIP/jdVVQWx5jsWZDxRMtBc\n8zKCL+heMYGiGMkmZnlP73OVYO8ykXyoJsG+JuY+Ttbt2rLTs3WDmbgfwyqP\nuJffxIN3jaCa6JekEscKUatPWSm11BaqMTm/z9e3rdm4RrDea73VXug/pJkT\nfqP14Wz28PU8yZHu/nUNhl8ArkMEjrD9Uh46URR7I0FMgwqej3DZDCPWGA+j\ndAutSdnlb2vMYr/9asiqhjVn/MzyBx68eudDJQSCqi+wsvDDCpyGbb9b20/c\nJ+Ezq4Dc9vehLPhcWvcbiVizEEVq4cW3fjtu0Ay31NL+Sk1iq0gv5EzGV3IK\nneIPoMv0HMz0U8vlQmO5p26R/6u7g+kX3iyQkdlnKTqa2e5v9+YYcqEYmgVE\nOriMIwaemjwLj//txdmnsHZnkd6BW/465pN12S+GKpGWRnnXeqT5e8RngCWY\nLyewlnPFtNKkQ3SZk4oAlHcUDW24XFvsg9rlINROq8FNq93a+tPSRUsZ5jy2\nO3LVTzEQTK5u0ga5OwJF6SMWSkRHSLS1wQBxYggo/lt3cV1nZKwKvds+PMX8\nal396KZ6ZywJ4pnlRj8BcYcyBVNh/wyLy8wh1mvHd9LoDqq6/YqgyYEXKxKS\nl6+mQNBDTrJmMzPzpXmgtPipaXcadGomgOIHpBcBYV0aiFjuguPxzNxd2xqt\n3BGy\r\n=bNGD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"22100a9239ba0b6b0da5cece24a74aa18554709c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.2_1613409397696_0.8871075505857071","host":"s3://npm-registry-packages"}},"2.0.1-canary.14":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.14","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.14","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6ed37a6733a814a35eb80111f667ed6ad71f2b74","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.14.tgz","fileCount":42,"integrity":"sha512-WyTBM5S2Av/K0UQax07yyo2MqY6dv1DhRB1DYDgx63sLWRWanzfZFwmkO7d2efzJR99ADL0EVIEPluC5Wg7MOA==","signatures":[{"sig":"MEQCIFn6UQVPbZWq8atFb53j1I5I7YT/7RfwJfbUEYjIcJnbAiAVUV33DqlKNXT2rPUupJglz8pwokRGtfqBZVBiiM4pHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNRKrCRA9TVsSAnZWagAAN7wP/Ao9NkRV7suHNObpNtby\nMBd0TLmzWOWT1OayTwdWPOpXxHkftvufYRt6+peSwx9SLr+6bHVLNluNuvJv\nGCwl2KnvmnAONRs+anb/3dJ1iUloHKgS8U9ZnZWbOryn6F0JQr67C0xnX71n\n6IktC0eURE+WxgphBYvx3ps5Ta/VB/wlclQnJPUqpCuAWWAdD5BEhyqDbNKQ\n0qTKYDG95b389KHxjMuGlugGq041dL73+/u0jzaB4geSaKwKR42PQ26dLuEo\nS24sT/AjSdNPolQi6d4prt7WJhbh66ke35bCMR4CQE8TB1bRoRuBYzWCobOO\nSLPea53phLqEjMMLiksQulpObtFd7hAr1Ru9Sov+ubZBaKFF00GR9SK5BZu3\nLIdqZUdyQ1h7JdVUx0FZesFGBa/o+C1NYHztcIkTlihHN6PMT9dPqFH2vmp8\nB3gDr0OuFeyCMGB3r9jGM5D3r43ZRI6vgmJ6EB+a5lqB5mRMorXo5KsxU4t7\nBnhOENSnH5ixDQJpvPxhBY4fMczL0pC68oZMKCK4rLsLMaAt1HqeWPe9k4ms\n60kY2VE4jZM0UY4SxiEIm7yx5ABxToMNqm1bS4mu6yxKrJww7dZm8SYI8HV9\nEPrcOMNkEtqXHMNmQBL37XuJEXBaCe7N4SWxZzyhswvMqqtJBwPhqW4NukHs\nxiT6\r\n=JEzg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"1ef5c35a7da6574856d20c791a7a63d22e1aabc7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","sqlite3":"^5.0.0","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.14_1614090922301_0.9300348814911747","host":"s3://npm-registry-packages"}},"2.0.1-canary.16":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.16","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.16","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"dist":{"shasum":"5063f29f61c41d057a2498819a321c65ec03213f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.16.tgz","fileCount":55,"integrity":"sha512-NwaSpXnx7fS9zAFCcg37cN/Sit/lv8ao/jIkQAigejxzkWGZG8cbap/+meUfUL+6QDo9D7tAFrQIUtXQOcUhHg==","signatures":[{"sig":"MEQCIEv/+GP+Dn1/K1EIV0keC0zusCtG5F0AnqvoteiMS6JsAiBNM/rCt56Sq4csGytQA6txw/7cxh5rtzFqzrNjbbn+sQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109358,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNTZUCRA9TVsSAnZWagAAdoIP/RD2OA/Uv/f6uFBoQH59\nPry7EDe2YkH2eiIO4p2YVOibMqS6EbH1F4CaaXgZmvrJCm0khTpHo/Yw/eGV\nFK+sberO663xk/sCDgGnypOUmAJE4y9o5bCS1UUt/3znztIoZZD4onaF4q0h\nux9psq6ulOkrjTwJiWbfxXLsGo4pFjXgZlCk+qdbJmRZPs3rCKGM+66obh8t\nRE+59cA4Ij2Fwlp+o4lyDOrOFu/vOxGXCChbMzTMpWuAam6Ooa+Z0A74Lxia\n9vWP99W8ET+8IuseIbQkNv4o7b5Dbc17zpqwaQSkFmystQzRQPq2wtrVk3bG\nhD18isYO8Nv2W8++nNP4E26BSaVIPPSsICn84g1OZN6u+31c3FVpq7YFfSV9\nQobFy+D2WeSCroE4ED7lteWP5xp2VyrwLz8TcwyiWeUWzrKX4QxhPo9f5yPt\n+/t3j18Ik4pzFjP4gfrA3ajtNFZZBvy8S7IOX5fpvVxI+CeOVAGiRTQswGFZ\nW5J8Y0we3BwkFGuwCU6iMMBLJULjfoakJXla/rOkylVWk0ndqapvz0gSwIoS\notfQTnNb9eDNR/1fYDmHfdTfFd2U1na37U2pivCQQ9lxFldyXFcyDgeLCl9r\n1hHeS4u2QbukUfLrt+cO4rmxXy4uJRp187QYtikP3oGnGDK8fehuj4OSyLz8\n7FyL\r\n=VwRD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"eb803583da83beeab7756baddcae3adca7650c39","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.16_1614100051908_0.8955062455945706","host":"s3://npm-registry-packages"}},"2.0.1-canary.17":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.17","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.17","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"17ef664934d4fe0190ce1321dc256a5ae58f1da0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.17.tgz","fileCount":46,"integrity":"sha512-SXaS1ZujziInExRJR+jS/c/SU7ClY2LFxEZs95VglH7uvkDFCrSwNhItmbatQu5PlYZaNlCnYHAj/rxGPPjStQ==","signatures":[{"sig":"MEUCIHlGi6DNwutl1PCZVaGtTgUBjipDwUIso1nDKSX9InjbAiEArGORBSZryHXxjxtk0a9LdEHC8JFrK9MXi7vC08eBq4o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNV+DCRA9TVsSAnZWagAAFNwP/3H5XqtVm6FPbA+1qB5e\n7iDdZxG3TpMeo5xZ8c8IDs9o+2dgaIYVeoyerfY4e9p3EKGoiSB7o6FKacPA\nW/s/7UI/Rv5fAEZpkF0KVQy8JP8fd97ERgWsDdgM/auRvBLkOK538NjaCmL2\niSDLrCRTwsWsUKO9bnhvwVlKetC9sZ2/FjqlcEnuEA7O36dC3nTykglOVweo\nRn1Hg1XSKk4nnSW9Vefxpm0rGsVnmlYl99qPBk19JZBIHFUyTgaz7ZiWNW6l\np3+YPfUmwp+Of4XQLSc0pH0Plsm3trShLzzyzKxSLbWy3X7AlTTGoNWfhgwK\nkETJuXhjLJLfyGYXVfPWVMSGqaih+WZ+1e4bfyRL2UZi2YbHM4lLqD8aaTwk\nZ7/qMY2vGycnTE/dA9KaTSS6PzZjt2fid7XiWZM8EZUvdoAMCFYRFiURu6rS\ne+nCZQK1cJoT9EvmQuYvtaMTRPZ3MHD/QMkahSRfYj18Vsub5VCPGYPiv0xZ\ntYDz/CoB2Iy+uLKx9lbmVKf+I5DURu0wEEfG9z4c3S8I+oiH9X1L7riAdOWG\nc3U8LuXENv5wageXcOjKa0fxmJpaCAKbPm3bMA4fK8lZkd5QogNFSmP0t7fL\ndESrTwePrcxLOKVhcVuU55v6OD04IpQH6CsK/iu/TV9o9WisxrsC4vFN677V\nQpTG\r\n=ijRw\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"27c50f731f4987b0fe2f853acff79a32e2763b1a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.17_1614110594071_0.42343167203108023","host":"s3://npm-registry-packages"}},"2.0.1-canary.20":{"name":"@apollosproject/data-connector-postgres","version":"2.0.1-canary.20","_id":"@apollosproject/data-connector-postgres@2.0.1-canary.20","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"95510a3dc837c84203c32a131244a63333bc3832","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.0.1-canary.20.tgz","fileCount":46,"integrity":"sha512-ye/aH2F3mSFe4CTvNpjXKfNVb9olX9q0qic3wIBnxFJ4lb6vVTe0jHUaZ4r59mRwgzDsFd3agV7jMceUS2snaA==","signatures":[{"sig":"MEQCIEITI5zmOc1EXhY+arFix4C5rlmJADJxqJE3IjvtlkMNAiAn3b5JhFmezIAFh1TliKIpUA7svZuk1J6ggfbn2tiqvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNsScCRA9TVsSAnZWagAA2rEP/RmJbQnazuZVv5MDpye5\n7Vkh2yv6TkDylDcllI1yiEfEWhNRjp7tQ+pXpOI72FU6mto+TjO9EO89xMWm\nFgFGpHcspCpkgrLT4A9i/naC0loy9SqMYVYR7S/e3UADzy+I489q58wP2QHX\nIDMkbW/JO/jC7U5g+A+PqfVyhFksiNOAwed33xeoN73QNgAcmFXoxrGEOBJZ\nOFJ19clBmg9djS4rP6bj/7EyR9+cEYgVw2QxB7nEX6YJOBX/xejNeDPFwqVO\nF1yyZk/pmBXIKQiPfowGJgfD6AzcXbSDDS8AEobTxEcouEfLQ5XvyEVsROQp\nYgqOkscMNqJGHYsIaid+EYrgCrRcZZTQje0Liw6Ovpxm07LonZvUWnpNVRPP\ni97SkH7RyU/jrp+pX1ncC/mAz0wIV94AOj/qIXChXcfvUVb4sY9GN3PtHfQu\nZ2Gi25gfUjJlV7uG/i8a/X0hhRjXQHWO4FADLOH0iPGSpgoq6+0iRLP6+83J\nfehYCUWSiskKB1DJLi9r7C10JzrEs7Y6/KNICM+HiJDGIkmIs+cTE6NybOIQ\nt4pL+PiXSE72rp+0yfxgAquaaaxuuqpqXaWVlzXOk9nbPUvo/jJZ0vOoHdB0\ncEwC38hMyy3Ybua5JsQYVIm0PJOuOgNL1s3PgJ+Rmo14oUfcVCImfEj2HMdd\nc1pq\r\n=VbTt\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"2deaf288013b50b1833094eb61a0155334e17834","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"hello@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.0.1-canary.0","@apollosproject/server-core":"^2.0.1-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.0.1-canary.20_1614202012196_0.30107642565676374","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@apollosproject/data-connector-postgres","version":"2.1.0","_id":"@apollosproject/data-connector-postgres@2.1.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"072a028d30bb2ce4264211e0312c8a56fc679a0f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.1.0.tgz","fileCount":46,"integrity":"sha512-fjaGj2LIdagPrpSS2mumBj2bVYoi2LCyP/kwruE11mStK8qRnwz0iexDhYIorXoFvQh1RxkWZXcP/Ve0/aWCOw==","signatures":[{"sig":"MEUCIBmYqHibenJ6pXKBZHC0BIKAI9UTHVCAqShTIQOhxSIaAiEA44RhnR7DeWATFHc6QtwOKETuMQuAR9gP7D+V6MSoqq0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOS5kCRA9TVsSAnZWagAA6qgP/j8Ctq6k4OXf2GDRYVUX\n6epInxMrNgRaS3pGCIU5EE/q8xVn3nd4FVXd1bBADay0rDhUEZ7DfACZf1Qf\noHveY0Yx3D+SLDK39pmI4SDtRUsPXpW8loZ/P6BIPZ4h3/bX+Q/GqRXmub2w\nEINsitkyXT/EslckWzk/wZcI4stahEyW0ja9IPFXJMMwYsubULJorD+arASH\nLoIcJY+FomABk/VujGj0x4QZgbX6N0lISA2w9O9PSs+o8CC/uwGcmF/C4g2s\nhYs7SjbN50A6hszYiDJmuTZ1sKlYwf5EQS5vzY1QH7H09tCbZpDUE0BFvEqq\nUBMZVV7/Pdp70QrIhftsUPfq957rQrtSUcwtItRD6m8XZ9HRSDPaBFfgK9lx\nbz3WanLrlWPl/3xRIQ0liRAALPL59PoLmz02+68sjTzsz6i9LUwq9cZiK2w4\nfwJbQAx+pPVwl0+yxOM6FIwHv/+E7TEKh/KsSRiRIL9MQZTw6Q4LsxN4CwKg\nl4PfLgzjt7EpC3ScynoudPKZ1RIvyytEuMluSEhtGM9t7dZLj97wkATF6oS9\noY95JtWnDFuUJRv6OKemv/3TFsz3M6fl1AH9xD/MkJiCqHljNuz4LfeWOiN/\nEMmjXJnR2cjvr5FCt9bkXsu/U+plUhWOvE4ayhSCcBZFDba9OoglyBvovXks\n0tGT\r\n=Efb+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"cd31afc4f65afa92a8e2359d64c03f03f0861e95","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.23.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.1.0","@apollosproject/server-core":"^2.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.0.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.1.0_1614360163847_0.7884210836277723","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"@apollosproject/data-connector-postgres","version":"2.1.1","_id":"@apollosproject/data-connector-postgres@2.1.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"hello@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3af2934515888b018533467c1a2f24db0caaccf5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.1.1.tgz","fileCount":46,"integrity":"sha512-G4SyfdaXniBJ8C4h+j7ON147JEnRud1Xy8Jj1X3JwPY6E228X9gmtt0CrR6LSMvpbb1PH3fdrJatSjYFP0xz/Q==","signatures":[{"sig":"MEUCICd+mtlouwe1iUbH1b35p9v4g5+dBYPe4OxN2M8k4r78AiEA1Sr50/BZr7Dl535TjPrO2KGzWzhoWdp1HxV/cMFlnfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOS9XCRA9TVsSAnZWagAAAjIP/1Pn85+sNBtvl0l003nu\n8GRe0uXqqTRE9aF/H2Ijum/IAK2oquj//E8+aLqqZCc1nCdlPdTO1cTQjIxK\nWCl+QGD3bT+lEp5zxsZYqrHkteo7AZ/jKdP7ewEIaoELDLdLyTJ8SItLOkOa\n6ewh5G3kv3ulTQ4z4wi0pdj/bpDXTBFYZxuw9/gagnrSGzbSScfadZ5SzI+5\nhLkrDM+zjA9wF5dyDk3lh6eSrOZv6k8Ftg9au6h1dr6NQYdqx0o++oVEdWDX\nLWbAYIdUxXsdorTHpI3iVVDMRY08ZfztQew6TsJojpj9v9ahcPa5GWmBnIPK\nQ2zWs0V2WIOrLOKBjXK06c3m5pkDMaIRrlsvYk0mzi80UXsRWb19f/SOYGgC\nW2qiGWpA3MpB1pZ9NndM7E5emBCacIc2/rkOw6eKzyJSmCL10PIGLwpfIeY3\n6F/ssUo5Qv5rsVMSiLVcg4iu9fWaavZjP3aIDydPKbsUsbs5aFtcreLfVh4f\ngJ6DIXs8mx/HpXHliNJ3PP0l0TuNu9jzKLSQg+ZUKhcGCcP/0THsNGGWHodK\nXRFy9YwfaDKq6VPgc9yamvvJ4PY59lU/Js3b/XuTbJbdxIFpCPkzOKRZ5ObG\nOemoaOgy/kSVVyzBAfiRSr/NqOfiPzT8CpQYfE2qvbzVMtP47KVqrTZ3EcAz\nGtCS\r\n=ETV7\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"d83599ec4714d6b09ede839da8394a2f66919099","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.23.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.1.1","@apollosproject/server-core":"^2.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.1.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.1.1_1614360406716_0.5969025381676794","host":"s3://npm-registry-packages"}},"2.1.2-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.1.2-canary.6","_id":"@apollosproject/data-connector-postgres@2.1.2-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b6ec5478d267d3a2bec50ffcd8296e2a6ce4a691","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.1.2-canary.6.tgz","fileCount":58,"integrity":"sha512-m0pDmzt+jgv7Y4991cBTOAtqAwc9R7r9zldV9TcZ7UEWn/khgWEMRJoudGDNXCxRUc36uu6Ei5/Fjd9LZYCwMg==","signatures":[{"sig":"MEUCIQCLt09yjMFTE3MRJfwTLmG169nukCQXYGiaCFLtJqvxZgIgI5sIPy7LhKOnc9E6vwaBzqbVUPP0r2EKNu06HQRcbqM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP8A8CRA9TVsSAnZWagAAcFsP/2OGs2MqvfymbwuIe1Yj\nJY8Q2uH6zm3YhSBbVQEPTuQ/hNNvAtGPoUQbtLruS7oC125vsvj2djlD4nZZ\ncQ7epBUU80Manv89xe57PVg+4/xBHpl+TJTLYFRRewFO3eerHBWx/EimBLmr\nBBJOCjNIDIcJk9A48SxVQB1BbWGEcPPUfdtzwTdgKzk8fx0jH3U6YYPCNWFb\nSfqEiOK8qXbm9KxLvdCLVpRLpZw1Y3HXauiWBYUy3ctgtjKSubOiITrYjvhS\nmMHGKiGvuHg6vlJH7Or8INGANrXvsCrBeAYv5cRq/LPXcV2TgBh3oaPFT7LX\nvgrS01AETQ+N35NVnBqjhLKKx55aqkQy0bnSDLXl5LGCOOmmbq2u0hKWMw0h\njRoT0DmNx18Aoz4Xgjs/zoTBTMEovYiX3Pspq0ahgSJvj2Y1E1hOOlw8uFNY\nsTmjHA0YZBiDU37HWJy2rFF8ee3EqqNVU5AeZFHWGKBEbJvd2WUDwdbyOVCq\nF/xyiAIhI8+Is0HC3nxwjOb7+aBYqrcPMWvBe7YGfyIYPuu2lpKefCMYh+j/\njgziSXQUUdXcrhHWRBK0qs5x1TNX0HEfgzZ3ZnzB6dfE97xNsT6WvSM9W1gF\nk2mixT6I7QrNsDTwdm4v3NlhKLx3224QeCWDJ56w5wyGK43TvQSm/BGQn+T4\nl2Mv\r\n=dq1y\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"f87a58443986ffd2b8dd4c69f2537200f6c81804","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.1.1","@apollosproject/server-core":"^2.1.2-canary.6+f87a5844"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.1.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.1.2-canary.6_1614790715802_0.6062497419830999","host":"s3://npm-registry-packages"}},"2.2.0":{"name":"@apollosproject/data-connector-postgres","version":"2.2.0","_id":"@apollosproject/data-connector-postgres@2.2.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0eb62f6d27ca9b62be2d2e3f141ea0c73a5f1880","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.0.tgz","fileCount":58,"integrity":"sha512-7waCtTpwqGuF143IZr1NyEaP0X49IrTWzONT0txzQfHdAvmN9wa2Cvg5hvZeyPwG47XLP6yu7ScDjBcQAVmAyQ==","signatures":[{"sig":"MEUCIQCuwJnA390m/nrOFkr82vz910PiCn90fT353a1fK9+HDQIgaYro6xThyzN/7FBwazGY/f4oO+aKzoXaaAGKRlJrEX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQSbfCRA9TVsSAnZWagAAHqsP/3rua4AeUK3KRY0EKVdI\nqqZhr7WRjef7fXxhtgC82v+gA9M6ApbLNjW0afCXLPRj9s/8xXB29nYAibRc\nTkRzVcFrHgmVVnz2H44tX1dGyocesX9Uh01jFP7yYPIvAoLIl2wD8xoRWPvR\n6oXRg2fMor0QzMt55Rnm8/0uo2Ol+UKWDanYersRviuf0oG1DEqZboe4T0o1\n0dvBJ6dXZuEYK4ht9HH222vI1g29rrsrwu9UA0UiCpIhp+ZnWLxF2VFU4Z4c\nsqbHTi76Mr8gP7lILrDETdJD4YAQAgIt5+Op4J7JwtnW8emCsU3+8Bfg5EBu\n6FKE8rZgEKw9G/LQoNdKuuMFDSW/Rh/GDztNz8K6956qdMoaDrBBdf+EfBEY\n8yVISyCNd3og9T0t5XmDvS4DkzMSF4JbEPAiORU8FzlpNT75zk2wsvumfYVF\nO1xXa+a5ufGC/c0j2OKj/mf1EPpmWm29dr2FF9Xdd9GSVurPrf8dI936e0SW\n9fCTdonJROyPtS9jF55WVmKlI4Kmd+Q29+N8/sLFCUCx8xd/xRKq+a7Akbyf\nu6OWS/CswGEc1mO29cszt2Ill9BbwuoQKovAxb1FNPmm9ulCTFK0wecm2oF3\nuk09o0m0VuKD0Vm/U3JQiJehYMu3g7xG0xtZliEd1dSXOOd2yI5AIcZtdWyK\nkBnp\r\n=9pVH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","gitHead":"6d528ddc8fc6df84a3e2e85c1a0591f23fb1ac88","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.0","@apollosproject/server-core":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.0_1614882526961_0.6421243518873785","host":"s3://npm-registry-packages"}},"2.2.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8791906257168395eef3806ea18376989270a4cb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.3.tgz","fileCount":58,"integrity":"sha512-9xeSzVczAhItYJqaibR/mqs3uPXRlsD/lYKYsw4yG6FSEqgk0Ed89e7B70vYNF/w7BILTIgEhFGUk2NXYSnjFA==","signatures":[{"sig":"MEUCIFljuDt4gHAoFuQG6aghzdTfWPalOiVsJbPj+5HKRkS0AiEA4GKHmNRaTXcZZxCDsnmaNaO9sd2SRJpkeyUyFed86CA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRiXfCRA9TVsSAnZWagAAv98QAJRZtZej6GFm6LyCLMA4\nDwSIgk9BZJQLG0Lt3H1tOQ0jt+gonDTqfEz4CfEyg66kCWt93PCWPhgHfMv6\nfaBEEOAsPZw8caAuhxH50NkF3NDN+p+fuoSsU6CLPVcVzyo2tOiwr5PtQkSh\nyN6rw03N6lafdqdcjbNvwuPTwZZk3kMmUZQ3aItwjt3zitLpq+T2ADqQkipH\nVX0oNBz4N3vhYPu7jIjm933W+5z8clO6IYF9e5UVMpvVUmyxzZWPU7iKo/ve\niSl2FAiRMpp8sjW9f1/LvkFgjalUzNhoq2r4Q6zP/PtSnNbtNmfstaoFbS9D\n8pfqTWxq+Uh0IcyOUsfWOQJyC5Ftrm4fV713UjJKaH1SaINYxlH9PzKQfmBR\npiN9BLcYYXCYoZJX0SfSIvqWJzcENlXeFs4L76QkeBFo1W3ybbJKUXgQRH8R\nxUD3HCUUT6AxxAOFMrxhuxgvKvjUou46ovnG5wHxEqdfkvqGU8mbS4JB+qp5\nkD5V/hbh/iZL8VGgW9RCOYziFn3/x2HdwKHGIBjQnsGHtW0uyOznLE6VLaeP\nfuXLnoKHhIakrkzjxJn11WuhSWfW20WWQLvhaFc8DjUz96UmGWx4wrkQ4M3t\nlR+18pf5+Y5v03lOqgcE07x/7eSeOCngpxuYtHXQEdiZ6Bnk4FPm2ANfGvhS\ng8ei\r\n=bfeu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"fc5cc291faf4543256f806dc97d79aa237f17685","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.0","@apollosproject/server-core":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.3_1615209951250_0.48790374892302957","host":"s3://npm-registry-packages"}},"2.2.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ee8ce3c7a152ccbfec56877a6f60d215d0760b47","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.4.tgz","fileCount":70,"integrity":"sha512-AYn9vftf3tEVBDLSrEpGkar/JGHAxpwN8BGaTwA0YuT01Jk6SSc7VdQdtOzORrYPiOqkyC09Vi2t67SUK7eVzQ==","signatures":[{"sig":"MEUCIAcgyKewSKW8KOxrJ/PgzpRqBryu0vtpXiwkC30TPQu5AiEAxTUcVM4SlY45Efs2VP+4CROO1kIwFYXptoL3uh8HzpQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRit8CRA9TVsSAnZWagAAIlEQAJ4GZUmzZUipGf/X5mZO\nj+Ltp87ugFYx8OjVaVkQJ3EdXhWKCHp6MnxuGs8TjthZts+Bn2r4vCRST37J\nFci4zAb/aOuAIvU7/EHEgWa+sDBZp3FMNMeecl1TiVUT+GC+kNHE2pVXRtVv\n4uJfJ9ddF03RmMdXVb2ARP5Rbvdq4783G+RI+x0pMBTFnFLzhqBiCRBQ89ZZ\nqeVK1CLNiDyWt/m8qjddMCoGTpbzZ8YAedBhumh/MkorthbccJDrv8KESnlD\ncQKeGA1df1ZBrljKTnqm29X4evInxtm6NaAmkDQ/J7wbLK0+4MpxSX/Wf57F\nYfVMcK2gPBj+Kqj905bSpS0hMfHMvob8bod0ijUQQa9vJzZS8pZaj6wkKcoI\n/+voCJMP6MDfK2r/FbdlkfKFIG6E/ak7Vw/00NneeCsL8NnEeSBk1qOo/McP\njDo2BWYNpgPQYJsrHZKKxQwigXR9R8ZEcSvSOuySoXfjKCOPamU7wDhb0UUN\nkQtNkXd3B3f/vYWD/6CvJkRJ+O5sGVk51B8l408JGh/4zOSYkZSN/uz3jtV2\n7KJz5bBENRqInKzaXdAB19qEaNo7c6tdL94MhbuxXJRllae75nathZuXTTB9\n/emM3cI0TmCVmhXEYiGgKLgoLXMzne30pCf+uNoFS3nRWQIfn5bYcmO01ft5\nw9D7\r\n=BIzU\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"804a0a7c98e4abf8cc7aeef548d1735a9d40c5f9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.1-canary.4+804a0a7c","@apollosproject/server-core":"^2.2.1-canary.4+804a0a7c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.4_1615211388298_0.1780048042926865","host":"s3://npm-registry-packages"}},"2.2.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e5b80259135098bba044ded6072c5fb99eccda34","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.5.tgz","fileCount":70,"integrity":"sha512-yk9LVtqC3cLqgc7EJnIZwYDJqdQpY5X/0riulVBFHGbOwmdqUiNBziB1HNQ+Qrm82nFGh/IbECDy9OOso+rMZA==","signatures":[{"sig":"MEYCIQCvcU1anV3YaMG68fRsFwwToe5d5dIVsQC7uYVVDXNLsAIhAN6aRfG6Opn2YQAhzTKwHuyLn9gO+Eu5cv9p/tKsT6QB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR4KXCRA9TVsSAnZWagAAHlgP/iaH7LkT5kFzOuvAjNDo\n3g2ee0ba4TuOHApKMZWQuuxkRLptZKeenhMP7yd10IvLFz6xubBUi8y4ju0U\nfw2Dd7rNtYSFF3SMsuQUdR1gv7aiKuT4AkWZNg7MxGeEnuzSh8hQOO2sXV+f\ni1ojur3mFNwx2Ikvs02FYWoD8Xlk7fdb/b1tFWhzxgns4+kJLfasnf/zmIEf\nJ5wky/AnOPkvABCE3lgzzDTW1EVS2LeasL6++rhxG+m6WbN27rdoQWwoF9Z3\nsojfarQp58t+1NA7OnJmBaJ88vfT8IQCfZpscg5+8936/+dCH/2rz1LqeTE4\nQSpALPDJ/Y8/yP2giuhUsqxxwM5pQCCHUBbYci/a8vem426b5rjd8o9MScMi\nPiUPkEkeXpvO68VfjBYTfkaicmwi481hS3V49nhU2pfqZjtmF2kc6KDWgwK0\njLIo5hJPDOoFIUYENU0T2AuhG/BQiTYyaDdWhi3TKJDLHo3J++cxGGHCPTyt\ndGthJ7MtCaRJH6pvk+jaAYvrPpgFxiq1c3/UEEAJDXojTyAuuEXyHV2ARDAc\nmyPU4dP4/M4LqEjC7w38/S1/To6U6PfXhC4zFssdVZ6F0uHVr5H75wgbg2zA\nyewdnPMA947KVdRFKPehhgCZWBd2CMI4perOagRDlqTdukjj53U7GeijHTJ0\nMTZT\r\n=EE0/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"c254c5bcdac03c840926da53b19eeba9ac11e9a5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.1-canary.5+c254c5bc","@apollosproject/server-core":"^2.2.1-canary.5+c254c5bc"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.5_1615299223463_0.989872097576239","host":"s3://npm-registry-packages"}},"2.2.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"09b4ce4d91884ad19933cb0c1acb3272d02aa384","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.7.tgz","fileCount":70,"integrity":"sha512-iCvRCONM7rXryP7+eJ23OTRw4WwyitRvRyRD+gzb6+E59HMk/tSBk9TZ4ijQGMLJV2DHGJF2FxIN+p6nekLYnw==","signatures":[{"sig":"MEUCIALjKQu1O/QUPybAP4VfIPAceym7zmZOdgKXpB5tjuNvAiEA4iUiFyw+vM2Xgnd8HJs/LfZcAajLnYwH8UI9C4/9jXI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":208828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSSFpCRA9TVsSAnZWagAAIi0QAJdg3SB4RCiuSdxmn7EV\nKpNwROFO2lXyQmLgXbIAvtGBSv+QjU1r5NJUb01J2iK9Cj6iEuuYONsq6Z5M\nDl3aimhbtHSnXRQjFPzzHDDqRpjffgp6pyJ9IEkWWibYS8/hVh0PVXM6of9o\nP03v4WbcZGDNqlnB5vPPBZL9pFo26IFfPs1WlsdM5AIimbLVH96cOY0VaJ7l\nYsPFcx8MH3X25kD6jpgYUQNwPySMzgHE7KjJ/yme52dI9zMKAB8j7dfi+tqb\njOzNeQq1W/8S/1tOflwu4hJMCsoyDUvoyY74uv/gFUWPSQK3HA/bUGfy6usR\nuxCrPY8ptKGKatwovllvCKBxFpABMCyB4Ollt72dlIQztLLe+Oaizp23RHTx\njWM43czRGCdVXv/fTAen8yhItMWS+lZ7DGfGhYWwPGRoMRQZvEQUvXuEmRg5\nzf6R7Ucz5r8/h/+OGwSScX3BVDaWZ6hO2MsM6cqZpXSDoLqZr70oMm3wpjJP\nsmuJnGbFKArDFjOIJLVz6/mBjO7/QryRciRMqYxUHNTb0x+mezBmiliSknnJ\n7uORjSxxxQNhHvAH35ioZLdLU9vi9c7FSKQiGJLUjUg7exJyYntx23DOkrH0\nZ9JeCY/wMU3BDdzX+FnFrnpRWc96SuH9ci5hfUgN+sRU1nFALfynpC5Cc/dv\nXbpv\r\n=uKqj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","gitHead":"3d3d1a2ee014e68abcc2b28b3677bacefbe1cd49","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.1-canary.7+3d3d1a2e","@apollosproject/server-core":"^2.2.1-canary.7+3d3d1a2e"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.7_1615405416513_0.7522006425993686","host":"s3://npm-registry-packages"}},"2.2.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e73a6017d566b48e72bd6eac4cb2566322b2ce68","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.8.tgz","fileCount":70,"integrity":"sha512-lfzLxKt9QHaLsCK4Mbv9jXuM6qIMaz/KdvuU+SEUQzzFVMOBEeO9h5GMt6kLW9s3J+cwV32CsLiAransu+asmw==","signatures":[{"sig":"MEUCIQDz/0k1/kE5OrSiMEL3f6sdXOUQyOH5y+F0JQMn0OCxXgIgXRNQl1PlcA8Vo2ozUquR3ge9D/n116a5YZCKPgRn+VM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":208887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSSzqCRA9TVsSAnZWagAACDMP/Rk4NhsQ4Z2CNQ+9rtWq\n0v7HW7EmHroVooXg6CZs1FIseD7fUA1KtQJfaZstLMS1Wfr+nGpmU0jd8BvW\n+CUesx9Jx4EtyY0w8G74GQqLc66b2S5+/YOs1ugYECws76dYHMIj5iews+D8\nluaCXpnqbMxpHLxPGY4IJkztKM9ThDmwiKalYlwTzYKuePgSg6VbJM/eKEZU\n6QapOp8YFGtUVOogEHgCdO/tDIcowQqYKQ+cV/B18klH9g9JRz1y/71+sLO7\nm7KkODbEhrt9Ayc0fS0WCqkwkfsiNf33b/0JBq3cBpfjbLhPpQaXcO/jElIE\nBtReuGrXutUfQ1hsFw7qrPbKYxJ2HKTywLInrOVy98oITKEIUhag1YKqW/wM\n4Gu8AVgX/tvyvSg3Xnq/bTx9ejL5aLPOIUj4XOOyG8OW+/zuXJWfI6V7D6xc\n3V7Wjxlh6k7RASkkXQ8rr4IaXXMHqkZwMFGr8MBbFbpc6vqaj4Nn7cvSY/gy\nlk9cJLqxYxW3w3iEhLhHJdsdzoD7FGSjrCoQ5QYC3RRbPBMJH+gFpK/TuqOO\nn3S7u6RCM02bDuZh9fbqTQr5jjre0Rm8+tnTNd7HJJ0KsMkczEnp9MQ+nBN7\n8+vgdLs8Zm4qI2Ye1Rj3SMZNvw133TWV7FsfYOBrIoeVe1XS/LCLFkx2DCJs\nhw4+\r\n=aWC/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":"10.x.x"},"gitHead":"f47ac2273016bdec57c610bd73a7041cc226f618","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.1-canary.8+f47ac227","@apollosproject/server-core":"^2.2.1-canary.8+f47ac227"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.1-canary.8+f47ac227"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.8_1615408362407_0.03309075829927299","host":"s3://npm-registry-packages"}},"2.2.1-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.9","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"72cfc100c5026718d4c695195df41b4ad67f1d6f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.9.tgz","fileCount":70,"integrity":"sha512-um7/fiIejvo2lKpnVtcGCaommA6YCVPT4GKMzywg3UoK9z76v2OeB1EKGwJW0vfwbp2xEbtFa9LEMvMRQILWqg==","signatures":[{"sig":"MEUCIQCsgdPy5issFBltfBHaxqEMbx2lMYbEYpLcshV7T6ITPAIgJtBGMlq8Jhdp72Aa4CL1QuEWEvKuzRe+/wsw5Q1L5KE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSTvxCRA9TVsSAnZWagAApIgQAJEAtV6RIFY5rmFiyIgq\nuxhw9mk7HdEx9UiSa510NJGmQGDu4qpXTNhRZUaiBYznC1+K2oiB0UPU7Zbw\n2naOY+ZJ+8RU2t3SSs0mMrGwk0wxrLZi6zIjuZyZQB+mmENUJSNOOxBRWVIW\nh6sVYT7wzos/ldDQ4kmEuN4pYbSTrksRAIeE5Gn5LHp+XsG+jyvM45/BBDPO\nQt8b7rG6YI2ccUnbhhP7PLLTPjqA0HF/sdqWqpvddzyCJ01tt//tj7oA/Ws8\n2sVV4c8izQvUE8/DUjKeQtJ7Q34ieKJWic4hwJgo2Wwu8zyEC2cmRlXSUGCz\nzjHFT8FkLaL1LLeZpJov6agYIpPau+FxPG/UiQeh0X+fg2V5zy8/oInVcXK/\nHEt399mv1U9rnx8kn7rzibY2oiNkmC18dJm6eLrBFhDmvlgBeIEcEd+wG2jl\nzpWPe9rtXdMCu/DL7IYbB/qb5yf2Fc0u/5mRKr6anmDm8L1F2y5m6EexoA/P\nEQELkHIBQAMgbURR8C5moadiXAWLjV+QVg5769MYCOoTY+C1c5Xbx+fNc0jp\nw5imcJ6iteh8ldGXSELLsDXvSBcIaSTxG2qUZrPjK4qG+vvU/3UgNLLAvV1v\nRK0zUFuPPb4n3elsmZbosiXvhAe56lvKPqMWwX5RtF0nHr8FKGb+WzQ7ttbR\nhyzE\r\n=fTut\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":"10.x.x"},"gitHead":"5f3cd78c45d1e2588f85dd5c6e6f0bba4349ad0f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.1-canary.9+5f3cd78c","@apollosproject/server-core":"^2.2.1-canary.9+5f3cd78c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.9_1615412209370_0.9857144396697533","host":"s3://npm-registry-packages"}},"2.2.1-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.10","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5f515009436e69dfbaed3a0b6cfcc1e0b0e3a145","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.10.tgz","fileCount":70,"integrity":"sha512-Nu1L9qXccdkRxYK60PWhXUevNPINlE401zWKS122NPkIxPHhpGVWwuiUQcw40/hYMC5xB81jQcMXxerxGb04rw==","signatures":[{"sig":"MEUCIGY13eX0bXQm0NATt3OGkc97olvTnIa2kZ4P1ayD0GuyAiEA90gU9i391w09WGhgNTxp0whckoKAuU4jJIjKv8PKtn0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSjf9CRA9TVsSAnZWagAASpsP/AjqSOTcE/MzO6ILvz2o\nKCtFEkJloyN+gr8fWlb12UuZXKyuijUq5qCyi/DYp9NAo2ZjYFHBWD9oAPv3\nOTuvjNHuw1wuFHR9OzRJzXdrWIcNkqsCfB+WzXKK7kzPJ3ox76OirBMMqCbu\nTUisChzWUlD4Z3t9ltBAzsQ61D0NwKrVdqc7UHdMepq8K77FMehcPM/acNdu\noZpY6vpQAJdTYPvAOySSDI31qsSnAScbtM7JIGoRsZVymfIJ0DCZO2AIH4RW\nSxqreGJ3xMNy6ZlSi7SISGNYWUz/hzkgEQDaM6oMf02CH0DmJaNV0s9FbjnJ\n/RQYabl3QfbLwoupv6z0FkhsF/NslzLk5WY7DQAVFQxfCXv1M4xEt+/NGNGf\n1eKBATqKKMBmvTzgmQh9cOZ9sUsPxPkCghTW21lor66uwkVfvKDC/RnQwAkT\nH49FH8tWoOZsztijHTcOMl+nzF/MyhbUu/aHgSONv2SW9C/gclgSN+Xb2qhn\n39qgSmzyZckCX7WAHBZC1ydnC60/Icvcbzty/J9kO5UlmtmtpVRdP6AFEGwQ\nS0lh+o7NlVBhW2MppZ1Rz9uJS3ibeTrSuskjNrgX8wjgmA8ud/S7Dy17N07a\n9tOqX5H4IpgOioVqYlogCY6yrNvy94Nh6ZsHWrPHS64+w1L9Ilc7NjYtvkaX\n5/oj\r\n=LrDZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":"10.x.x"},"gitHead":"71fcf373bdaf06af9d3fc956d2b95f9e5f4506a2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.0","@apollosproject/server-core":"^2.2.1-canary.10+71fcf373"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.10_1615476732892_0.7926390359052933","host":"s3://npm-registry-packages"}},"2.2.1-canary.12":{"name":"@apollosproject/data-connector-postgres","version":"2.2.1-canary.12","_id":"@apollosproject/data-connector-postgres@2.2.1-canary.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a448b5d00f547f4c1fb5ec1b6075f2468e7d6fd7","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.2.1-canary.12.tgz","fileCount":70,"integrity":"sha512-a9W/hp19lSQbAZKz6dZfPcxKmFfNJM9LfNZPzqC6N5FOHMf7vT/qkqGjixt58tKjkXK0uwGEEv+zmZYQg2C4YQ==","signatures":[{"sig":"MEQCIBLT3iS2CTLwo7wSWJsXpya9YtAIIyj2Iwkn8//V+70QAiBVo8B7dqsEChkwGEJgs0f3QzhndbIp0C3ZEofKwNQqhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":243271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSl4SCRA9TVsSAnZWagAA8BMP/jY94Fzo0au8MzMT8xAk\nCFJqMoJnBQTKZwCaq4d5y5dhmaFVXIT2pr7Llx4j/Zvb/okmVy/ii7EBfipV\nCc5YM3fa57XXli7aAgUSv4wnEf3Ef395nChWeFrlK6jU40kklvGmefAuFR8j\nB7FrkHr6ZU1U8tvRPaSA8QtEJNTphQ4pNS8WRTBUbrylPI01edyy30PRqxf9\ne1TOMFAhCGockOI/yTgCGZXC2BPHbn1Wpzt0Hy912Str8h83d2SOCg99KZnj\nBDZouVomgko2f2oBCha3ilEN0cDUJJa8Nr0PEqWQG5KtQM7DPrMi/Vq7FM/n\njP5PIzgs45NcXayFq4rg+I4faJjhP5AdZwPC3pEqnwUf07ceB0STC9EyMMHb\nIdD51Y0aQEqJdadSsu02uwCDYdprD4CRp2psnqqZaNd/jUGWLD1ww6PKnFm5\nm24pVF5ukj9BrVpCzeib27qJcWTDiZZG0u05moebJI7f4vrxeDJbBphAvrU3\nV7PPkR3mlXWR+l7BwXED19dO4C329x8YJoxzl7CwBr5dUqKuVkr13cOtvVzO\nGkjRK155sEp8YdGRJKA3SAnXVvJy7blUxi/TKD3Nkk7yxQPYBtXjwXEpDTKS\njbWtr3uewQ4hodTeLWCnkdOMnuUNICh/SisBORItPwD2nqG8XNDPSESRhRfc\nQ5hO\r\n=VjKx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":"10.x.x"},"gitHead":"68d042de2999aa466f7460263db6ec273cceafe4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.2.1-canary.12+68d042de","@apollosproject/server-core":"^2.2.1-canary.12+68d042de"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.2.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.2.1-canary.12_1615486481895_0.00033133021736864166","host":"s3://npm-registry-packages"}},"2.3.0":{"name":"@apollosproject/data-connector-postgres","version":"2.3.0","_id":"@apollosproject/data-connector-postgres@2.3.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ba38f5ab40910aa7408607a047055641daab1b05","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.0.tgz","fileCount":70,"integrity":"sha512-jnC5GNeAUilwxJbJ16LRlDPOI4eUlja0o0L3PGXEdULQbbu6Rpem2RzXSECnivfKWWRaQXoMV33kvwq0cyjApg==","signatures":[{"sig":"MEYCIQCccvKN4XrJTm+NygBHtdE51P54TE4rdipiKeqE+OOnTAIhAOFZlnC2bqfLCpYrq5D7+gwWR7pozOpXcX4Lphzb6Cd/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmu+CRA9TVsSAnZWagAAijYP/0slFRSvpyHhifaJEJCc\nzande2vUH4WPS3HtMLEUDADon5BDSMXFM5WUFGKXnp5huOWonMKGBfTcGy8V\nf47KcbTSB0N8bOvfFDvq9Z3gdFbCIUnld8QMN0jtlxg5tYAQO1o7UPsaM1v4\nZtYTGC1HiZtP/FiCGfbU2AoJ3AYI37vxDYqNdExH+/WlkZORkauYPMHKJRi0\nCju/ZKmpFVTrWxfNq1q5B3nXlRx5/OPr4m9oJgT+G3+SZWTK3wmJKpALcBNo\niGAimjgGVWpM+nEApeLBKdOyo9W8bsejjqjeBbvyhe+Z2Rkq+1nvqB5aAdec\nf4XGl3hVIyuvbjq6f8IKgN4l+BPp/IMWwnzfdDCFJOmneft9CQ+brgpPI9lu\nKvDODo88xVKH/uSruzXnbNXMmbU8y7pU9jiee2fmP0Ce8glyv6+WmbsZ3LEO\ni1Wx6cdJYwSVgxAoKUYwNce9tGr7+kszx1x2YmIY/pI0XT4x+UnGEAB+L1vG\nsTMdwcIGuKQ/yoGV+0YxAv1ZgxHq7G8EYEBFEkBthiWYbfq+8YGfOsBMhFZh\nRQEZHuWoKDHhNNzWJCwtkgNZgP2r/ufiBFpwvf7NJSdBzyGh5aEtslTN2ATM\nTLbv5ZeErXZI9ZNiQgP+A9Em5ryouZlq30MBqORkVKTrTSb9dl/SFlujdpn9\nonQg\r\n=8l2d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":"10.x.x"},"gitHead":"ce1b9da4b0d172ea96e9c903106ab4a4f877a7e7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.0","@apollosproject/server-core":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.0_1615489981620_0.026735484473291216","host":"s3://npm-registry-packages"}},"2.3.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.3.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.3.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a1dd8d9f2c4b375d3be71e3aa0727a1d4a8e18ab","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.1-canary.0.tgz","fileCount":70,"integrity":"sha512-vZoQYqAOlAaLLFQY9pv1ILw+x9Br2CKeT2aKppryVpsTfV6zhn0EhETjqi1jTyEUwRTNenpGzL3AJAoNbBlhfg==","signatures":[{"sig":"MEYCIQDQgR03LsYvl3qVRfnPVgLt8gl5ID/puy2Fp8y4LW9XnAIhANQ1y1r/Oyd9VE4k4l5afHPY6jzhNcW4SoPq8Laox4oU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnWwCRA9TVsSAnZWagAAMucP/3razrc1ZsBLMrPxdLKr\nS+NzCUn/v7/7ldywmMJhhEs4Aj5qnwM7OQhLE3K7VRtC6ODWuDcjsIAKXKHB\naSxhYM7G6s/K4ERT9OeZ0YU/2HcnBFX3CUSEADJsubTmP0z86ll6cY/0uYUU\nNqDMHsAxyTgaprqA4EqreiEDakP0mGp69hMEnlPucMPf01Gog8ixBSGbd0Ud\n55n0DmvY7mlq1SYeuMZwPwOVBjRyDmMCs/dRFHDnw1bJat6DFlib8n4H52ok\ntTcARaRuwTjrXYy4kdFGu83nyimNt8zFM6Myv44gUxqze4IYVubBY4VMgN2P\n00bXuCi8mQuEtVquhDE2oeLA4sENTV2mgUA9zl+CrF4IVqm1NY80a1FCtZnS\niOlRRr3c7LySzdu4fRgEfCXCtxasyUD7ryEREYwJyRvIUbrmoCc6dNLbKzVg\nRD4urc4/zq67bOAPLLfs/gpmBL6zzNN67U6w+8D/fiaEgPzsegLqBCWaChRN\ng16vsY33j1V/0UaG6dl+MiF6Qjk8iGU1DDALZTxKVDYQ3OUk1Tot6vQFepNx\n0HlhrVZlRGewtW0cLbxDo/EoL50CX6QetFXVJWssM3/FVFF0CvTnLe+RHOuL\nn7UBG8nJhB1l+7rNSAkeW+rqrI1EW5C/Zmc66W7sWz+0kJgGEiUJGV/he2K2\n521P\r\n=9pOD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"a8df2ef39f7437e76becf4f9a3ef96e61bf3e76b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1-canary.0+a8df2ef3","@apollosproject/server-core":"^2.3.1-canary.0+a8df2ef3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1-canary.0+a8df2ef3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.1-canary.0_1615492528491_0.2423252111931793","host":"s3://npm-registry-packages"}},"2.3.1":{"name":"@apollosproject/data-connector-postgres","version":"2.3.1","_id":"@apollosproject/data-connector-postgres@2.3.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b4265e9945af2de5eb21c5a51e8e3da2a91f57b5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.1.tgz","fileCount":70,"integrity":"sha512-Wx/EBsJMjdxC0OkFVudvHEO5WYmOp9tnErOkOO7NgKGlIDI1gjDLb+pYGxUeTpgTMZuB0zJCcB6aZFpsGS5Rqg==","signatures":[{"sig":"MEQCIEc32+2y+cBYWRPN0z7VCyITYOLQHf5GGzfYk/fUvaVKAiA8LxCLCzSUwRBtv+i/x18fCY+zGpCDCbyoJZEftoRLFg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSn0XCRA9TVsSAnZWagAALCsP+wWFzrQjEK8xBoiCa46m\nNBiMeQVUptIlx//wQlKk7ueEqr/RkCi6adk/VURcGhCdZIoaYYeKzo06/TV+\nYcpqCPjGSHNk/ryuEIJa0iZHkpfStHubb+jF66iOMOXXcoUTy3a3+nUMDSLR\nVa75yvO9bieYGUPSszDT3+O0js7FBP4U2ZJIc1EiVIzgdcmV9NcaXXJHzgut\nIqwybzuNqGpGnxRzDWuQmj9IPAbGfTQzFHptJn4m4T0VleuGH4CJDvlLXKZC\nU6NmnM4+d4ZEHDeKvxz3xmWV7O0cB4fe7JBIl8+tB5dtcucP5Rmly9HXXrCo\nV/AH26BftsSMWwxL1L4Nku7RZB1SncRWRDgokQa3pXNbEuiG6/6KIkcQgyBF\nFKHwLnNHl4fHPu/gjf3qJ0iyY7FWk+LLq+Vw64IUx49Ua9sTFCfVd75oFdXK\npNNyax0Q5lIxbnT7HRt44/0rAzf+aol9eORZM3H5k62SU/+B8deUy8wL8T/C\np0BPqT8VyVc7bzO9JrTH7rj5Au/NlESVDA9mQ7gnbWpGlbxn31ErJgiTRDtw\nD+V1J+I0ntxUsN5dlrZfBGnaxChdTswFl7s2DFmWXA9q2+X/t9XATuI/NMEN\nRVmh9ETYhAf6M2j+4LLOo4qlTtIqPlfw3ZLVelpK3E0QY6mluR/O32E7S4ts\n2Nbe\r\n=iaE0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"e0cf6a9ac9d837cd1c41234f12b11cda9333aab8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.1_1615494423124_0.9034041968309552","host":"s3://npm-registry-packages"}},"2.3.2-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.0","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e715c2447476326b7bd33818235b101193c4fdd6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.0.tgz","fileCount":70,"integrity":"sha512-pO6k8MNVNqHiUlPgGR3YYiFkD9DPfmnRUuvuBEsI0uAH0FMeTx0qhezB8NDuCD2DuBr/Kchfwzbm9BWkp+/A6A==","signatures":[{"sig":"MEUCIE5XL0W0sphi39Qw3/G4306Gp/4IHy4zzDQmZ9bfveB5AiEAqar66EuAsxNF9CLleKeObGXeoJ3cRaZGgEAblR5jedU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSofoCRA9TVsSAnZWagAAR0MP/jlY/tItKYAU80sSX4Fb\nJb1U1iWSsXyYNloxTvYLVn8e2qRQKt8qkpHoA+45CSspq20YQ0FoFaPNOGQD\nkMw+evUHmKlWgCwgSDx+HhsBQQlWkzgVrS8HHqR5iwv9lzaL9IjwTJgrg91t\nfGOOlrorUJCqeX1fdFV2NmEc5dSwCHNxQkEZR9gCsCRxHghpKk8JmS2mrJgq\nr07vxdNrBdlnHd869NnJY/zFuEzmFJMISIusiaW1Dy+htKPi54tI9qHeeSYn\nJoHrNirmSp43xq3UhsV8gDWWJbaAAMLxPf9+jlI52PRhkEMK5nk9mcbBFmAw\n2wbDNV/LsLywwAg4b/9e5ueCSiT4w8aFT5Sk6DLsUHuu2E0hpjKtWYUHzTwf\nGRF+6Z/Va7VV+K9KhobavXgld+8CrqMORzeSJTS5W5RIcTzrOaJyCGFty1aW\nbveeFZnLTw2BfVWVtT1QamohSfRyLECmMlDuK03O5Y44KNB3INMRYdXGjjgB\nscu18A68IaczkIvj+vGzjL0FUWHGnbZOpYn0fmMAd6y697Z6LDtxBf+YFYwL\nhWHpQmsncbazGTnZQCM+njhdfjzAHb/foRRY/Jj4Tjd51hGgQSAABmMn+dJN\n6sXSKm7rT/FfZH0s9cll06GI3KVPYiQf4s2SAEOaYSpz5zUOXKPdtHuyFyr7\nlRUI\r\n=bmjG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"b85515670375785deb366c787819020656aee29c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.0_1615497192036_0.18241419910346846","host":"s3://npm-registry-packages"}},"2.3.2-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.2","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d11dca6a65c51aa5627719d83bbd6b1c571e5b7f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.2.tgz","fileCount":70,"integrity":"sha512-r5+AByw1Yy0ygPPssXONj1Ou4EQ5zNdtjUAGt6NsHsy2jrycvIeJ6JzOCgX7UOJI+DzihUgLYzE54gggsDkhug==","signatures":[{"sig":"MEUCIAJlSEbMIhI9ykKVhD+CBmcaieEWoB2jMsejKoHXpjLYAiEA+189Gp7Fo6Tw7s1bWVSWHMiYmbup0nFpginyOPOZXtI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":243032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT3u0CRA9TVsSAnZWagAAQpcP/ijPbR2+m3YhMk3Hw5tJ\nOsVtSJKUgebGpvcEYzmVGbJdVssDwDfeInIFdoKSmqrkjvUEFt9Xp+NsXn8R\nLJJ6yDNdjb1RgrJAiPK4xpNu2CxAVjidbvdtCoICrYISdTe5KUYNSOza242f\nkKkZHCkMQ2vKvDzxYRgL5sqFFMhU40RAcScaP2LQF/CEwsaeFHQ8lG2ntiHn\nHVHPZ8OpYLzFx/Lz0kPRrWV82vSB2zLdXvR1gEKD8H9EbulEzZlgzXdvsEi4\n9dozC0Lp3c1+J3rhRVic/m2J3avMgYtiP1DLvVFj6P1PVC9CWhr64f868AUt\nLtgX515UfnVDxAPLvaumbV18GOW8/eozi5XUa1VDScJakS1t5yNoas1iLzOB\nflaU4g6tz+961ZSf/6kAj6AQxBV+4Jtw1BL8tLC5jIq3zBxHTvViLF4m20lE\nEOuYIfsaydCLZ6YmWIE9C0qYIG8LLOvm8bQeVV8HsaWy5n46XIVVwUWG+iSA\ncJ89UrHmlDiIxl+pZX0BMthacahJJ968ENftgsVlfkRAGhh4EJDl5No9z9R7\nmJnnLOZm0B1OuMWEMUOV8Rd3dY6upcShjM+Eran1VzHTXosnduLxbdEg2wvk\np5boGsQvYagSe2zrfVNlfwgpEMeXd1WQDpPq9Ikqchl95YUs2dWyVl6S4vw8\nDXCe\r\n=roHS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"8b5f62cf77d2c466fef8e95e05d42490b7031b69","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.2_1615821748299_0.41965878238849896","host":"s3://npm-registry-packages"}},"2.3.2-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.3","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d9d38713f695a110e418e9474dc93dcb03bf962b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.3.tgz","fileCount":70,"integrity":"sha512-zVMn4KvyUb3mL14Gga5rzpDGX0EU3FnxvEl6a1R0S5YgDLpapCKfUGHpjdoYjmZIYHfDLe5KYtBDxVV9yD+AtQ==","signatures":[{"sig":"MEQCIAtFLNJxVoNCRPDVnPtxbwDM2Gni2bxQZkfjOLfAO5jXAiBcMJZNqMqc99f1M60TLGJJ7qex1OqqUA3f0eX7j47PPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":243542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6SbCRA9TVsSAnZWagAAN1YP/i1KhAGg/6zgVKy92V60\nUjFuQx3Ntt9dPh6OX66Ju0cXYnsK+bDLaErCBu4G1vfXE431oIhJ3uA1q69q\nq1TAcWNQ/o8XWHVzoiwokw15PAr8dzvhnCbFdtr7vnZJuqICkKj8OLXY1yBY\n3moiqJPdTJBJOODjn8cOUFkzzQWMmkeUKjLMi7+dPmCCwx5EWWMmMSTo3GKN\nFhBgeUYDZxR7lUyhx4HJOnkAfZCLZjUagFpV7SlWnbxI8B0eGATNXqIUJVg1\necKPlPNAB90UW17PHiUs+oq++dyRmpudvbFRSpanEUh8zrheS2TI6rD3q5KY\nocwuYpX8UyRY2Kv7q3CXwaESlb+0TRC2uFN8Lxy5vZYvcp1CB/NzKxUBhl3s\n/RAwH5Jzq36kRh/VRoSYtb+yhBEq4E+5QXdT09egQGN9rItxUlljdR03RGSr\njKC4cu+q0EkT+QQ/PTy2F+7l0P+lzQhTZ6EGaTQkG/zKPXOfv0kw3LGPnwmf\nV139iQihuF8PizNIA3rwYnfZ3GQreCZ6ZBsRrEjo6GPgik4PNXe0NzN/1PVk\nk/CJNbuCjwJEdU0s8XyVweylzFDXaGuK0L/UWxo5eGVLtviPXCxCsG9Ya1+R\n15Si4uV74gdEKUHVaVO93BZ4e6eiV7H7fNEQ1b4a4XTjt95hbogP38PEFVQZ\nx5Ef\r\n=Vrjo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"88a8f226d092a3bd777d5c91a3ec4252f582abc4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.3_1615832219091_0.023174553881448734","host":"s3://npm-registry-packages"}},"2.3.2-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.4","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"89130cf4d95bddce045803a7a043ab48b7935f23","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.4.tgz","fileCount":94,"integrity":"sha512-kfuJbi6Cja/cPufzN9yl669EHqJ6Vluup9Q7J3L7UDWlHeZhEPX0tnXOEmaN6KZZni2+YSleG5TBFfTTVYEtmg==","signatures":[{"sig":"MEUCIDu4VViXylYdJfKIo0lWvikZWVOGc/PO3XrNJowfz3EYAiEA9nyFAL1Vsz1nh5D2Wg4HnoikU3Pw4EfIk9a0viYc5wo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":278042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUMn0CRA9TVsSAnZWagAAvyIQAICMYfEV19l9jvJSJOsw\ngrJ0y4F6EM1LjNc9BuF/2Ir5gXjJCLQIzDXOGj8XtGX4LPf0hwMNgvRmpazk\nzJPrY1GzNRSytterOR9jLqpdoYdXYbBacTliX3LQD1mLkRmbU53Zz9UL43o+\n5j2LsUDy6sLOfrNzvBhweEGbwGLb8dUJa6NqpXRdXj8POOctdy6nSE204R9u\nyxZTdN1VEjC4tcZn2oXChlamOQvTveGS8xlcNsFte8pLDwi78y5bguFfOSJj\nWweLyEuiKiaZozIcGZWiOZQqW3fwhNKiGvyMnZ3AzV0Z1dx/vxC2TNQT5npS\nLPqUbH8vk8+zQfCkSPUwpnefttc5GObQn67ZElH4Um3bm9eh+2wzXNIhgAwQ\nKBjjXn8MAzkN3yQ5+dQhgzPKVk1eWUf8uBxt/wpjANZe/0cDJQJIG3xZaQsb\nunL0CFevm7nZDbJvNmI0rr9UlBMLmjnKoK1gbD31rg9IK/DcxMNR4WI0goK3\nuCQYnjMnhiSZnYDH93ChBeFcixqVXYIGPcSN7ANdXc44MKQvjjSi9khomJhn\nmrfM4hANivc1fjIgI7BpBgW0ir8iiHx5C1D8EtnWa2HhLFNYfEbjH0fMokKQ\ndD/Lwwv9yq1JrFNC00SUR49XH13YXcIM3om+yq3IvQ8U/QBUhBuKGKBtKclz\ngcp8\r\n=ab4Z\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"eb115b616eaa6f1a69c5c0701bbb8dd99e0b4dbe","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.2-canary.4+eb115b61"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.4_1615907315715_0.6152752945784232","host":"s3://npm-registry-packages"}},"2.3.2-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.5","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"140d4f76b217c8f47e7ca392d1f9bad52b285a42","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.5.tgz","fileCount":94,"integrity":"sha512-E0EUb5n9BlmuhKLr7zxrkrfp/2Xju1lZ5rF8GC0YiiM/iSm9B19LJlzmLx3Nng3csQ7dZ0Zc9CsU8A6Q8Ihk6w==","signatures":[{"sig":"MEUCIQDRlnT+CkzB7x23XRVKbIstwUDE4CK1RqT8aJbB3iRBRgIgTioWLK+ZCL0z8KP2/Qzy4XxywbBRa5NeY2GZnsXQZV4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":278065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUPN/CRA9TVsSAnZWagAAdpIQAJN5fq76LpTkHusKTANR\n9jHxlS7/4KhkVND0vsYgF8x/yT0xFzT/bRvUz33E0B1KLLAKxv3fKp7aum8Y\nsC9Ph3/GifNvNDRSFA8msrY4SqXbbd8n5lovAPwSsikTNtRAIMj7diEfwdVf\na4J0UnvcC6OxYcFdqIMP7SSfDVq2loSqPfiTiS7yP+pCYkeZ4JvYSyIwWLQM\nbEOcdav18oWRHnOvl1pz6o1SxJxO3kNchjVgqHta9J4/oCiSTKDs+ZWaKdSX\nsH145l+ap6bqDpVDeO4wf/TjfwBtzoW07Iak510XtmD84EjXGzwbFoVprDpy\nNViIYmm3nVCiWSJu16dxNGDBDqRTnFD/UiT9o8dhlUpLo5XVLBQibrnin/85\nW//rXPS14XBpbPisi82xO6vlU99jZTkKs25/Ae4eoSgydykZAMQX/l0qHKt6\nBv1lWkP6Nrl5ASx1lUc2BD36zoQFKylsvXetmdg627yPm15rovH+kwJpqhGt\ne+ezG43wXA2AADbGEYomFpNGxkYZUClXF68xYuo14FeqGtO4N3OR1FI14BPt\nBp3pB1fXvtCeadNR/c1xJZUgJ+MaKB5Hlcm6RDiT7u2PVHJKWtFZncfxWFrB\nv5dACLP85ch23qaGo7Jr3PkY9+vTKgEgg4baBpRERvHDg7/bDOI0HSXrdiag\n3Uli\r\n=EiaM\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"b77dbc28af621190173e7c82e0e4295abc047109","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.5_1615917950808_0.2136280170931526","host":"s3://npm-registry-packages"}},"2.3.2-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.7","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5a390ceaae3c2ca6d1be0a1892177f4524a243a3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.7.tgz","fileCount":96,"integrity":"sha512-g6Ze0hSrfCs65THjmAogW7oFdIXWxypHUlxqAHMlK8KUOdzz4hmIIJihBpaedjgrH6UgwVk+VOF8RTh5GsRuPg==","signatures":[{"sig":"MEQCIEC7VxjfEZQ+AKzuyOyAPgbXLkXRp0h1jJEAJcb5lZDWAiBCXwtSZPl8ja9xSylBLVlQvWeb2a1yESKTDt6umSjrSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":280218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUU2DCRA9TVsSAnZWagAAxOoP/ibZXpGAozvYVyexOlja\nUCUYl22H99VzH4iLax7K7+GWoqX8D8oNfDbDa+wEp0LfgeJ3PQs1D2WaYxck\nttICjfHqkexbLuu6HFd7C9mMpYk6tyRZ2Pg6t3DYgfBjN7nXHogz9AptAY3U\nUaJFrc2S+GxWgVXFL0Vbk7U+eOg/z/4/8dxVezU4rkyw6A2nLNdgmV5UTkx1\ncsTJR9ZAwpfZr9G0yhEiU6Rm4LXgzD5Qm32D5fJJUSpgl0SyKPMwjNBRBQVo\nbxXy9OtxtMK8M66tKGMYwwASQDFPqRFIKql34xt2OQEMymnIypIHCjeLEIzV\n4VhoOsnBnwApr8lj56XeMB7DZfMWZqfpLoTK+F95y4SIVdDaI10J7yh8c2tW\npa2+cV+nLNnfeAbNW5W0I+rrAS2e6cwB/NYtDB6hgRxBdreYbJGeHCchA42c\nv3Yi8B8aCJ+VLOHGPRtG1o1/qQBl6HV6ow82X/0gPA7MuqXBKeyXOhy2QFRx\ncTWBlSSepAKYnvqCm00XdfMKbhWkYZpDvC5LR5qjxXXq31rEmY4OnklCMc7T\n5MWz7lPU8WZBRgMdqbWJaOHyAl8eLjtLOoiZKboUDMJZtNVL8CkvakbQhc3C\n9EIPTyseaxUlNWGAI/3GYiCVKhXKl67QdP3tLHfF/TL84QTTES8wQmg8dzRE\nowh6\r\n=of69\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"671b7fa85cfc9a44adc8f26f9991f539d2358528","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.7_1615940995082_0.8099884870202594","host":"s3://npm-registry-packages"}},"2.3.2-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.3.2-canary.8","_id":"@apollosproject/data-connector-postgres@2.3.2-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"748dd5f09d69c1844438daf014844df261796e4c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.3.2-canary.8.tgz","fileCount":96,"integrity":"sha512-cj6IBxEtNap80EVGjXCYkFM0lNVJkILuw97eD+jFVKcQguVRkZ70ulH+diXy2axKBZcraIWzOtUpXZltuhm2FQ==","signatures":[{"sig":"MEYCIQCHCjEQZodvVJM+IifxIwOfKV/JxUQY9FWG+RKAKaw4VgIhAIE6HeWOrNOE/V7vBtP+2GxWVHVKD+Kim5prd6dSwQ7g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":287996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUhMvCRA9TVsSAnZWagAAECIP/RpwMtWbbpVNZPL4+21F\nF/DO0FAD+4lME20fGemk2PiFGbCbyRDCPQaLol0GgPiIi3gZuqYwoiUjEQld\nDsCEBrbdyU5471t8OiroE2HxdfJvfzHS1VvSGG9pLSeNl4Xl8wb2O2ra7VMz\nDa3/dfoUri7CobzV/GiJd/m0IE7ywvCJCyRnPP57KLH3+RVTgMjWVhb3sFYm\ndvhLpQ+GzFGByI5rOpofK3SvrKc+sQ8RugtrQm2hegmTe1Z0ku90nhkVPzFj\nSY9u4lLCryRcbQUASfSk1TNgoNnMUGPAcpDbd7UI4xElG3B1rRlIksvRTwty\ndHODSS7eFCxnF9eHr132I6CK0lecWOM8vgBCPIsCJs82NGIvOhNaLhBUoYYW\nxhIsbB/pxfc7k8DFhKktoazV2txLrQugq+gE058TCFVukZ1tsHAsFslki2WT\ni0sokh5u8Qf+N52ps9IAs8WSq6fTFEW/jKSL8l1G316w3zfzvE/CFH50fsyV\nbw5R91i2aeqPV8U2AcAN1NojckcfuIZsg6OyO11h+vlmuHIXOtzOf71cDLmB\n2NBJoSGxEaSGtb4w6zbcyI6bliIBe/L0lCpoBu8cDw67lafUIperXQJeA6XZ\nvbrxTjt9FWep4FnE1fg+sYYSg+P5Zhb5KDTxABwjyrt9RI3M+LDCcJJKKPzX\nzUu5\r\n=We1d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"d6360a49fa60d34b0dc1f870b16a05458b8e428a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.3.1","@apollosproject/server-core":"^2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.3.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.3.2-canary.8_1615991599349_0.9302256349288034","host":"s3://npm-registry-packages"}},"2.4.0":{"name":"@apollosproject/data-connector-postgres","version":"2.4.0","_id":"@apollosproject/data-connector-postgres@2.4.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9bd16d803dfc76e37742c771d4b1b5b1a98fc415","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.0.tgz","fileCount":96,"integrity":"sha512-0NlQp3dy0flYMv5sZMXKDkBJalxZVjXKCg1z2ysX7wFOu9cPB4bVkDY2/Z0CMUqrOTRTgDthSZD7yj6dMqo4/g==","signatures":[{"sig":"MEYCIQCvIqjNA+Ya8M2OV3JrBPN25g2F9rYNujdBFwfoxAwYVwIhANy2NZssuudeYZXMIe7OcQOt899+oXwMDnAkdGi0dAHY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":288947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUp2TCRA9TVsSAnZWagAAm7IP/1/phFdaJ2zH3YXJi/cw\n9wHWQigIPQPuUam82KmTjWbBUZr1+OTM+b0BXoNzX/K3+6w279zQmpWHcTru\nPbuc+Qmphgm1I9tWHFROImym1WOeU5V+xPYWSqBKQ6e+yjXenpdLd+bsvgaB\nazK67Cv0cJzS2MZUu+h1dqc+v1pUkZ6nGgXqFpnsziUc21QOonMFHvFDkQx5\n4yd3E7sYpofNeb4YL3kGkWcem/QmVpMWd+OsdP6+6vC3dENDn52+GcSlUCwB\nfz/ToknFR8F3OaHIe/1hD2vG/PhZZB0oXZkdSIpm5fdcVeh0r/Ywi5wSgkaa\nso5ftqPMitjLQdnGb9yADoid8fHYccL6h6mhGIeic0wgg2vce83RfBi4ZwfU\nRCPnrdp70Mmwp5VutulbY0k5gwfWwTdP1C6z6OcNcvOeKD9x3cZNQ9YyzqZi\nWtxsCP6NFZ5zgYJ1Aekrg8az6rY6tSRWKR9kFNdaMC0ozUdAUAAX62FIPXWe\nHzTZfc3qx/GUyJTtKHpm3HobzixO+kIY5aDXCYnFiTU/9KJV1HxsKuPFhza/\nlwaJL/3oe+5gcWj16MuYvzpx2t2Pl8RsHS21RBp+Ws39ML8OfAGms2q4Vczn\nIvi22cUTGPMLLu9AQ86RjmhtZl/qdCyDQozKQNV21LC2uCnYxGM3Foak+eqz\n8vMa\r\n=BJI4\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"456175663c8003f2751dd362425471aa1c64eb96","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.0","@apollosproject/server-core":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.0_1616027026828_0.9589495080613795","host":"s3://npm-registry-packages"}},"2.4.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.4.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.4.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a130c50e2f0d566fa0b8b2ad07c7c47c78b71615","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.1-canary.1.tgz","fileCount":102,"integrity":"sha512-+9Q7DkijHj3HMD//cRT7JDGMSRyO6xPab5xASu/eHFhqgI2U8oLj7bmaXaATF34E8+H/gDLvXhSnjMMBQyklWg==","signatures":[{"sig":"MEYCIQDzVgu+wzAgBje+Zz4OdF9uChb6il6Sx6QZt+h3yA7g6QIhAKg2EXhEtOg7U6Pa2LvDjTfBk495WTBcjydSdlXq42+S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":293400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU3aeCRA9TVsSAnZWagAA1vUP/3fsc+YV3RzS6tK3kJZn\nXa1del94xMjy1f7Xmnhqyb7XLMs9BptDZcsL0z6gNV1wlKX+7+ERsKdOD1hF\ntVr6WdYp//BTUy0w6SClvY0q9ayS9+dc2DsmDtfgAwFWgbXhWgPnPr11hT1v\nkP4Pi289p5lBUJacEg0RMDQr6HBLrv5VrD4vZc9C49f3/GKbYMfh2x2mBR+I\n1HVwqDrQLRIMUv4IWaURq1bAyvhLXdas3cpkInY+9SGSp0TnWCWgyrw1rfrx\nRD69FFPhCqrmdxUH/tzsk+4/5uL8aT7mgScPWDOyn7T+63e/C9Vx4sBGf83J\nRG9MNv4zlQnNEOKR4f26qliNmFE/09/S590u6ZkLLVbv/cjiN7BUAIXpirAT\nwSDvfPaodwmoIXN4jmOufD3tDeSYAHhk7AyuMJzekJC+4h1lu7AcnRLBlIw1\nlYhGdVztTMtn87w0ravhZwq5UQXe07Pfg/2lIj+DKc136p2EkX9JSSnTMizn\nA+VtrOq5SI6zf5KRECm65XCokYTqC5Wi4slcoqsrR2TqWgo8mtBqbo4JlhYF\nEIKUyXevVHGP2JI9f7QOY067KuYTHQHgzf1ArHyP2Tde+2Dbs4c3hZeW6HWe\nreEH+uh79wLq8EALFzRifnFFnVzQcDzcWzmAvTm76fljanJ93UhpcIjtAFAe\nFbSp\r\n=RZ5F\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"2a755fb13ad4a0c0530673132c6b53f2d85a2987","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.0","@apollosproject/server-core":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.1-canary.1_1616082590306_0.6686360592331193","host":"s3://npm-registry-packages"}},"2.4.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.4.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.4.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0d1a785c6f3fdb85ca082690604759068d8b0a6d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.1-canary.2.tgz","fileCount":102,"integrity":"sha512-IxcW9/JDqNhcv2or9J8Z9Swn3Z9liLyI1GDQ6+ZoWnLfFXjfO+kqhmexjVebqENBCsvRygMUE01G5eesJzC6Bg==","signatures":[{"sig":"MEYCIQCrxKb5Z32E0eX7xDEuDVvDD88/GH9TM4FuMe0xJikdAAIhAKz69Wc6vYaDZgGiP+CTPscXwU7F7ltcknFMLA+rwgT6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":295230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU6wZCRA9TVsSAnZWagAA/88P/jtjmukKajY+d1xbpCUO\nbiij5VLdvb/8eX+aTNj7X+5x0eeygpK5bp68lTPLhKh0A8urSXG0ezTQqWqA\nmMpqGckyA+b66/sdnGJHcj0qL8YCCRnWjj2wb6rBh0NdzWw+P3DkIZeykEkm\nzdS3MnrIoWEWR7BANNiMpsGhG2WHnLSpFoZ5wfsY+Mr+4pkiofNXMTIFXun2\ncpePRagEdq526jHVP/RFU5ycggEWGz7yLjBXph1HUX5gw5AQ8R+fXFtcXLc7\nOy5l44TM5pAT4e1U8IjCVZNr+TkQa0jxHuXrrKer3Nd+dcbNX3qFfcR2qutU\ngx3cvft5vWvPCQc2ZOFQDfBjUosUuozTMAF/KYcnoa75oy4xd/bQRMri9WmC\nkxNOTv35t5vDp0997ZONsz1eKWt9hvX/uVm7Y8ABbKG+N0oOosL+m11CfwPl\n/0ViQj/WMHSxR+YDNsSXRNmPcK2UU6O+B/IwBWMCGcs3zKpMjrOUlWIzsyUe\nAZfwA3SIGmH+MzOegA3b5RG30kn8r+E/3AP6/y729Z1c7fs74KWAEpCYr2OT\n6U+2z+eJAGa5sPX27/rvvkmpFQUWbxui4LkO1bKTBKgm6WyrLWMSs/7MkUvF\npkPV37g+fBFyseTG1qXDIbq8zYJ1843nICGAtkeSKa5Wx756wq1Sq7pCLo7n\nuf4c\r\n=YTxK\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"a96bfec991ba1f4f444183d40b525b89063a31e9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.0","@apollosproject/server-core":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.1-canary.2_1616096281216_0.3785819812093636","host":"s3://npm-registry-packages"}},"2.4.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.4.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.4.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"49befeffb964177ba41583f625d79d95ef0e1d6a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.1-canary.3.tgz","fileCount":102,"integrity":"sha512-tc5Z/7o+u5SmVoBdJqMjp6LAGNi8arbvU62AlTfGtQCNaXJw2RsGo+3ZlLe5ItAMxuLCBdRFcrQAAXHuaguonQ==","signatures":[{"sig":"MEQCIEbkMpZuoxA4se7IU40RSpajFWe7BiDAnsFGuDkfxs3iAiA8cLBom0HwRJLHFhNP9SpO7DBeYyo763L/wz5pf58tCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":301314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU7vbCRA9TVsSAnZWagAAg38QAIyt+th8wHRkYzNqQJIE\nrlIS4QeDQ6//JiiPcOlSptJH8Xp5fjce7H0Kr4J808bTk9AmSqTTNnp70800\nFveaNwspOwwYzp84RPV4Uqu2Z0z8NiolEka3zK5O3JUflnS9BKFURTOimJT1\negDo3f3jFHoecmbHhLyxpAsjjD5Xv8rKso0PM61ycAHPsshxOBskIatcXmHE\nVGzsJSZrWWKMDEImJOw0aiQr1VxShhSXIm7wQqtWefEL50+rr0f4NRUBj83O\nxvcLNO5OI10uida1zeOZt24qqXLO6fawoqe9nZrQs3T5BsgciQk5/OMIrnse\nGh+hWzAkV6eH9imJucuTUhNh/tj6Xa3xHT+zWChagPPz5OJAkp48EMoZAxAi\nXQ+eGdSBP+C0OjY/q2Sg2pMiIIG6BoQDq3NOBr4gqtvNh1dCQgpK1ZAm+zex\nlWMKfN5JpfW/by3CUzJobXdedGZbIcZqDL2q5NG3PRKFKOk3fkpkLsYPjE1e\nk7UmM4z3YJq0eklwgFlNusCW3cNdieeHEXtFGk8XBsAPRu30RjenEZ64w3ZE\nQjS+7dBGk+fSq43cTqulGN1IouAw6jBHQq8BYXReMGCfMsk/nTmYhoTIYhNt\newCWlMGJXMBq/pMcYn/T9cxyT64/qO5Krs6FsD+dElg5mm7G+jpA2mZaP9Er\ngN4b\r\n=EfO+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"894c2a44b6cc7bf3a277dfa4c32faec34b545d0a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.0","@apollosproject/server-core":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.1-canary.3_1616100314762_0.2743527245330917","host":"s3://npm-registry-packages"}},"2.4.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.4.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.4.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"aab39f0e8841152337dbed443437883e895f4cc8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.1-canary.4.tgz","fileCount":102,"integrity":"sha512-6M9ATHfZ/aeYt972eBpdLDYG+fb5pA7qVpBAPSEBdHrzJlglSDb1TYn0RD0OjJIaoohKQOU9+vYUlFLY++Idcw==","signatures":[{"sig":"MEQCICzR3fMrAo66LnuAgmjOsgfqBfsnmTeZUUGV8AV3Ect8AiA7Bj85ch0TG0qDAIZJmC+VO16bRDSNTS3pO+36GYTTrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":313885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVqf3CRA9TVsSAnZWagAAIrwQAID1mUt4qOF/X8bW/ISE\nNMP9wXv3jeM2u12jkvtPkeZ/YF47UdH3OB8L4o13117cYlhZgC5tkvNMKW9z\nHA4CJus+O43X4SYt5564IDqC+24iT9IZll1yRzhQ89rL3b9h+7bHnwDR3xlV\n7TVtY6bc8DKHa1fpmeNAIACFOlZlv6PA7yBDxBervyuNIFHhxf2orgnsxA0i\n9XaAag29pYX/xaztPwAolxW+aMlW5ra9m6LNWBIvS+df/B2GnexhQxaWn4Vy\nuBKB9PsqMQGLlXZE05REfW1uR46BGd9+t0ZCvVNDQmJg9eoUNXh6BmIIN9De\nzJu7wY2WB4NGHvEQ/VHOPCb0ZJkzjwySYowQalsd0g/3zn0ZlJji993KDlJk\nxfACLdvBuvR2Uaz3MRldORfwwh/uMc64IBnf7UqeqjOSsym+SbAp119yhVl1\nWgvTE7Tx0ORRieYNSg8he0WQ7qbsP0U4Ig85rrpZ0oY0VWh5T421PP+Dem4Y\n952Znbj8P3mgJBjcwGp3gs5k1WNR31LjbyY/3wBX8B27iL/l6HxBY2Iga/mo\n7jQEM/mbpngvKImR+nFVOi1q2rIc4LhozPQtthXjZpM78tCE+eEY990bA3MP\nOPNo791sfRtfF+B1wuPcWaxo1ki166P7sRB84S0FIncd9Ev20sSK8CA2GJ2M\nZzCG\r\n=xGVK\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"16e35562198d9b0049e067075c53f9f9aab0d25f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.1-canary.4+16e35562","@apollosproject/server-core":"^2.4.1-canary.4+16e35562"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.1-canary.4_1616291831002_0.7517006369821604","host":"s3://npm-registry-packages"}},"2.4.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.4.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.4.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"20d9c348abbcd90de4f029a01405a172711e1118","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.1-canary.5.tgz","fileCount":102,"integrity":"sha512-LVHVADR82MfQ1VcpQTnlD/VXm4Z6ZmXpR8rv8vDPcHafomnZvcp/mLf+OpzV5kDrUG8G/gWubvtL9YbBhr3G5w==","signatures":[{"sig":"MEYCIQCFgIfKABAM8CXKGCoDYHEyH1QlDcXryablIPN+MZ/yiwIhAJw9ppCU4rru0lSmzyOWLimkUKsiZC/1aLR5urGvvRdU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":319918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWL2NCRA9TVsSAnZWagAAHWAP/iT57PyNz4H2/ppsJbVM\n4v5vTvlWVL7wkfSEgOZt1UhkcdrQO29T0bYvDOtObjSm7a2jspGEtJjz4+k2\nLBE3xVPxClMHzd1hWIOiIVuDNmU5ny7Wg4Eyl27jd/QOigPzLhS9488UWD9N\nS6K8r6O9vlhErHCvp1QDFP+xmDNWP3/owv202Ny51CwPip3ilCLgt0miQUcA\nYW9c017M6265EHFaYxTvmMdYNcVocM7T6aVaBTLf9nm66/xngoB25XQhsG0V\nmIDkifheH+tVCxlfJfXH6YKZBD73B3Rpc6SxLheew1MD0skVzx7ygJqpx6qn\n8ndQoiLiiFI8Fm6g+qw6T0Nk52455WzzuD2ZlXs0k0TVZ3i1b52tsvhRJoQz\n2/0pT16uQFFcNbAqbjhQEVnwWdGViVdT7O/T1EC8yWgyAzmd1pzCb/8Sw4+0\nh4rrope9arNwp6cL4VVQNdheKXLNX4i2jUmLdZdmDJHRgHktI7k3bTsHfBNr\nMOBAwHFsSmRpG/8BNwqFLKMfskC48H+nX7P23KiJzjelS7edOvQ8/MnMh6cX\neatBOfSJBr5P0snzkljpFoVwZ/UrpGDj6cL4/VwuL+A+2SHvARyB2t3+3+D+\ncDV4Lm5kZkdPcHve5m0QgL5gBw1PSN8XT44sll+Vpz1O7ZlvukZerziIpg08\nXB99\r\n=Z+4j\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"19ba81b0452c19275918fbdc251425fa981a735e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.0","@apollosproject/server-core":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.1-canary.5_1616428428735_0.5816542228579944","host":"s3://npm-registry-packages"}},"2.4.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.4.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.4.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d4c1596137cec4bb81d7392eec562a9cf5a250e3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.4.1-canary.7.tgz","fileCount":102,"integrity":"sha512-oxCWeyvBTJJOFumgBhS1ddLKLejH+ZU1TUkJzs8ax5zGjHA4Vo+Gs7JSII+4o1AnSCh7MrxK1jlOSkEwVKcegQ==","signatures":[{"sig":"MEUCIFvHipzWgBVb7r6ngtKZ0L5o29wyRFza2GryKZ7T+TVJAiEA0w0qj9kuNnjw4J12JKq2SBwR2IoYKPBGRr1jU/LkwbM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":320086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWNrfCRA9TVsSAnZWagAAcWUP+wT8dc8VWYz3IXV40kEs\nuzhtX0ARa484H1XfG7hqyNTQ2NLRPKawycsTC8r8PIttPWoD88jOzW8v3uEt\ngm7qt7KylJwOJjc5wNRSPx/0lA2qTp7cWv4bK3S/GCOdvvK2qjpQTpjPPr5C\nFZ6uh3KBY1Byeg1hjacguRg1P+7QWpBMQSksHGs8oX044/Ysa4c4ZMm8SK73\nd3fWa16E7IQk8EDRj0zHT1Io9d1TEKxIbCLRVuq8jZOas7Iprc1/ulgPbuSb\nN8kiVdR9z3xRuyV1QzJ1+wvcqTR+a+TX3qkHUh36B32u7GwqWvvQsAIQS4ii\nTg5p0XmDuDxUsCQ+CaGBjL3YgtoBNCQWOFofChVjQf0OoF1BhKzUhpg5dcBe\nH17hoXYbzPcwTeY0a/Z1tYvGhXWUoO/JnOQ5MVCiE0QBxI+G3Wa5jL7+Wcx6\nsTvwxPRiGbwc9N41F6cTyC0M1dCcqaxa+kchxGNKikJ1nKvNWaFwlmIhT6LA\nwlwlUFHOLCHJfy1Sh/8R8BHfOm63pic4Jj2bZaWb6p0STSuzIXktMMJGdmlI\nDfenqrWlESpmf+OQ6Z1eY6aM6rnSykwG4fE124YNvdxkIfuCmnc9hCShou/e\ny4Gi7zT2vkAdZYaX/1zO85ENr37Skr3SqtdeyKCXESzNrWtRAUipuMqWoOfL\nnVKY\r\n=AF+z\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"4c09ff0382c60aa011080407de5a6443d5b35db5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.4.0","@apollosproject/server-core":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.4.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.4.1-canary.7_1616435934894_0.007037532866222884","host":"s3://npm-registry-packages"}},"2.5.0":{"name":"@apollosproject/data-connector-postgres","version":"2.5.0","_id":"@apollosproject/data-connector-postgres@2.5.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"036c8918a1aeb182276d9e845c9fa64f210b8fee","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.5.0.tgz","fileCount":102,"integrity":"sha512-PUOwxLNPwflTGlmdHJr88VxyyJi8VNiTFk8dGqhbtlJ19DGS0tBmZp1vGQzInrHyOAqF9DgRUhsqlwvYYv2qsw==","signatures":[{"sig":"MEUCIQCw465C2skS+kReewnFlAfnJ1gurcidvkSj7FPeiI9u1QIgX0fYp/tWC6oiTOvRiivCupWA/8y+U57b5omKSLjdUzA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":321001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWOkoCRA9TVsSAnZWagAAJCsP/0+OWIWwgwe6F98HfMLn\nqm+dqS6be4u3HPXWbX5c4/nGjOhRaGmuNHLlE7qeEBMcgmh11QBHVbadGGnX\nPJRI49L+2A6Nnw/Buv4Vl6nAFLYgtXxHx+yUwRa8E8xtbIu+x85U5dqvBTF7\nccU0uOrQgh6Eaw2Z4MBDapKLp65knwB8+yTLCfm4QbtkUzrtjAgd9nRrL+FV\nDMxe3LE5Ov3RR10p664iNTPCIwmpq1+Lh001u/cGyFHgZ9Ao5sk0YuRLAta7\ncIFskXK7QtWZvlQYO1ilwmszm8xLLiypohh7DrmBd9Xj9uhYMJ2xtIBIObuc\nVkdppExfyrldPIMqHRIV6FDGsyFAE0IeJeDLZ5rsvj/x85Msa4TJwL98O28I\n5zkFiIpZmJQCB+MPOOeuctoDITniOFKy8QAV+J+AB2p/JoeYyQkh7gTvDKnH\nU3avpiL9tMhX9LDh2CwahY8Kh7f1y2bQ/ztU3paDKGyBqhKbLkUAEyBpxIok\nZa0gwvwS4wQMmTN3tGGoKAmMMWlRYByBm87vBeyqNp8N1BejkZfAJcfX5pQc\nLDkxo426NNfBahhJAnEjQXvpYeuc1dUlWJVKx4cviKZPDFx32atXe5rvOjhN\n3UC5ZtaCr/Wh7BZwcwOEvJPSkn2azHZCXXHZ45gVLqoDLfjGs/Wg+8c/qd/P\nMp6F\r\n=NcX6\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"a242b98bd2129e3a3edde14908dc817930a29475","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.5.0","@apollosproject/server-core":"^2.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.5.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.5.0_1616439591580_0.6314119811350332","host":"s3://npm-registry-packages"}},"2.5.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.5.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.5.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2481183d15e957db4d0cf25b0e9e78ee72e7d37c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.5.1-canary.1.tgz","fileCount":102,"integrity":"sha512-tbm2c0wSz+irsTpOxESB1lCIRkWNJNb49h4rLR7Ce0wYS6poLbq3AzBf97UEFkil6cEIQcQAiWQa+yuc31eOUQ==","signatures":[{"sig":"MEUCIQCu08lqkdlmiCEjfDXhW/wpxGs4+2QJOjmhcxSk0jbmrwIgcBw2Yq+T6RL0O7Aza889zgOEhsGkSwGHaak3S/0sddA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":323305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWgJVCRA9TVsSAnZWagAA23sP/1xCKbCKS6n23NqlCtrL\nd9xm6o0HTDwYjgaXSdXhVrbnMHRVjfm0ts3smmziTe6nZxHivP6CQUDsV1aE\nWdqL2583IGfqbyhu4AkJnuRLdtqGtO/AWTy4/cd+g2vNdRSadRSKu5Th7fgK\nrA9ObjmdA4EkR3qM7mmqe0tHLTAs0S+xhyBIIv7rvc+DOOBUw84cdAni8vzJ\n8LJ9+Dh3x0yaAPcXDUg8lHBs8n1ZIJn5zZ+5dRZMkE99ZH3b20Zz+QVMgr7Z\nHv8ePV8nAxTTbgpELpSC8Z77uDnTzzgCJHbZGXCKqf9T3ZFVZejHxfQ9Qn3A\nYsD9lAKrWFCV4+YrJF3XRA6Ci8/HkfmYPyjiktG5hDF5rSmsMLN7i0KtQIVc\nJP49l9QaGTkYZHloGRZGJ61kTPGoix65U6i3/0UlGByOW0FxquWpAjtI8t6R\nL5p3+W8Sm8EoaFrC7lQBOVeEcTSVSQXHN7YUHW9dZ6VE33/e9j9zy4aGW+Qy\ndglFAzlf+bZSpWjP6wKU2D2XZLukv/zeW/Ji0zZGmUqnBv2pXTw2G4k966X3\nxjJwD3Slrw5pTw5rQHH1QmZH0YgSv6bj1ciBM/0FHv5ITElmrWp383g7mXlT\nAshRXxqiBIuQ1KcqSTmIgyCKbwuvqr/05/sRTjb8O5qkzpf/aCyA3VlhSw7a\nNczH\r\n=c/YI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"d4211f7b6f14c6a2034a476bfa5169288299e9ab","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.5.0","@apollosproject/server-core":"^2.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.5.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.5.1-canary.1_1616511573176_0.46034030600545406","host":"s3://npm-registry-packages"}},"2.5.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.5.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.5.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"43f7845fbaebaab60b7a4bb51c499d33b44c8c8e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.5.1-canary.4.tgz","fileCount":102,"integrity":"sha512-6HSJ+UoeT7qm4NfYldsE1ilzFd+UeHrOPxP8sodnr+03YzGVJoQ/ElGf6CCgCGqkw2/yLVZ8xRvBvUDPSYhUsQ==","signatures":[{"sig":"MEQCIFZYSAZx3omU/QwslXcnlarrhIJkGYXteaKdfLecRoKpAiAYESW347BlMSNUN4FrNQ9wmyflbqgyNd7YcfJu6NWCIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":328617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWlKuCRA9TVsSAnZWagAALDwP/ihTBrucQ9//wdc0alQZ\nZybZMY7tU18kncVYPbpdPYEFd7kJ5LRgQ4vHlt51nXF9On8sJG6U1FQmJy7l\n5IeGPYtMLF0v/bpLxhFwSdVsnvXatEVLfuTDMSGxJtynenU4PxwdG0pnY8Sr\nJY0/7QwOmurUHRnLLeLtSQBRmGMXyy3IPGMvr4lczhXEdEFMmM3HMn7aCNQz\nOErU72iEev8sQAhrRBS5TGI+Rt4eXtKv5TV6Z7KnOajmypCIYvHN/BCaLIB3\nANGs+Qlcy371GViFO33+GqkK2hCR/kCT8TQTkBk38UFWegfEW2hxN5yS5Qaq\nscOxJM+SNWes5gJ5YJf5sHRCTU5MAOqC+h2seXHdEFA3rISa9KStZDk4g0gv\nlq+2yeSJZz0NTQk4IC4WJcZZFBIsolsy95dCk0hTS/UFoaUinj/9PsahPmzZ\n9d0BQwbjepE6xl1DHgXDey0X52M5VsPN8k0Jadr1ULGc4StSO2CiGYb90Z43\n6tbV/eRMqBw8Fz3c6v7rV70bm/KTDSI51jQMkQEceb8egYB7jc0V0P6cinyJ\nSJ8r8W1ze/vd9OEY1M4g+XAnXeM2ZK3l+PY/98ueDK5A8tfB9poNnQOjW0Tf\nC0Ww9QsCdeYQqVMSr+e/I0D77UbipsndGadS+cJxV3mzwBF7+TWGWcGQDkUd\nGUXN\r\n=0JR2\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"35993404922e8d9ae3bdfe275a6f2488f1ae2c8b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.5.0","@apollosproject/server-core":"^2.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.5.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.5.1-canary.4_1616532142524_0.24239002211040184","host":"s3://npm-registry-packages"}},"2.6.0":{"name":"@apollosproject/data-connector-postgres","version":"2.6.0","_id":"@apollosproject/data-connector-postgres@2.6.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f10f0d477091b65986d6b784242962ba59ea7098","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.6.0.tgz","fileCount":102,"integrity":"sha512-jKQxk29zHiZ8FR6g6BEDZuk+5W6zenVNn8ANXH0J4COm5l173ly7wrhT8ESrBQ8nvJaOjnyVMsOkTQgBm9iGBg==","signatures":[{"sig":"MEQCIFGeu0TuI9LrcdGAAFw5FVtszzVvMUuZJAeAh+cY2AtnAiB7o+qjwhvzj/fNOnREQbLe+BoiaA8QyagQufLhEKvsLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":328945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW5pKCRA9TVsSAnZWagAAyBAQAKFtkz135etk7Dh3Grl2\nRrA6qTDJZLOViGqVNrYdo8LuagpMGOAOqddni9dRhEOnLbqRKyTp+3gEKday\nY/Bqf/J7tUB29C5ybyVsbDrH5YbGTsAY2gPY/BU06VvUHeNOGvCLPdl7U0HD\nLgTROwq0IMkZ68i5icRdjZ3aWhuNvuqltfwd6VUeBt3P7QcgeA7mgcN7AtA0\nQh3JJuK3JUp9udpKIE/r1NPtT3QYg6cHNDn801xPt3Ctm5kZ4wdR/MiGiovC\nLLbsKpjOBnqrLBJhEs7w5WHnHrFLzGLF4Cqp/0yDOjPgCLycVsjVhHJMnOBZ\nncvO2uhwWaP2Y+m1mI2QRox9ZfGDQLXrRqy5vq2/N/Bgs17dR9QVdW6ymTh8\nIijIz9b+QyeMTbfnO+s+sa+FtbrXn3Ik17+DqUbKgBe8hX+SWckHIm6iG6jd\nmHTF35tUd3QW3oB4sL2SmaVkIcJ1wQLnpuGEEX4nf8Gidk0tNWjWh+FrQPp6\n2PYIXcGMqDd67tWqlyokuxGy/bTMrppoKzJQG9ZgWcRcom6KvxOEUmhG6hSO\nxhA485paTPIbpvJBCbqW8PmICDEQymDJTrDfZCCHI5Gy7VD7/iV54xH7lvkz\nI3+3YPWtKJAP9QSfoIu8NM+zbC5T4bhD1CUD9k+Rg8/S4URRpwec5pvPPJn/\nlXNQ\r\n=5Goz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"0976a22383bad628124850d6ebb9d9f5cbbdc1ac","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"yungvincenzo","email":"vince@classyh.at"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.6.0","@apollosproject/server-core":"^2.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.6.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.6.0_1616616009696_0.931405228179851","host":"s3://npm-registry-packages"}},"2.6.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.6.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.6.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"36216f8223c4a33ffb2f554113f8b8a50c26e1fe","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.6.1-canary.6.tgz","fileCount":116,"integrity":"sha512-lNFhVG8F91wfJIHoD0i05U5ngm42LFI78VKjwDQOlQSCKsP+EG2b2HPnTqPWnFhtIhQOba31Xa/qr1TrS6Y5Vg==","signatures":[{"sig":"MEQCIAzGVndi3wPbDfY+fu4pX4eX4tntwZsxOuBLOYE8/KDKAiAoh64FSXBN1UHF5gNEXmE6MLQyjh6NpubbX6BdwNqfUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":382049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMS+CRA9TVsSAnZWagAApecP/0+GSowIgQJTngioJpeJ\nSl5BifXUNEITFwWzBQuGUZ3KYwC9tAgZOFf2Bbb8HlJkNLEckILKPOqonVGM\naEePEmksWgEADv8gS439Su1T1ruyvsb6amB0JMe/0Up36I23Edj6x7fPzIWZ\nP4TuxSjqDws6sg2Jmg1CXiCOjFGYnJlJ6gI9PbQfTXXJ2PO4h2OaVQYahA5O\norNmL+Nl6eiNrCgzD9ZXc6JWUyCRBxnAGMG7n/ZOQDDh1/vtazbgvoR4bZpD\nwJW+52hSeYkJglnhz3ncD3rOHaoLwdNGxRr8aduZBc9A3jWx24A4GVSVmfmx\n6sPQw4DSvRefa+X24juCY0y8iwWevrkGHOGaDAA0XQTEkUGewrJ3g6HROWlv\nq3UahlhEYPfgRoduJmEKbN0D4ThxJhUl3rrFu/rZu5VLH8c24s3Are+fG855\nuhJIw1KntnwkxxK8gJmtbF9DI8//CEcHPYPKICAjMbDsUZdRwmJR2swlFMiy\nX3LLbDQvO7hWBnC2R17cfRTcXCiuLWMFL3UG7uHlZRj5Py6LPm1CJDSJen9Y\nH/EW2MVxa5hB6CmE036jNvfLolHPMH9Gx1YLE3HSw4Jyk2kQcOL++lLWEWAY\nneJtbNtv3tbj9kQR9aeHAEjysGDsQe2QJ/etVTdHpHkfcI3pVDvcHZsopa8i\n0hhh\r\n=hWZm\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"4590af7c4299d3e7e0643b25385d82cfc7891ada","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.6.1-canary.6+4590af7c","@apollosproject/server-core":"^2.6.1-canary.6+4590af7c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.6.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.6.1-canary.6_1616692414103_0.8288389408002961","host":"s3://npm-registry-packages"}},"2.7.0":{"name":"@apollosproject/data-connector-postgres","version":"2.7.0","_id":"@apollosproject/data-connector-postgres@2.7.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"880f76361e1c8ce06610c1b906e5fdbf61ea2ac0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.7.0.tgz","fileCount":116,"integrity":"sha512-/PAjsB0ovCCdVRIaIIGYlwLpLolWllRO711QY62a5KTb3UC9ez3+Z0EsAUe9MxYELhOYm2lk8PU1OPzj/4VMAg==","signatures":[{"sig":"MEUCIEA52wo0aZyXKus5SsK/SUujv3aDK+C5Lk2do5o39n58AiEAwSpTbTVjYgyGISv9gEI2Keu3fanEDdtxaouz0rmF0yA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":382306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMpcCRA9TVsSAnZWagAA/ZcP/1viCXl5ss1hJCxXFyi4\nKatJyDDifVrHYE3A8YV8ov50kMhPvA8Va/O+m6SoOMCBMDgFFXzPtyvSwDEq\naQMgdzaVEKCXFqZXRutkbRrBu2mCZcMZfc6eHUaA1xnhOu2u0V8xI+UeHmKm\nySS2rnSwU7YHh9JoaKDDQsIuNf++0F6DqKl4nA3bPonKsLKG+UE7UVDUAi1U\nANh5E+3HiL2G63m5WJvLzX0BaeKMys/bQI073TP5v+xDm2jsV62/bOZ729qe\nvdTzix04G11CgiNSn4S5a4MHW7oxB9QBhZiZ06vVmocpSpAe3ynJsnCWEvXV\nZOBhFYzVv5C1xjz/DCPSqkqyHy/RDE57/a5b5a3CBImHyk3FRXfPfaBK0/zp\nwaeMBqt2MKhKXTz95I6zFYu4iVTUb+bVF5VK8MwfgD5YUb8o30wduOTxrbKo\nMsBslavBzpswdzr0ARWSvKkPADrB59/KrivNclDtbSQuqDD2wlOLMU2bP74D\nKx5F+9/61imD974sIBzVqVQ6gHQgkpp+8dvIMXpLBjjZiNZsHagdSV80i0ck\nZgXY1ONTW2tUssZejAvY63YLkwAgYispcHJT6wkoqYtzKinQ4jpq6AT8WmJr\nuyqE/1nZfpY9STEwkWMczDI9yNPoVArDn1vTvzGgVL0JOnCxRXaG/LEujyNn\nMQ+i\r\n=s/BI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"e0ca94fbccbbe278b580b71d4b415c8779454fee","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.7.0","@apollosproject/server-core":"^2.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.7.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.7.0_1616693851950_0.4336177377669994","host":"s3://npm-registry-packages"}},"2.7.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.7.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.7.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"15344fdba2a234ce07ba9b248aec54740e23ac7e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.7.1-canary.0.tgz","fileCount":116,"integrity":"sha512-knyu4WDSiIJErXuH80euMg5RXfD/xOWGNu8w4f46enbXX0K3tSBsBOXyrV2rTVRkKSEiz8wxt0U4Gt2yaPOiUg==","signatures":[{"sig":"MEUCIE0WGEtuECEBxMmxymqqcH9GK3MFKlKndyfeVPRYyHCnAiEAqFmj+uaWSoePyemD3vchhjoHR2glz+l+14Lr70auaPc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":382378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMrHCRA9TVsSAnZWagAAfb0QAJ1fvY3T62JbGBbZXAtn\n96yRIXJ87k7IzEVTaZ09bRaEZCkiiFLI//H3oqv8w8laU1ns94mPTlmhFZQN\nD3nikZnffxtGd+UVJxZJ2CwASfcdXUM/9+MV8doc0Qo+nLe3kjG5hdReFrt7\nGoZHZFY+rb5LjsEQgYuef3Gp5DSqHhbTG+kjlR+/rGOMVGgCbPh1e7a81Iyl\ndCbopmmOKvN1otutcJgpoV5RKFxsgM3q+Zjaych66k3zkh4djCIkK6PbDzp9\njf73c+2i+WqtR/z9qVfTMtnF8AovT5AgQXj9MlWniBv3RcHoZRdE+PZdXw40\nebHCQ5izWcgA4RZ86fy1JNKIeZKECEGrAmpGfvP3j79OMN88/3jR7vZatktq\nDbk3E8yRvh99nrNFTM2/ct7dBE6SoR35Cojnj0J0rCHXP0q9dR6MnkOiScPy\nSmdop3IsgLMPAytsOskCq2Wjw1yUKLzBclHHEk6RE1LM/xu8z/r+cm08abI0\nIUA5jsyvL7Ch5FgYzEZnYeQB99jcLZEpWlRM3nRezz5owGJDoNC1soPLmD9d\nUNW408PncHzcLcQ6Hdb2YXfIdGs0w/f/gkeScEQGBHSJuaacdvqXVYnXkohl\nZm4p8+P60oEiSCJCH4xkP8IDjp3SBq7fVqpbW/6NMAmG9PWxwLLOWJJe7Tq4\nztgY\r\n=XhIS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"e0ca94fbccbbe278b580b71d4b415c8779454fee","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.7.1-canary.0+e0ca94fb","@apollosproject/server-core":"^2.7.1-canary.0+e0ca94fb"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.7.1-canary.0+e0ca94fb"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.7.1-canary.0_1616693958857_0.9202201245472741","host":"s3://npm-registry-packages"}},"2.7.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.7.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.7.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2cf4bbe646884af9c3b2af9ed12462a01bede05e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.7.1-canary.2.tgz","fileCount":116,"integrity":"sha512-eR+TxyoLDndV6nDBYCfZwyojuleNI9RxkLgub4iGOj6SdA+MK1ReM3WgNnpFNhHCaDxTvjpbIr+g8u1oS8mNDA==","signatures":[{"sig":"MEUCIHwzstby2WHKVuwt5Ljokvo8iQ3dj6WQ9tLdwQWR66+VAiEA9uOoUGgPgGmNOYR6m4el3lTqr6QSU5lY6ZAccrNi4JU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":385868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXjafCRA9TVsSAnZWagAAjlwP/iwoy/GwBUPbes9yNu/J\nt4/6nEkhosOxXvobx9ngPoy9zU29li9uPn8fpoirHlnX21/yLPFL+YOaK9gr\nTEA0sSn00hk2vpxOiaRohn+O/zDZZtTnXqbJ79EUMwHI5iiPjtqyWRpIo2GP\nHvPHlTULY/N3s7zPtNj8mwWkzH4vkb1Is8WYQwTJVgN07ZhJp7epQv/m2n+u\nJkJbUNqjN1LuWwlfrW759MK94iQsP8pGE/Iu2w54/7uIEM1Jwyo70wxqyOVx\n7CsjdMdYUNaqrnmlkCEWP2gOjK6dgeathMYRmhJ5cx6bLaOuv1cmzrU+VYfj\nEykgoTKQqkxL3NefBb84/FU1WAwSykttdjivLiLuaaX8XOqF5wB1Df1agF42\najd+AsySvK9QMHuvpa68wY/71TddZjMj2DmoW+VTLWjk2d1sA4zoUC1aV1HE\nAy8uWqErno6DdORor0KAmQD5UN6aEofV2hAg7bv6e0Vpg9nRlGL486jR0ZNg\nxGNkVF6Fl7Phw05boaAjph/GJ4o8T9f2jv32d2VR1SORmdTmVMZCePWXTRfv\nP2j7lhWoYIvT9dXA1t0kJHbQ9aL+hO6hUxb6IjQ7mBP9gVxia0JLJHsZk3Ts\n8HlRBMeXeTir4jx56sBBkyArUMv7Mbt+kJAiDCj9NK4fWTBr+iVKglDxkvOf\nxL68\r\n=aMXc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"183da8bfafa7f810d77cd470f8f74ae8dcd688e2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.7.0","@apollosproject/server-core":"^2.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.7.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.7.1-canary.2_1616787102661_0.24264068626227586","host":"s3://npm-registry-packages"}},"2.8.0":{"name":"@apollosproject/data-connector-postgres","version":"2.8.0","_id":"@apollosproject/data-connector-postgres@2.8.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"92039688ca4dbb59633dfe25cd00a5fed2c783e4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.8.0.tgz","fileCount":116,"integrity":"sha512-L/2DDf+ZkfAhUa67oN/TYHEEMP+lIS158RKaQl0xckHu/wkd6AjSEoDiwthlNwtfEJqshph1ZXJgdDrHfEjODg==","signatures":[{"sig":"MEQCIB0H53bb8pyaKkiClIiDqFX5a6t1oan3kk5lkyBCbdUeAiAysAmIVGLgFEU/ej8tm/wEmnn9P9XJSPUyq8aedRsY2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYcfKCRA9TVsSAnZWagAATP8P/1K+PjyuimxPI9lK8Whn\nFyTpUTeict+qPpncjPFAXwE/Mgvu8WSq5NQTj9h1m+9siuC1Ms9Ivxvx4/Wq\nWGVO5NvXzqwSjWpw8fq8OIxyV04Zj9HXCs80Dx0MqcZI9Lvv9J6O7a8rM2OE\nxYLMs5VMD0NZ1upOP1fWzbnBWxyK5E5wtoTVtyxk2T26MIYNhnsCD0LmFKET\nK+Zl9HGFDqJzNzFmD04iyASCUdM5V7aoMbz+lJkZmDf84Bd+VuyoyHybwtoD\nOHyX3Sr3tP32jJbDWGZYwilFGylxMuSRlcT/jiOAD9wvErFbgnZp7X0ExF+7\n/WyJJhS9ExmRY7mg4y3KNteKoKhNdqgCoeV5GVBQvkOW5dmjhFk2FyOlM3ch\nfRhmsylc/ZlAztAqUFQzGpH0HYfjPB1MDDrlDfPz+EvqLxiMT8kO+WH9wbMl\n+b1fwpNRMtfTY6AeDn3+spL77cRznNqUkUiF/oNPEL04t5tKCqIG/4XrckL7\n1JesX6FBfqOOflDvqRW6rrWO3nNzvFyQVtWt5qFXZdOJ+oKtJy/Z2ISt2aH0\nai7Wzp9IcP693AVb+7wq/z3Mon5u8Wb3Jtn3cuMZOVx5LrHkmcOz7uqOVG4c\nt1BseaImRsYaBxx2tr7nJMRGzzvBbwib6SJ7Lar8h5zajSVEY7MHHMQkFMQs\nw4tP\r\n=0RPN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"36d68e0c3e11cb07bc217a9e13cdd3466437ca79","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.8.0","@apollosproject/server-core":"^2.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.8.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.8.0_1617020873879_0.9738763169182416","host":"s3://npm-registry-packages"}},"2.8.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.8.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.8.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ea4fdd4ebf857cbc57cf27b30ce68acbd77c2f72","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.8.1-canary.0.tgz","fileCount":116,"integrity":"sha512-d7QfXKebaj/Db+k4CCCj8w1O2p6DMrETKErsqksEPDR7K7wg8kpTCo/EPCCljx9fSQpQFINfXoujn9k73rbgCQ==","signatures":[{"sig":"MEYCIQDhFmPb2YNrMIizAIrJacBTEVeU+kF0S5mOZsEuzT5DEwIhAJMOqD/kpbfb+9LEgbBCsUFgcgGLhMdjVsRQp6rK1gQE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYcg6CRA9TVsSAnZWagAANFgP/0yZlSu8VL6lxZraJdar\nMFG5i5Kfz5aDpXoXNQfeFKzujgf7oHhrpQWDDt3QKibDMi8ySmIwNPv/IJu3\nYePhuiqa1njtnqeA/PXH3bLJtUOF8fn3TmZoJzvo4UvRbCLMZVb0b0aX0l/k\n7jQ51Q/w1ZXz/Hh/TO1dtVPaOKKZiF0hXcKoEfUP+kmuZ2K3keAscsQ3wKmr\nX4Lv4DlDn30JQEGlSRlHRRCScO9pkm59yQjpjjI1gP18bKKmJTV5btebyBia\n1sGrD37snMggvjl13zKcuZxOf7ijnH+8da7qdY8hX09bzRxWZrSFl5Nwk9p+\n2OBh0/RpM+Zu3Ze/2jFMSNQNQ/EPeO645V+z9uHumgDiDxiXhdB3XouLQ7JT\nlIiPvC6d9P/LkrYQ69whDwHZe5c50NzoEu125zjD/M5m8zX10nm3ccDAlYRg\nDdXAKGjma4U8z77u1RhqnkxzbZQmkpFNoWA/0U4WuOFOBoLxfzU48KG68oOF\n6EpITJFxMB3lGPRfDCcVewYpmyW2Tn2+vU4HshbtsxEMgc/E7jPd1Gc4vwLO\nNu27vax8wMuaXAREBgsU3jo0GI6+4TKsguurggHZXovsH4tnc+M1tMQCu8U/\nBJeaV+/5xN1xqmVwbbPVcy+rzPsGvYjgqWbFnTmd3UZy3m/8aMSasntsiHwZ\n8Oxf\r\n=125d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"36d68e0c3e11cb07bc217a9e13cdd3466437ca79","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.8.1-canary.0+36d68e0c","@apollosproject/server-core":"^2.8.1-canary.0+36d68e0c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.8.1-canary.0+36d68e0c"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.8.1-canary.0_1617020986175_0.7557477941876278","host":"s3://npm-registry-packages"}},"2.8.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.8.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.8.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dfe2f0f2a9325bf392c7b0f7d7796092abbad832","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.8.1-canary.6.tgz","fileCount":116,"integrity":"sha512-a58r3E+PoURG1fOg+KT288ju8F9JBqkCDw4ViyJ3VXkw1enuzSsnTmPvN8S5MPdjIBoa6c4FV9Z16Qr9niz6Pw==","signatures":[{"sig":"MEUCIQD7wff3+OcLG99zTnCo1I83m9kWhYDchNUOc+ZUPjvHnAIgNURsFnF6VVYYtelL5PiLHUxULDq2SuPz4RgB5beSPjM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYjUtCRA9TVsSAnZWagAAGU8P/idExuSdj4sSq1mnZqfS\nBKL9nMTwAQ4xgq3ea3KVQSASUZSorVBs8KLIyRoEOAzJK6oQj2iw2C+iSa+W\nOJGPIXUKtM2rNo7nYEfQSVc7nMlQUfoDPhG5BZ1wAwHnpdzW6d228NshJ7q6\n9NCn0+JilHHq7MeDvKs7VMVxVCE1iFXE0oGw+VdkVy2jhQ20bO88J/nB4sQs\nu9JynyaFpr3emkUI2x6hdnVb6Cz2RM/U9ZjGbH8XgonYdY7yt6ZSrfnZ3PO8\nhDCSabjxMgDR3XLFFyvxv24I96JF6RKDVLaTpylqhIMQPWcP6Oic6Kk/DsXz\ncF8lY0bRcAkQYLwnvy6q2pZRjsgBBKy9KAU2ilHIiGnAySUpZyJrBgMKrw3O\ndJ1Lqr9yfY7vhSgTK94ZXZKX6Xt10nIcCaxMSAE9naA35MVQLW5W/hOI1VsI\n4ZgzVBobkLtweimAjRJxaD+9vqafv3B15yyOG/xhfpAVf6JsoXZ1o12OGryz\npd6egopVoaHH2xOWfWrK0KwCi1MoykprOHaM/Oc+p9gu38O4XggiQAOqcqeH\n4GZmDJxcUt4113H4hv1unZn95F+ZOafrFcmky8lHfMSvob/4M9BI534eS9kx\nCF1TBsO2XweGKA53AaAGCjkhxiEbfICIJwa6ZdRGVbPF2QVXs7vfbqqcudES\nbK/z\r\n=Q7wI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"2181352ac7858966ad8ddbbef4fdb17b3eaf03d8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.8.0","@apollosproject/server-core":"^2.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.8.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.8.1-canary.6_1617048877239_0.5384585409425817","host":"s3://npm-registry-packages"}},"2.9.0":{"name":"@apollosproject/data-connector-postgres","version":"2.9.0","_id":"@apollosproject/data-connector-postgres@2.9.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e1459e5f47ad2a0e373f2e23d0f08835380b00f4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.9.0.tgz","fileCount":116,"integrity":"sha512-2EGR7PqcCMQ6IBLFdHS04qfGD1MD2Q/ryXJYx6OqtpaTfK7LQ8AbImziC7zvXAMZuozymVHBp/Oj1DbyeAnGlQ==","signatures":[{"sig":"MEQCIA7RRz1U6zFfjWtHu2pClinIHCbjWJszO5bIEZSWp19hAiBWN+imWHjtscXGH/IE5BsH+AcJQYx2YeoDpRvbhyflTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYxZ8CRA9TVsSAnZWagAAk2UP/1kC34Y/m1VGEVGXkaHh\nfUoxSLDYOyHwWzxI3YVGYoIzqI4B2HWd0HijybjB+b2bRUtX3MlHIm6JoTyR\nZRPWfuD3D/R7x+FfmLcAZej4eCsxrhhnSISApXE7xU2iOfwjHJHWzFSo1tu+\n81BzNoIIb4qsOnVy0RJKgKH0FeVbFi3Si04DIEJNOUExL/Axd3Q0ejugs+TP\nlxM4+GUcRkAIN7fGvG+MCw9Qc7W6m72aH+MpeeYUHOLxha5efbCqAfOntiGR\nq6ZLOTUEeh1noVbP3eDFNu/pHCMJLdP1D1OcClikeIErw7RsEGmZit/kwRkU\nc5ff3dB2O8AhSjh8sDN0sHCEIHK5XZ8uLbqFZNmvxRZecLG+S2zaYE3C/jYo\n/z/y4vEV9f0HFA84eQPlEobFWb9yL8+3SEizlub1GHH1faZ+dqdyJ7Ki4rua\nDMwqDlvpjtw+tARmgbRK2PCD/u1D/EGC1jNW8/d3/JyNC9vQDfbnqgQ0Dw6n\nmFtYUqQe55f7rpBqnc2wcexNPgbNC3OPvW405bOwUdAz8g88VWYOWHx2qbRD\nzywwzpG4C/NGZq09lvZblrihQPBo4+2oOx3HOZJvdBbEOZkQlKqsrAi0ChSK\nckYKcndoHOtgYgZWPyZvTpa7cLdcP72xCimMAxJkeAUytCb4BCokKKQjvSw6\nOKIQ\r\n=E9Be\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"8555fb7dacca51f7c5bec4d40e013fe6babe64fe","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.9.0","@apollosproject/server-core":"^2.9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.9.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.9.0_1617106555674_0.09408741804816612","host":"s3://npm-registry-packages"}},"2.9.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.9.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.9.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d9ec14ac4070ae9d7269e9e28ea3b637f147a801","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.9.1-canary.0.tgz","fileCount":116,"integrity":"sha512-TOZMBXmrzKItPZiuWh1xRLqDIq0vETcB8lhCAVK6lV/W+oxfoGnEufTakJKXUUYArzdHPjBsX9103uXonNzn0g==","signatures":[{"sig":"MEQCIErDaKdUYR/sgL7GE/QRKgEYTha25Z4gsdwDYE6yN7jbAiBQqiAY/GsDh45OGEjln1TmVpZTQzCRvx4FfziCC0wnTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYxbnCRA9TVsSAnZWagAA3McQAIROCGw11HwXO9z/psag\ng42o5oEmZeke0vbo1XJbFiYvVilj4Os56QQVIRLQZe6shx+DHeiBLCwMdc/G\ncynh74UTDIEOmrP4Gg8piX5F7vleiNAFd3EQhNiNxa2ry5ZQEMCEjH+kMGCU\nKZUHlEnc4eGpebFeAw+izFouL8izdjApwg6z4EAQ1E1XGwJDthNrNMtvq2Xn\n71jCagpJppCgiLzxCYBnxQ/LhULhy0Pw//rhidUnrrFTeuxMzRsULL/AvY6x\npV77PQLeWwFKFC5mRQ4ovlRL/BCUWYMTubJgPnoha/InYYtjtVyZcBXFbks3\nBZx9s4jR3IxwAONRNKoexSk9XbGfYspfvA39YvE3CiFkAlr4O7JLU7ed/qrp\nO9o1YOjyU0MMO0PJ7Se1HAznp2OFDD9TtM2L+TJN1DKm/MjA1FA2/Mx5zYys\n+uZeJVTlUoUQar9p15E2VciVUSazI42CjuMq/aTlB+S94s2X1sN7PScavabH\nPItiLtlwPr8MS0139IBpIBFiNNesSsdsMqF/CH/v0BuDCFJcQsEIfqDzS7GI\nqDbsbeCE+1t+LDMi/5bnIn1lPWvUVW9yfiMVf/J5aRxHFmwJnk8BhcJuJ1jN\n49SRCgiTVO6iCesl0/io7uP+izO/JhX696Pr3jSZmhIgR1FdFVTRukRUnKNE\nzC4L\r\n=a1c+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"8555fb7dacca51f7c5bec4d40e013fe6babe64fe","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.9.1-canary.0+8555fb7d","@apollosproject/server-core":"^2.9.1-canary.0+8555fb7d"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.9.1-canary.0+8555fb7d"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.9.1-canary.0_1617106662918_0.5015113063652847","host":"s3://npm-registry-packages"}},"2.9.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.9.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.9.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e33d34ee80c76ff08e7333815b6ef91340118cd9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.9.1-canary.1.tgz","fileCount":116,"integrity":"sha512-V2sTfSqUYZ3M4CeFF0fTxfS42XS8HLuJzsUH0zfVFQ6KaufdEdhDj4WhBaaqbM6uBVpBCXKqPQ/yrgJKyeTcaQ==","signatures":[{"sig":"MEUCIQDhw2ptJq19wrQOAhluYnKrpPUR+2ZRBCsufUVZWKE3uwIgBhBsEAmcyynXJ9yNEHpG0rCzxTFJgTZR+nx2vsrihnw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY0hVCRA9TVsSAnZWagAA76MP/jsQMVBH7GsYNyIQN7B+\n48v6ECXTy6RivI/VzlyJEbaASDpFjueSMyuv2k5fk1vH6PX9qfkg5jZt2COm\nXeueEelXqoPxVNY+eZxr260ueSJQ8EDoTL0oN7l3dPQ+lo5OTeGmxAvrwzKG\nDinEnSU6oZul8+rHxaGLZvFFGKw+o3pYQWOt71tvm0XhISL4Iq8RMX77XbYR\nfkt30+bSEyLjeM+/j8u1xHfTtuF+ZV9mLx6X0pIt1D/wox9EMui+EzFWn2OK\nCHRiE+y5bQtIDGIM4epjISpXI4UjHqld+K1QAhTNaXYZQr/ZGU20D9LFjgq7\nPkXMC66AT4fZM/T8BucM/1m7v40Xd2FceiMEFPel4dqKotyiTLA6OTqsOKlP\nBju5Rptt06ChL3QdITre5GZd1ebefP1oQ07OSBHcK6qSMKkpDyq/jMFViYI4\nTdNo08ob4IRRRDDT9AZZ56Nebv9QD/2cRmVIRZu7X4qUh69tf+uxEf6anEGs\nylZVhtU5bQIpguPCAxW5TLd3XplhZ3vbLHkawYY3Oh26+rIMJrYpwoj0kRGw\nZpZY1evSDJmXjTOMoP7fY1tW0qk3mdWeiupz1uknGA+uqAXIPoFCC1Fvcm1Y\nz2Mp4WBfSmU2JkKH+ENeWQM3OwEKH5chkMUh9YppCCQ9hnJQ1kWfWoCXN8Vo\nPCX3\r\n=mmrV\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"1210d6e3ad50a921fefda91cb9df99a3ee0151a1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.23.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.9.1-canary.1+1210d6e3","@apollosproject/server-core":"^2.9.1-canary.1+1210d6e3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.9.1-canary.1+1210d6e3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.9.1-canary.1_1617119317466_0.07515201112898917","host":"s3://npm-registry-packages"}},"2.9.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.9.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.9.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7e7fea5f16264d9baf9f63ac30b872976c4892e5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.9.1-canary.7.tgz","fileCount":118,"integrity":"sha512-VPZGohzrvGJeSaj8+WesErZ6isBU6t2nqNs0phicgCA3kvq/mAN1R2BGtb5taiLvqKAFJsjaNZ9GO7LAOjsGAw==","signatures":[{"sig":"MEYCIQCdcXTmgiGoVLARNRd19Jjc66GAqKldj111f/IPFKg8zgIhAJunFZ55x+bdOPPZid6Er068XBPRViKWcoi4ylhrcx2p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZOCqCRA9TVsSAnZWagAAwPoP/AzkjS6CSzY/Tw2iKl6S\nl4ajZEBvFLiuc4lti5i+rDM0DlIjQGJE+fjzQbfUVyUTGeKfijYHgEZkFXOf\nXEev+bamUJnGH71937Uq1y77en7DI+brxH4HELCPmcZTHBBwBaGKVmAoXiJN\nS0Xsq/M4ZLOATdWlRvaeuPmelqgzIuMD81fn/nk4CO2/44FaDS5Fv6DW70DM\nEFzUVaHJ+oNmZseXP8sDcdsnLersN81FThNqkrSdmPkR96NmdaNzvisrJIWw\n7zX3Y86+AO9r3NwX0iuHqIn5TqCO1grooCs6VP+N5xSKSGmhiMpL26/pGV7E\nckdXXQvQTSnQqCPTMSeu/nGkI9QpRdWREci2i17vm9+20pCBDVSORE0z3jAD\n+dALhr7jEdX4U4xYvrFYBwqX582EOPRHA7PyWHrAVCr1d+IDtbmWC2OjTvqn\nn9iSQIjT10hSS+JTQDDPoDGkmJ9iTmtZQPn4PLVdVBEnLhozAhchv0eLi3wK\nDGn6MbYvNmYOJDEJj8DQoXdqjHb9sOrcw8GzBIL32UNfn7OHfauXpfZ280g3\nncE5f3MDxZVODqwsKlqImIfuewzgwln8pFijc5hFO5LFsxyQp1HKqcTXkLiN\nicrnIRyTk1sL/Lrtk2cB98ynfsuOawV6I+CiWecrKj2gF6SEp70tui63Dwhp\nNsIu\r\n=Wemd\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"7be5b903627d5147bc118637feee745048f60bc8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.9.0","@apollosproject/server-core":"^2.9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.9.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.9.1-canary.7_1617223849494_0.09611765821158347","host":"s3://npm-registry-packages"}},"2.9.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.9.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.9.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d3fe189c75e30ab0a1bbc6d982ea79d674b6af60","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.9.1-canary.8.tgz","fileCount":118,"integrity":"sha512-Ss4dw0SULoWv6nlhIaBOqdkfBn8Zva1V19o+Ei14TfyaBdSPFv9UPzIjEEizHFgdY82u8zI+tcO3ZYXiNM62bw==","signatures":[{"sig":"MEUCIQCgg+RtrBgfOK9jbOMl5WpjAQ4iw/5LR0wWWUiHgbrVCAIgJWNSQvFWMmmneq5XEFQG4egDiKHJ16B7xZfgOP/JhTs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":409936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaxz+CRA9TVsSAnZWagAAujwP/iCOS6K2kBzkRD/gJ2Q9\nGKErEtUhUIRlERkuja2rhE1NgE2OrMr4PoRLivn/fnI7H9ncyxmqnoxWDxp4\ngImcfy4V7G4Aj/Wta5xkZQ/a9Ljudngx7JwqxTZhTyJxku5j88Fx0aRo29oQ\nVT5y1LGQAF1bySDTyjr3lVJddGUKzmSvcecyLmaezQnljDqk5dcJV6/I/uXF\naX3qdQXEauDvqLP5Lf2ljP8n8BRbrSoaBC1dICZOfsLb1cWE5fYzDcQ8mtzg\no7P2ucQJGGMf3Ojgjo+bjyhqczDCFf3Q4gbauA2d0nPwcdxvWE4Gdya2LaIL\nZWfnMGW2VccesOcFkPxx5tDgSd2Jya8UiunFMa6GjI9KLcq3OPull0xlFee7\nEsmg2jufCSEKQexNzxAjh1u7sw3tcws9wWF2UJ8r7WTulCph8VKt/yoGyDiR\n3IsyCrdvtr/MUxIjOzXYuZMBfTvm9Kf82wF79GMp67abHGM3jS+/sn3wCmSl\nJHHBzCCc3m9Nv4cQb8mbtWQ9e5t2kkaT6Qo7QwufIsjR7s7m7xzBrybGoKgU\nLwauO2SvP0eoOXk4xP8bkd70iqxmYg7hTU10J7TQdBvL3XkBwfBQpEvLrncN\n/0iwhEPSQsSnHDsqJ643V+AX7VLH3Lzi//opk6peCSli/k2lqjfCjjGLpiEU\nJg5u\r\n=NFTa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"6968b6cae059adc4b810c18d2ed9e217166c48cb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.9.1-canary.8+6968b6ca","@apollosproject/server-core":"^2.9.1-canary.8+6968b6ca"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.9.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.9.1-canary.8_1617632509844_0.6305472062406134","host":"s3://npm-registry-packages"}},"2.9.1-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"2.9.1-canary.10","_id":"@apollosproject/data-connector-postgres@2.9.1-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bb2928c9e16a41b6d3168e420c6af919a7237b55","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.9.1-canary.10.tgz","fileCount":118,"integrity":"sha512-RscScNaK93otspJXaT0BZ/YgZ0D/EGIJNPJWcSUx9uq1G7A/YLPianwubRU5KWgNixsZtczugI8WJ/FIgmhMeg==","signatures":[{"sig":"MEUCIACJka5LL2KSLRVATC0Sjo37SmR/waBOZbRgxJULK9IiAiEAnvbkm1+eBJ9BZZfmISlsRTk5nCEsmGUsx3LbtVc2OhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":410545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga1y7CRA9TVsSAnZWagAAe2kP/RyhZLUfa/kWTbUzioEE\n7GmLx9d+ZUEkD+58Pr44IBzxpC/uuQ5dzOWO5kQfo06smNzyhhFHHQxQIx1K\n0kxQdGYPHpQ1Yv26iQJYg6i7r5cAdL9HSGHxsCKCfyFlLnwehd588hqnRlWO\no2kJvB3NhCDhctoPxN+27L+PKl1kD5FsjyvfwwVGf0j5p3zVpdFFthKXAvYv\ntIU58t3IWfVoEtxvHQbuWSCefuwhL5h0HubVfo0aEg4WZiSsZjCHFhTRLEOe\nJRjt8HOm/wKxlee+ZfawJPSoKgdxMH3X7ek8qVGJ/M48THe4ar3liWAJ4GPx\nDscBMzipYVOekR9xRafV62xU0JpEVtT/v9BvpdQQPXkUsnPvyaG8j4swH8YO\nNC2ox4Wlwv7AlM9tVlhDGC7UOV513zTr61OLjepFCxJ1DzYbGSJNIGrKhIuj\nUYRl5llJhWmqvZcdiDjtzgHZGcdRGa/96u5xd9qtG3FcvdhKQeOIf6Tl+yvV\nWfJN3jZ4Azx8rR50YgxgDh7WDyOwVr/hoBm+hejhQBqu3ituWih6dY0Njsmx\nK/vH0Apr4bcxGubY50V98mTh5XuQpqf58I/O06JvL73amGrFISpMi9fEY5yI\n698fZ+Bz0IjJeixM6BxZ0Teyq+wpCnq4tzg8Zm8W5hJAnU7PWMs5uAtJIhdP\nADE8\r\n=VmAI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"75a61ff6e47ae2ed4343cd4e863d364138dee036","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.9.0","@apollosproject/server-core":"^2.9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.9.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.9.1-canary.10_1617648826831_0.835775774047633","host":"s3://npm-registry-packages"}},"2.10.0":{"name":"@apollosproject/data-connector-postgres","version":"2.10.0","_id":"@apollosproject/data-connector-postgres@2.10.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"99e940db483c48cf50c8858d7e658bda984a7603","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.10.0.tgz","fileCount":118,"integrity":"sha512-xqiNXE3DHaKKGY25YmorD7XpArtY5RdKn8O9EE+TdHqHmto6aZ+WmeSFWsxINGbLF81IDmOSdzebB00wmvdvYg==","signatures":[{"sig":"MEUCIFMvJU04KEZpdi9+xL14QAxR32rt332dB2jUBjiSN7IZAiEA3y77hN1J44qnMfeqoIOLlS1RToPUCi3fHa3A7wymKPA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":410853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbHPgCRA9TVsSAnZWagAA0fAP/ix8T4swlejtCthHwlF/\nixQSvOw/+OZjF6yPREWMYKXRKQL8QjVsOx41DVh2osTocd8nhv1+6mg/ZCei\nhHnJ6sTz1aMBx8hb5uxxEfR2RHMusUCMxMq0gedLtmZ26Xp5Tl2oPS8oT0Yv\n4NXnxP3IAFAqi8MmgUOlBt+J/KNM3hVpvnymP1MvJWlNQO36ldbSfIgso0E6\n1IxCddBhN701Kn/NrxLp2Fmo2ri8K4hn52HjUGQ90+rLO8IFkHHREa7xRyMA\nTqj5Ht58iWtTm8ZFcaeenkybNnWjz+5Ldb/WHDG+ljWg/r4VIew7MzG07Emw\nXr68+nxr6HQYPKxESNGezsptorji0rXY1q5hEbelDdlAZpJM53+HgH13u1FP\nvsD6optAjJB0B7beEGDigjuZ5TQfvjOhVcM6mIJlfaWLQFbBDkXm9Rn4yLh1\nxMoCDeWqGzAwjYSoJCasP2J3EqRnjxlWYnuCZJe/PilFo9Tf5tmczRKY25l/\n8A0dNXQYgpWBg6/f0iZ+GTNoJ0z2wOSiUQS79Lc7SPjPF9DdK/diGJPO4N3u\nAgipIb8POByuv2oiyyhSWEj9zoxRdxPA2ARLgp7roLSoAxZsTm2GQYJjmmMy\nNaFlRbLFA6+PDaHBhI6h3GrmPw50Flq3tMIc3KrTONXGmxfzXXnqCbSBTUPp\n0kqr\r\n=DfYX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"1a2e252309992f6e1c4514ad92da73dae9949e74","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.10.0","@apollosproject/server-core":"^2.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.10.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.10.0_1617720288420_0.4113613219768415","host":"s3://npm-registry-packages"}},"2.10.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.10.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.10.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0a71fd580c29aa8757e04a17f912c7e624cee349","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.10.1-canary.1.tgz","fileCount":118,"integrity":"sha512-cavGAqNX/VyYamt4LYf5jB8La/8Bno4Xw64fTFeQiIbY0VP2/Qx3BOwwepvSJf8zs6NkfQCUO5HLo7S/bWoNMQ==","signatures":[{"sig":"MEQCIAvFENk/Ha+NpqR0fSTMLhmlcUW7B5nY+4ryZ88ZftweAiAltjVxVPv64ywAc848zl5FRyYa6I+TIKl1JgI0hOUEGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":410907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbITgCRA9TVsSAnZWagAA1+oP/0faIUB4+lFo+m8F/K5f\n9ZHBw4v0yLFmw/nrtOWl4CkpyoEJRGsAE7gTR86AY0Y3z389TRq+C1o9h5WT\nXQvE2lLLpt2rlkCrJAEl57L4g6pg1sj5FXXSGqCTg1lQiZxp0K3fn8wp4I3W\nJ9jMPmYieCrGDFbaufSraB7yZLXwYtHv4gls8DcrpsXfg9cSl2hJmQ/X2NDi\nVk0njTxso7TlR8Yma8WQh83uhe/ncQeDEePN0llpsHy1kCYbSU3IP6bj2eBs\ntvoN3M2J2Fkn80nIkWznyuqvq+m2eakE/n6MlJ/uVWLA1OeDDi7dKQLW0OGc\n3O6+ZZQqojqVzzpifE6M5jGSYqn6d/tsUciYdDnpNC6BJbXaVDRtmhy2i8zI\nPw7cV9z9JDFe79vWdnQPXlAuq47WcYLdu//x2ZEUyXX4t4FAq1Qg3Ri4VZil\nF0EpzOykf/S0GMJuCIBGbczHjn+ORPkqJyrhB40YChhgLgWN6lZr+vD421Kv\nuCvDFrzMf3aUBtHzg4puWH6Wz1yFxmqWNPPqSqVAR7BsWZ1SEl4PywQZjCBC\nxZ7CdtR5Mdizef//UzBW/OMBxIkPblIX7Wu0NrWjvtvM4oaesE9wQmTz6qls\n97g/sLguelYojkO8bED6Di3pWEristZgVbezFYDTbU70Vek+nl3VaBaeDcaY\noR+C\r\n=FlpZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=10.x.x"},"gitHead":"87f6dedc7dcd979c1aa96bdb2b308b2fc1288900","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.10.1-canary.1+87f6dedc","@apollosproject/server-core":"^2.10.1-canary.1+87f6dedc"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.10.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.10.1-canary.1_1617724640195_0.18998416181750288","host":"s3://npm-registry-packages"}},"2.11.0":{"name":"@apollosproject/data-connector-postgres","version":"2.11.0","_id":"@apollosproject/data-connector-postgres@2.11.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e5fa0d12c98febf199bdcff9d5db15c5062ead23","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.11.0.tgz","fileCount":118,"integrity":"sha512-r5UMcq5SsmbXqtG2p5rNP8SbFrXbi4cn5q4oX2FFt64swj1hkvuFzGFr89QSYtOS0Povi4meByqiW4pHTaH12w==","signatures":[{"sig":"MEUCIFTftV2OxSRwdxhaj896XS1JU9xgcwXe+cXztVda66OGAiEAqrCRIyJrjZBtvDhGLCZlHIN61eE/m5Z1FX45IAwI8O4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":411038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdIS4CRA9TVsSAnZWagAAdykP+QFa2TpOUcFIHlkE+2eW\nJJksATJi1pwxdyNR0oEegTYgTKviMV/2vK5YHeuq4qX8q+98Zw8PRxR2hal9\nSa/ZYg6LXpdLlDY3VAtu/F9ndkhu21oSUbwZjZiXziw+vz2ebjZtBzROWJux\n/FfuW0LUl2n5KnoN54K7TP6gxCPqKXYKE8Z72HUEvR8rPsmRlYgVsum/KvZa\ndGsYXgdVBBjWNJpzT0M7kPDk7u6giFCCdSxxJol/GXvTx8zSvI8wkmCgnY8i\n78gsIXUbHde803V8wIss5lTWI5Aws/p7WhP8ZqeLyMhWr1IXD4Y//iQNTr7o\nZ5qMLd1WBgZQAMK9P/ud5vS9paJJ2lMO+hkmu9Ffc7pbf89swVAu1aONt4MR\nan9seudNYHTuCvunkDcfgQggtkSvfF9Z/ZOBHmkHiaci1ubX+Aj1D3UDRpTs\nBjLCAzxPYVF/DXW3LQIfbbFnoyZn4P3NCc331BoisNaY3f4krGjhYyC1uSDg\nGp2plgx25UtMt4IKXCKqm/b+TaUkAXEF5igDyvJfBG5JVmjXfXx9vo8DXznZ\n6Q1nTECQqyokHFfQopEwDPc1HR1S4dw8k7xmoVal8ts+OP8EFoGnzyEwo+xZ\n4UwIIElEExyIEaoCh1yhN9cB+zHGVk37ipmOdKMQreWi+ppgbqfSCFXfrnbV\nDjkm\r\n=WY8S\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=10.x.x"},"gitHead":"29b07970810f5f2a566f188043c38e45a798005f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"10.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.11.0","@apollosproject/server-core":"^2.11.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.11.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.11.0_1618248888372_0.5832609297362195","host":"s3://npm-registry-packages"}},"2.11.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.11.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.11.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"963e97ecf5b67b26bcdc2343616dbb4210e3646f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.11.1-canary.6.tgz","fileCount":118,"integrity":"sha512-gPUjknua508HZjqeqYbPODBF8u7IYTeplWexZwQeso41Cfyr2y2QIc5GLgDUKskmlwxw8tLGpNfEScqs+/J3dg==","signatures":[{"sig":"MEQCIDNBPEslL3qWLSqRqXU/8wC4hn/hCWIG0QeSd8bdKwhrAiBWdlzoQU38uByV1k/Y/GM9OiSJIrRT72omPJOdYTvDqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":411088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdw49CRA9TVsSAnZWagAA48sP+wZJyMI/2Xn0s96chdVC\n82baASL3GEEwjfsgEQdNswy0oMVujCDNQOGsP3iLrnvuaYUOs03sil3oHnS6\nuT7Ek/P4xOddXOySliLl4fCR7UY8jzsHjUCBs/449FobI7lkSmZv3aS6KxpW\nP2+X+iGLkH1n7j9DTauKdsnfOOvQip08YSrqUeSgSTO2izjInrOXpNqh26zX\nDvi3UrTswkSGoatnr7JalBBZWbG1Eyg6JodhKE9aB9ofwO9yofhQKAW/iwOu\ny+hBuQazxnuiR/k4o8GYRA7Tz7Xfdyn0reWQ/EWClTzvkllnyqF2bR7iL4od\nM3cl5Tf8IcXBdoD0PG9xc8choKcJp01sQsTF7VEmm8EXGgOtzFqbC3vbZMlf\nTSgImiHJh1yIG3wWytLpQAsw7dr0BLpQ0bTACK3CV/9a0LjQZBsDYuniiWtb\nMUdSanhrbsFwZAbKbGG2+F5Gi4Mz91Zn8S++fGBpsKTgCvslCL/G8H30LmLN\nwBeK9tLnC+ebrv3jonzKYNd1LrKQTyWsjdXlrvpjG7xciubFPg8Mzr4QYuke\nMRGsgdCFcPYzjmzgpU5ozSohYy43d09APyIZtB4OfSg3kWhYVUqQkIT2tr3O\nZLjfj91uTOA0Ge0axcb5TXOMnLsgL9Nyw9vMT53M1zRupME7f/tufnTs1ZfO\n/utH\r\n=IwZG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"56c020a08ad3b6cfe8c4838ac3369878cb2999de","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.11.1-canary.6+56c020a0","@apollosproject/server-core":"^2.11.1-canary.6+56c020a0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.11.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.11.1-canary.6_1618415164725_0.912714077290012","host":"s3://npm-registry-packages"}},"2.11.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.11.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.11.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"88cca0135acd6ebed0077cd8d66e931ae4fb53bb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.11.1-canary.8.tgz","fileCount":118,"integrity":"sha512-MWjiVYi5WhVUiz0NV3i3cLYeO6YP/aW/NELfFvD4stZ8+qSScY9QS2V4pwUbkL+TBynUFX9geb0vgy69rWoYig==","signatures":[{"sig":"MEQCICGMgmjopgtI4ERjS9GSljddHlK/T/3l57OdIBl8OziUAiAQcDXTzAc0W7dwr2vvtFHsPQUb/Xt0S7Wz7m9kiOO+EQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":411070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdxxqCRA9TVsSAnZWagAABdEQAKJ4WDB8jc7wXlHZ7kvj\noeliR2Da7cKThH6Vaw0D9ez80fkYd5y47j6iaKKgVG4yc2CwfCZk36O3dUbe\nXcVAMf+sNcVXoKzJxCWFYTxCvxeZ6JMA30TOxXkFB4QRsDMSfrfI9nPKb5L5\nbVRkDa+plmRW1feEsFe7SB9O63Yk3rBmY7objAoDW6kRKmZgIEhtaphN1Q7U\nnX17lL9lOf0kKT04Rkz8oej67CzJrS9+ojRXvbrOVHFpTbxMJPmOTSdz7Em+\njSWobyR8NXc/b71PiQoA8UVB3ncehrsueqIu6AXq+LED72BoBFl0qS4tOvQ2\nrLS1UfXde+bcpB7YRYtCuaH/AVsQFo/lMGFQ7XDj2IftbmNlis3qdhaMx8gx\nggAtYoP7o67Pr/sMqRnTB7bXBuHCS26DRv15bbMrqT+BjKgf4yQtBd6d4Zul\nVjYz747IPbWNPxYGQvIoB8585QR2WFKO2vFDvOFyxayNWvv5Zd/kaIMcMAxg\nJu06L4CGFADwMwvlZGbCnjZuONlhYWUcW8OEgqnGUz8MnjI4aMhg3rf25SXq\nQR+pVsmhZff9Lk0JRIw8poUH4mIPiksVJ13VldVDqlYlM9phxNvgpLKoXdKo\nazijNvcTLoOktfAMdvlB4E8J364qGbMK4vExbz9jAHzwpPRzN/rGpxSExdrF\n82HY\r\n=lsCV\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"cee52b13ec4cad0e0f1bd2faa11bfdb6773e0e9c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.11.0","@apollosproject/server-core":"^2.11.1-canary.8+cee52b13"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.11.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.11.1-canary.8_1618418793615_0.578339133164365","host":"s3://npm-registry-packages"}},"2.12.0":{"name":"@apollosproject/data-connector-postgres","version":"2.12.0","_id":"@apollosproject/data-connector-postgres@2.12.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d1ce1fe11ad74a243a2fffe53f337d8b9c6b546c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.12.0.tgz","fileCount":118,"integrity":"sha512-wduVmIlNhDWa0VCrQnMjEre0cfnbcD7t73fRd9QvWaM9iiLWPKhDJEJ+K8LNMwXaVMGMRvIihE7sWCLFXIOUSQ==","signatures":[{"sig":"MEUCICWrX+5YJt+EjGQkJ9YQJSkGL3Wp5hBtgEv7VDg1IKZkAiEAxxrS4P9DsOmb3k+oU72jnJmuWPkSNt1aiMwArJLMqgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":411219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggcbrCRA9TVsSAnZWagAAa6kP+QDZNL1ZItXuwbZ5E94V\nv8+tOwfkX5P389c1tVMrRor2yeD8pToSn2eqUNkuY6ikGywLV41HOdlhgGGz\nvU5+nt7lcMvaF/TDWHTnzFGh4ScvchHnOcNcg3zHUbDXEWO6uP0Rb7sX8FS8\nLYv+M5bAncr3xBpsaMNCIclPbFf1uK7SkDC8XLYrML7xYp9xAlFqDs8mjejF\nci2BNCQrfzHLUZKj1DlNFyddl7CzprIdDfvnmUUYj+DwFYkoO7o4+CpaHeRu\nZeCYVDn7UX1QxllqKhnxmP+EuQtXqBdfnUyh20qbHfVfQxMsZVWIRF139qQz\nEEnP6vJGCwCF7xCKYKIJdOU0Dc5KvaFjbFpKjLElqrqlQbz8j4G1LwKpVZvU\n5nC8r9hhQlH3v238h72R/2dOQffk7BexJrP4BqgIs3qFDxXEcRagy2O1+Sy7\nCedrQ9rBZtJHixc7T4GSTYhLBdvvdXbhK8pWhY8A+ATFnrt6p0LbgcuB4D+X\nk86VvdjADZzQHCHgs3MtrXbXOCg9XRDYC8pYmZJqgwRnEy5leV1C1SbDndky\nhorKHN1EIP98BLU5r5i/VxSUsJ2MS25zNxK2bxLWWRvfKRrVBxevlOBvUTgR\nAvdwvGqpjwBpNpgznYcxvsk8mfCuf/iRly0TcY6yV72QVFbbvNUHm7eIdOIt\nSB00\r\n=CUSp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"6c493f963ca10aa1ca8122a4a210aef5675e269b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.12.0","@apollosproject/server-core":"^2.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.12.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.12.0_1619117802973_0.8837252301071401","host":"s3://npm-registry-packages"}},"2.12.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.12.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.12.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ebbef8a0b6a49e2ffd38af682efa497eccb1ab79","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.12.1-canary.2.tgz","fileCount":118,"integrity":"sha512-ORXAJxWDXbd9ggQ9ofOjo9IhAgbMTVrCoeXBpnDlbmEHLhwAuO12Rx9MxAixsKOJ9gcH5k/yQmW+KwA7tKb/eA==","signatures":[{"sig":"MEUCIHnAmviUclT94NiklWGyh3UuFSD+Rgy9Qo4GXJhGEVK7AiEArhFUXQdN6sgoz8R/KFJurCsmk4euEmCk1PUlLFE2gCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":413579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggh3MCRA9TVsSAnZWagAAjk8P/A1GitJA+9HoPQwrUXmM\n+jxsCxZswbvRaYDzb5osk57UYsAmwUUhDPZwsMdWJ9oviWxGagZLpSCeY3Ti\nNhsiIo8ieF40sLSVnDXIYOCNfkWr7d6kebgmNDR0fV44ryfVP4a3gxaD3BG4\njFhFYpL3P/ka0w7/h4DQA2Fh+6FELOgPZ7p+/h5IuaKm37MaxaolV07v/Z+p\nSjSA7N7BW6vuXOMoK7krNrIr7mYF0ME2xYVO80eV4+6XqhmDCF1gPEWRkWE+\nxhE2Lf+jwd/+UsW32zcghizxpi5yNDfrJouIKmTVZ0Slz6a26ZH2AZVKVD3j\n8eyj09uFVrTBSKTtJAFkl3ZyF+Gu2Ke7hRCSXiCT6eDYgTBH3qQQ27nTdGIh\neu1OwSK9Xtd4w7WKIN97PUiZqIB1+l5kuZyrA3di5KgqjfgLt6o8Idbs/dld\nNHPOonMHwagOck7cjbIMGDvlCgtXxS1W20yt0JKteO6vG3+Efnn/Tpu0kbAr\nPUde8L+r0sHZkAcx8PTfPLLXJBgAktPw2Tu9zirZdZ5m4N8NzYX3GDVDh0Tc\nb+fwb4HvaW6g+L6XgV1tI80JLcyRl1z8OW7qK9JAwDn/Lsqa4Im6gY2ZzbFq\nIty8f9uOzC84Ngcqro1yPrVpsJpvZLZi1+EweesJfPM5f+ng5YsX+mGegJIb\nbkYB\r\n=aAux\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"f3352bdf986af47d8068ccb9050daf2ad40342c3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.12.0","@apollosproject/server-core":"^2.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.12.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.12.1-canary.2_1619140044080_0.803633716513241","host":"s3://npm-registry-packages"}},"2.13.0":{"name":"@apollosproject/data-connector-postgres","version":"2.13.0","_id":"@apollosproject/data-connector-postgres@2.13.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fdda51e4246245626cac71afa7f07b6d1c0707c0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.13.0.tgz","fileCount":118,"integrity":"sha512-3byYDiBQ7zy31YapLoTeTTE8+vNRndFvUg7vdbPLJP7q/ykgoX5AyWe7PuSdjt9+NYidF+LZWLNTv/W8in03uQ==","signatures":[{"sig":"MEQCIBMdjdo8bYrcyIoV5A6CprxeCcmNw03eD2JBbPNBmRIrAiAH8WEXUrQDkfCjM06Eo5I4DVpFqxhYfxj3txXyj+btzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":413746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggs8mCRA9TVsSAnZWagAAuqcP/1wxRxbpTOxG7YB4n7Gt\nksU/P3LXfAbvLJjEFO5revQEUGn3ttnrcH+/K4IDbBf3SG5R63azFfSUekKd\njn6dsRiUJPDdNN2UgQyWiDxUwnRVwmvNgwBVrl4riTXJeGEtyodG5vgBWqUH\ncq0fWUYb071jmxfcdTqVpomr+lyhHDds8m3X0pVuLG9BJcHiEG8h1GgLJlgX\nHq9CgOjRnHgqioQ6E6vy9XtCD0+kf0EIUzrMMMtvRk4QiwZA2uqdKb1kjd7g\neproVdxB8Lrrg9bfH3pWv4t7BuR1kY2jk6ephtqifiAk0AToHEBJflatrrVz\ngK2dzyDNVGCVE/tJVM3PypSdI1/Ki8fYBiwEBMP5EmfOkC/ASnSnvXaLEjFS\nHJeaj7WLj9TypIzKCf2Lu29niLXoX52OB1ehPHaV3OBF/XvBKtH+q+e8Xh5t\n4ZqzzThSpPkvDGEf0S2KDgV/mhmg8hi3gAK0VCRYE7br2Y2AxCOuL5eFGxB1\nT5X2v1vbbM3KNVfgEOS0mYOugwJm2Pz2wkOANhlXih52lO2oeC98Ie4b1wvC\nTWTnb1agXU12S6dJTqOvu7fUCTjAJYeC/2+6yIXmCv4z60ESQLbk24D8AD2P\nWQLIUCJnIcU41tvXFxV5oHjLmJhjiqC7cQTfEJQhYPCsjfRRyeGEoud6b3kA\n2URu\r\n=f8P7\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"6b98d8e8d65dcf56475d1d0a2ae929a6ac8696e9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.13.0","@apollosproject/server-core":"^2.13.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.13.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.13.0_1619185445864_0.18844246319302438","host":"s3://npm-registry-packages"}},"2.13.1":{"name":"@apollosproject/data-connector-postgres","version":"2.13.1","_id":"@apollosproject/data-connector-postgres@2.13.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"17ea5d36c7611a1fdfb53b5bafd8aef708a83be3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.13.1.tgz","fileCount":118,"integrity":"sha512-oQTBh3c5TUwc12D/yJOqoGtpKkbkKWJzydjyFEGGxU0PwZUwEGvAkoS7TEAccr8w1MQSYjlNgORJW16SXSlYGg==","signatures":[{"sig":"MEQCIGtny9oQMN9McRsB+nVe4OCJsqKSWLbHY8t4MytwDZdWAiAIOJ4j1Q+H+0lQ3FZ2cAcBWCv72RPL+5UIuTJbpjM8lQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":413932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiWmfCRA9TVsSAnZWagAAeM8P/3Kg9tr1zjUoXps8RU9h\nnETc1otmAPOQ/DGKLEEBnwKIXz3knmaW3px/m7/SAcaKtaxdFZLjUIfcHDDs\nEknUif3CuJt9t8Ehk5qaNRZjgy2kqrUfgK6VIzkwwBpytTwnfqunfencoecf\nHB0NvgF22n6g6B8bddlDpj+u5uAy/ZuvKNJsZSdWwH0/Pw3ZRCg9W/GOV+SX\nJzZchHmcFLBEoBhGEkpgHyAy6oFJ9c1B1eek9VbO9n/WnRZCT/2Q7/j+sYxo\nSgmfTlMviMcXtq74tnDgOqqgfu89qEWb7PR/wQCWTr8Nd9kWi+N7uWDiyEVo\n/u6MpO7ZPJ2ZzoaT1BrKfyPIuOlcLY7fiX83hj0cSglBWI8mrMoytuNihQvs\nN41WAmMRHPxdhRWY1+nk3dXmB8Z9pH5JIL/WJm9pDjGDvFCSz8+RA9UgfPYP\ngfNVozn+A6OUXSk3Vt38bTSPQNCLqIzRn5JIxXKciEFG+GCSS9QF9F2CEcs9\nyUnszNyKlyc+zkoC/0uGcqMPUhSKpnkYJT1sg4e5sOdtY9xT9ATMODq0npF4\nP8p4H7vxbAJnIE6C84W90QpOupjQ5mdn7mVI8/HiPY4Q/Hs4iKOu6eAbp29Q\nwzCY/jdEL2LkvyWJtK9dnXZrBsc7y9riAIKBlNioCkzwmEHEQDCWxxuysR9v\n5sng\r\n=WnGw\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"e79fd4fb9028cf612eb5280969a5e7804efc51d4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.13.1","@apollosproject/server-core":"^2.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.13.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.13.1_1619618207202_0.32946127300165773","host":"s3://npm-registry-packages"}},"2.13.2-canary.23":{"name":"@apollosproject/data-connector-postgres","version":"2.13.2-canary.23","_id":"@apollosproject/data-connector-postgres@2.13.2-canary.23","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0df039c2bf1682b87308559807cd7f701009a759","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.13.2-canary.23.tgz","fileCount":118,"integrity":"sha512-6bU7GuXOUjHedAkbqa9spO587b7A0pZvtsk/B9Iqr/uQCo0kWgED3JkuqCHnH0WWpxol7mfS4O5mK3sqE74BBg==","signatures":[{"sig":"MEYCIQDUteqBoumG2tAQm3DeyvDccv1UvKGxJea6BMRnbUX0mQIhAMSf0tKcuOTpc16q/CiU+JAcTjTat306CQSUz0TEz7XH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":413989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnms5CRA9TVsSAnZWagAA5GsP/391yPDcPhjagHEvUxlq\n302VboSICkUGeCNAbL40LqZqBhR8Bv3Y5BE3+lgQztlce2qonz6q0JaBb1IL\nT5d27fBVvukMiBk/TPdvt2yvBqQXfYUvpq2Lfgm/yEqSxQK/b6/vyWdjdnHu\nG9G0fwbx2cnXd2CawJO6DflXIBsNIhnCKs9w7Lz5rWvlvKPXuhxIEZVwRr4t\nEHxKpeVlNje6M/g91eqzKzQlRWlqX2QgKsdper0lJf/AGfpDyr3OgxX4U6xI\nNKWIpvMIkvpUkdlfZ64vjNXO4k2mKrKXL0KgQJjTKvPZHoWTEAGeXcZXZvRQ\nu/k15sysFl0zApkzCAocXNttJiBA2yvjwOsXTA34q/C00NtntFQ4RUAtAHIx\nwlFrRYRF1XVOuHn938GneICXpT3hQvE4H8x7z18lHTpuyGwlzIHD5RtMdipF\nAlbVmoqUPhi1VcdBdFrTVS4NBCjYPqFkUwQbMJz2e0zxWoXN55AA9hul492o\nv1fuGPkkJLN2V9aNoHTSvveUYkQ6YcmxVFk77spsBShKJKR51lNrEFbtQBSF\nqULRlKxLt378dQUFVSLdJGqXDx1sHMQVqMSkrRTerDB4NKNl4Frf5mSLgwJP\nyEMJRSmh16WYsiQFjvpaIqS/X4dLjy4tFfO6anHMiBGZgFCpXJm6d2y618Zq\nDJn5\r\n=8Wb4\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"844f67786d9a2b0814c9096ea89af42150910e20","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.13.2-canary.23+844f6778","@apollosproject/server-core":"^2.13.2-canary.23+844f6778"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.13.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.13.2-canary.23_1620994873048_0.3087085699661858","host":"s3://npm-registry-packages"}},"2.14.0":{"name":"@apollosproject/data-connector-postgres","version":"2.14.0","_id":"@apollosproject/data-connector-postgres@2.14.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5a1f8d31bdb5bf167fc0fb7c0fe7a985b1b6a115","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.14.0.tgz","fileCount":118,"integrity":"sha512-vvfk7kS6Tf6xLo53CpMo7iKcieH11O2iPlztvHAaydbbqcERdHGxBZ7fq4bjAL8iqrp4BcU+HCuieYzk+2DiZw==","signatures":[{"sig":"MEYCIQCO2tXpkUtIvPtPUjtR8KAMtGtvgxT8XjCxB5nYnA4pjgIhAPgZ86LLI//yaBkQzdKtFXUv1RwGLfDsKJ6N94uDtq5R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":414117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnpl6CRA9TVsSAnZWagAAt68P/i3nSl+2HqEbZ9lso0Tm\noqxu/n0exawL4Tgd0KDK2Mz/JRRCtAELl9S/p44b1DmpfmswndlmQ3D/TeOq\nGvj2cRovfPNANvD3kyAGrqnIDo6XuxmeDmQuocayuAxDFFTzPaGpodJLkgiJ\nVHH1Gk9ZEyqmZ1eGcuakLW3abyCzixcFkzzbBA6SuxZbb3oaqxHFEh58OjMZ\n4xA7HpmbFVn4DnysggweQAuKcjtWuJItKMvWwNwdHlf4fKxR5LTdBtHV4WKY\nrjvaUJ1W6CWK+1k6gj1EkcNj+Xg5qLMWcHsXbsqOQLP8Y5MrFv4oVDDKz9N2\nWgqGeardXXEvPRchZ4R7vx7cgUfvuPw+kEHX3bYj3alMdLHmG9koeLlyIHE2\nsT1SDhE5qwEammyohpK4A81Kk/S7WfVGRKOJeMUdO9ZhILVEqo1D588dQJ3e\nSPabfe/unis8I3xx8Ss9ShZa8v3e5u7VxFRKd3u/qZ1h1PqbrlPJXXn9d27f\nD/JsNHbtHqH+khsHcNfk8HV236o1Xm6JzWsytKpJlr99mUpVvB32ArNICrhb\npISDoQ0/3gCa0Dmm0UxLelfS1IFvzZFQFqbAgscTNEB7Bq5IISOphKxYMS9E\nWbjpZChR2YSXasQGh9TwKJUyCqI9Q/JL1CGeLTntgT5mh0jH7zqfv0yHEIBK\nkSIw\r\n=Z15Y\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"a967877717651f0ffc9f03d4bad3d27fc2433487","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.14.0","@apollosproject/server-core":"^2.14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.14.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.14.0_1621006713504_0.4687308039133733","host":"s3://npm-registry-packages"}},"2.14.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.14.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.14.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2a018780cf6e76ccda5bdcbe28ad07c428d36d25","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.14.1-canary.4.tgz","fileCount":118,"integrity":"sha512-rl+SZZGS0BkO6eFuqgFxBpgfC9nMQa8nV7PSCgbQrOM/Lj4MSAnle4uOkjWXV2/rWGHwVxLv7aaGcFdpC5r87Q==","signatures":[{"sig":"MEYCIQDk4oOo6pS/gK0atnqEZTzfF5JRwIY4BgYJxNqTEQjzigIhAN5FznG0ucUkiXNvwVIQkni1DY3sIR7361MkJ5GjbHiB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":414171,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpAK8CRA9TVsSAnZWagAAcIoP/Rm7PSGaGJfBifP2ic1g\nagHzXD5rxh20ApjHz7/5xB/iBEoPKQyuaCYsSno631Dha/T6wF7VgsibaDsp\nvTFuYJAa5xNS8SVINn5Iu76a2Y2dewG9DxFRRZQJd5Hd5WI+RTMNSAjW6CmI\nFX60QJ4jettwYLD2QfX040WYFS9RC4KosBQ5DrAH74mArYCEnV5AD7FQglNV\nMeDuIxhV+Hb+gsN7/AhquJjvs/kUo1CTAXSgU+cOHwODeC5ZyXgdajhWGAKC\ndqKOXKk0snjM2WJQ9TZj1Rr+n2KAImmXh2WNK7HTpxUl5e56+U2oFPV+IId1\nE6zZP4Csm61iqjTulLWf6Lk8WHiHdof8MA8gBtLW/y59K5oJgFoeJSROspOn\nf21+QTcQEc+mSe1IxKLv6O8FW6+0EpjAl4nEoxD7f948TdX9IPCKwduCGiWz\ne0twVtdZe+LWmRgOZsbHix/WhC4I8sF27eHARrj+rbZFzGn2ijb0LuUk+cNR\ngqX7xCW2ILVMpnLZzu8fK4S1MR6XU9PHuDe8O96+i1spJvBMjEhs+8wZW8OI\nMDwA5qvBqLUjQ9SXZnkZpddcihuvMCiwtTcYkj3WRDcJpmp8dABJqvS4Cyzj\nwmmuPrM8Zvburo6Bu2WUe4SjkSMbfUaTt0S30XCgutaxziY32xdC1AgJdWVW\n0u30\r\n=Dhpy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"f038a8789615a77f135801557de6eb06ef3825b5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.14.1-canary.4+f038a878","@apollosproject/server-core":"^2.14.1-canary.4+f038a878"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.14.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.14.1-canary.4_1621361340173_0.7673054485735247","host":"s3://npm-registry-packages"}},"2.14.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.14.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.14.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2dec97abf5a7af77b282bf65b63f2b41cac2f4fc","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.14.1-canary.7.tgz","fileCount":118,"integrity":"sha512-ZvOkVTZCQEbqzp9x8bLBz36vmxHrNBBhZUIk+2V9ryyvIkKFEI0KY8Zm1X4sD57cx4TK6s66OaHoYIQmE+lgIg==","signatures":[{"sig":"MEUCIQDeBHCNyy3p+3NgYhfUpUD6Y4/SODuvkZFLHdr2ClRqoAIgQZNEx1k+dWCYRSpurftt4f53fV+lPaZrf8smbypjh8g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":414721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRXVCRA9TVsSAnZWagAA1iUQAIVLiX+txbJtYb5U3nU6\nTmT5gwfqa35OBTpJDWx019Pe7n4/ea0FXYzS3AxcZ71IIToV5fS/gZocSLoR\ny/n9/6sm/0gQ7h5q7Mu4CzuJ4TXLff6u4Lj7cnvB0dgtduICzFN0oVhNwzv6\nPc5OzGWBgmZah5m8ILrZtPDElK7xVkjPNbhby+cCWenJTtd03FZlNC9TGwf6\n9001Pc2F2R1Z48wvzVb/1y+ELhZ+RUQOYIBDSMl2BfIA7nEFXGwdmt4cDtSF\nGocYXmn6NsCy5pKvOT08Rsufc7DMPo4jz5ugDDS+nq4CcL7UoUmnSfkkDQew\nKjePC67mSMbb4r5L+wq7akETRuYzOXMTjjf7aoMAUR05S611sVfyvhETlm+9\nHiuZy7dJ2eEtAZHfLTenuZMmnJ890ZG/pZyEN5Mzj3Nm8O4NmlqRX6d5PT48\nPfT/gp4tqzL5EY/hzR/gABBms+Lekwcls4kcB5T349R8w7Utdx5lhDa/yBpU\n3wu+64upEaaT4M+QkGPYP4oTWvWRw7m70c6MGhn5NhL/g4kp3+mlrwS2S9xD\nz6c4MvC26s6MZiWxr0npJ6wlhjJWM8lW6bEnTRJeiyMRcrbRgmZawMAtlG3w\nZnR/sSQZEdwwgdX+J3jCLmJlioPUccsEuqxPsXOXPdaDIAj7VsQ19WlAobdt\n2bXr\r\n=8vE+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"efbe4e62dde15e88cffaffad3cf689b7bec641e3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.14.0","@apollosproject/server-core":"^2.14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.14.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.14.1-canary.7_1621431765209_0.9395371392077447","host":"s3://npm-registry-packages"}},"2.15.0":{"name":"@apollosproject/data-connector-postgres","version":"2.15.0","_id":"@apollosproject/data-connector-postgres@2.15.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2ba62773bc009674c045711c509d40e5e61b62f1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.15.0.tgz","fileCount":118,"integrity":"sha512-YeyFO7G+0q0gIXebfgtiyc8o6T6Az8fu1mG3Zn2dMXaCpTXUT7DHzioyBvbKZH0ReYTFttpuB6y3AkriRCHHMw==","signatures":[{"sig":"MEQCIB0+xZEpKztI9ERHh5GG7hpE1LMla7dc5UtGHB+iH+y2AiBpIBUiRmypBKN/y4R4HRdu9mnjNEKkHs/gBiNaivRr7Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":414888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRteCRA9TVsSAnZWagAA8pQQAJKCEtd9nZOYiP/cYWnG\nH6bLDi7nvvLo1UljI7rdMCswljVHGzN3l+nM+r1sZdr1fG7UXZYxRmGa6Wim\ni4dfwS+1T50Xbhe8qFPIXnOSDlK9JImc/UXDJ3PacbK9E9G+ifaMNb7t8hGP\nlK01xjZmeQdcGzAsLn6toMngMjgVbH3EFv8H7PXS5N4iMAkFxsaMREkaF6eB\nz4k+5dD0vvMz1pHmitaoE4LG7jh8x3TXxfzHLuXygnp2rSmy+EuBPLF2FyjL\nYq7l7p1+KXbH3mQeUei+lVYkmJxY8rXjT/IxNyNJy7QmGUmM4l3TWRRrUiiQ\nj7R5kGe7D7lyoIIyzEZ/nnA9RPZb9obzDXQ3YTpUbFQcoyrEsG6f3UlxNto/\nUsrdtfTCfuCQbKeCMZje+riB6MaBsi7GtV9nfGcxUwIlzOzvYvW8kzCSrzDC\n0akYsKVA8VbQ7YVGFIk6aRJY5zpmMOpDdT8Si1AksPmfdJvozCsP51WI2Cbo\nuFPe6+q6yt167SGfiqSbBgPz9/iqzvAKxQ5V+uXVZDCLKqDemNwbc1TUr1oY\n/1GtT5KFyN1i1QJKxck1mz1EZj1b7l+rwIpNJNYEpeF0ETAEWiLQ/ezgbvu/\n/FHW52lDqzsfPT6o1/xYcClgdEuPnb5YMz6+kfj7okkUu9JtDf8dgvul7/iu\ngjlL\r\n=yPin\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"cc1c7061fdd962d1ba4c987743a6cc6053d365f9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.15.0","@apollosproject/server-core":"^2.15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.15.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.15.0_1621433181729_0.990143250531232","host":"s3://npm-registry-packages"}},"2.15.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.15.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.15.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"30f7e14a71e96da70887988b6c3d590f37be8be4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.15.1-canary.2.tgz","fileCount":118,"integrity":"sha512-KwZLysy5sBe/OV9h00voAKvYILjazo06GlNYTnfnhUDLcrlCl5VKQrvZ7N39yjHJAf1QFVueO100U4CLKa6e5A==","signatures":[{"sig":"MEYCIQCeylez1ItOoH0IMRhabP3fGFhqz0S+SAel0DhBaF+MJwIhAIJXuNCqZZArHK3meS/eEzbliRFPJxe4tvQvXTsckHQb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":414942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpVMBCRA9TVsSAnZWagAApHYQAIgO1XklG6aaB8V34y/T\nOCyy2AO3niGLmzbhAxvcj44xEYYLPAKNkxaE9KrYWLTGkDQX2Ac+zfItGps7\nk2jWS6QUyvLeuKOp0A6C+s48+bNPXykrOYKi2U11GTMLUtzTL458QWbQPwux\nHO5H0dqANfFRElIt6tIt/9HNMt1F10DGTFwrGiFPdwuNY1gWatj4GEgYFm8r\nP+zvw6JaGc1ynM8eDaroZA9AWA0dP/0kp8fzVHHWpV9drBb9U+QSgrfb2TwV\nF3L8mvfLHyKjjee40kbWaLWbe4uD9z2WqF3x7CtsU7ofhZzqFYsGeLlHPtLO\nTWxHvIO5CDXSR0akhoC9Wj+bwk8fk/QAVdpIxBEcQh+mDvE3cBr8lTT/fr0k\ngZihOAkwQIxS+adU8szFtR0bSQElQcPVjFFPCbSbAHRUb+ILyILD+SClvXvE\noCTLLkiDj2QVO16pR1baKk6v3gHs1A/xY4oKWK8ooAAFbgR/2AUUigP6DSel\n7jX6DHoZiDdeFNqoznFZvLk7lJo4857UBOSID2Dk0xmq+kMraphjJl4KSJFw\nLl2+SvHirc8wj8Hpj+uVvaKvJbmE62jcOkk/TQjNK38Y87QLLsXrY6MJaIvb\nQvVMtAgMv7POfa1ulmvqaES5dPhLgBTh0q0zMyzdNYrF12FH7tf33J+nITnK\n1X+n\r\n=5ZjE\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"6a7e01d1a0aa13b341e3e31dee6f7e787768b4fd","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.15.1-canary.2+6a7e01d1","@apollosproject/server-core":"^2.15.1-canary.2+6a7e01d1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.15.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.15.1-canary.2_1621447424673_0.7168324457515722","host":"s3://npm-registry-packages"}},"2.15.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.15.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.15.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1c93dd09cb3baaacfc9f8ce71265ae9886d19e46","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.15.1-canary.4.tgz","fileCount":118,"integrity":"sha512-LxNCf+EX6igXMcghNQmoa+fcsnc9T61ucUHWxIH17mL5x6AXVPCesQ9a1sev6k0nbDdbjVueEncz+OFnWfFKkQ==","signatures":[{"sig":"MEYCIQCtk3fH5MeDay4Y+ix8p41A80wwazOaavV5OilaiegwrgIhAJpgolElL8+WWfdXFSuczu2Or2sbu2ch+6OrE+8cCXvL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":414908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpWIbCRA9TVsSAnZWagAAsSQQAIw/rijKquyBmCx5og3m\nKrbKRqbuoRwaNk5CeJuJ0v5Ax4juSN34SdtSpJbPTZU8r/R5lZmOu4Cdy/4L\nlTJOLL3OSvzmbLh0H5w1zxWiKa6q5z8nXsvC6yoEj/n/cbjYwKx4mngYCA8l\n9zvPF4ni8Q3Kw6zKmv9VxCaKLCDF7gLXaECYGdLdxyiyexjMTWlLbxkB6e3h\n3WrTp8R2uLCzR2re1rzOXMZBBkO5L99JzB2eV6zklhSSEI8TFLO33hmXk2Co\nuXEfrII75bBvRinsDubD8i5jW+pi+cDaku40i7wNHjknhd2U7v6Kw0LplR/A\nsuxWo92Pe0JJ2bFNSb8raAbimpS8tfrXARHFSJW4vRUG/ca+hfA8BI97VV/m\nNgBDGr6mRBzjGwre6vEHH3G1+LABjxzD7mlgJ9ZS6wxQKSUMv8NxTkD0K/1d\nm+qrIA+yAteZqeA7gItw6GBowDLx1yTyHo4LFVWAF1r9z275s2IQ/2rAgsAy\nK+JWPVwkPvaX+eAiic3fYqbz/brXtPGQYS+7IwTpkAERJLWPQh0uStAJuNbB\nR4LnInCn4ZjwkX+UllVLB6gwnkw5uOFdxi/LES9MIXSvF05YFyon4LeMwchv\nUqEugSEcfMXYjROqHhmkw22qNxnwJkgHc1VBSiOM/r75OPLyGHboDa3W4NQa\npGGV\r\n=qPHA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"2823ae3b9400ca5d94bb88e62a62e53ca5580118","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.16.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.15.0","@apollosproject/server-core":"^2.15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.15.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.15.1-canary.4_1621451290872_0.5756046307820484","host":"s3://npm-registry-packages"}},"2.16.0":{"name":"@apollosproject/data-connector-postgres","version":"2.16.0","_id":"@apollosproject/data-connector-postgres@2.16.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"efd1edfbecf2d5783cd5ba3c030ae478d4b171e6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.16.0.tgz","fileCount":118,"integrity":"sha512-7PsLax1fMJtgQ6c7d7MWaMFtKi4I4bcUN/mMfBB7wuE0digKN0P8wxibBXKvN6n7SC9rmO+g+tvWnIsxMQDmjA==","signatures":[{"sig":"MEQCIESiX/IlE0dKvRwFmoV288w/QEu1PW1/siWpL4upGQ9YAiAk8Epe/QFvhgbcnachV+3OFm0W+AbxUfuJ18KdsKreYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":415075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpm5yCRA9TVsSAnZWagAAe+oP/3i38M/OOjQWFwEwd1Cl\nW3NUVlqvtG8h4FBWsjF5c5Kr5fu8uvOwcoWhAz/pHXI2OZd3Qt+gDb9hJYFB\nu9qfV1e3cIUsYEAHXdbXMPv9TQEuRalsNBu1CJkY2at9z5JZVoZc6/k/Y3jy\nawtepkSksFJknVUwFqgAS9ThNQgyrpToOnt23i179w2dfw96L8StlhIfxZ0H\n70uZteTJLARGmZQCY8pEtJ+Nrk4OWfLB3cyYgjfO7UtTJFUJcE/8vwgJSWsv\nLtKHtd7udSjgDpizENXExgmxvcmy07bxo8KjFxd9hSmZZ7vil8Am2SA7fhJ6\npfSfBWMFOTL8KacgC0G3YZL9Sxc5RcmpUbEAOn6bmHHuwTaqw8D2+nSYJKM7\nadY/E8HOjH32mflBsjAorI/54+n4elk8YINc7rvusCTaXE4PAsaVjRWl0PjP\n9nfun7cuTfGP/7rHfMFKqZwmrLRYJpguOzUTGcpz/bg+7Xng1N3u6QMtXH7p\nK+7Xl72EItA9pf8FV4eu6A4CJnPuk/Fr/SkcCOS34kWhBpVOcOhsTUvHwJ4u\nOpoUoXjl9U+dnbW34RLdeGgT8WrpAhxGBvR9WQgvpiPXAj4xyfvbigL05pIK\nfcQ/sr7M9gCDLiFe/pCN8zX2tM/DbRuZqxnAo/iiVg1zM/xYsFoFmqNbQAfo\n9lKs\r\n=2htM\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"ad284a0df6c7802af069bfaef61e51789697a4d8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.16.0","@apollosproject/server-core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.16.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.16.0_1621519986416_0.40990860842343735","host":"s3://npm-registry-packages"}},"2.16.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.16.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.16.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"eab8703f67ecc140a8d045c441452af79999c5e6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.16.1-canary.4.tgz","fileCount":130,"integrity":"sha512-IdlvCFaSaNIJ09We4JBIaKdwhC5nr5ynJJ1rxpkoWhRiLh+1/bUl4f0+H+DTiHuf1aEXQpc3IpBp2yEh4KvzRQ==","signatures":[{"sig":"MEQCICxguFp7BsgbnJ+E4OeYBeob0kIoPBXp4Ux6p13l4jT3AiAVeX4PHuATi6oj2Lxjs8W8AIpDQg7UF6Jcc/f4pGWBqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":441467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqA0VCRA9TVsSAnZWagAAIPcP/iN80huEe/Kv5oLgRevH\nyuT3MDGaJaHngK80fEdKImK+8LbiINkLAfurP/mGf7LTkX/wZUMv7Mvsf0T5\nyRWfeIN8VkpYbeUSldEKj1qlhPH+GT65pGXXMm3JGZn/D13xyiLbYFoWsqi3\nmz5T5drHBO8kJ3QcjdNPIaKnKmMoM513jCtl/6KObyEIwBtSanGwwMIhOqfi\nQ+tSRF5TZh6lPxU2u+mGwxTTeFRyMxwPm4pvY3fQ8SMHhp7TNDIzfhDRiuvL\nhIItKWKH3fXt0xFLkIPObIrCiR+GEmDXRH6NJsuR06mEUi0mNm7CGrcxxnMZ\nffH1fv5WVbB1a+KdWM9253kg+MqudIdBSeOEY6YLg8etfaKKUYw+S738/SfZ\nUr2MIF7EKUgWbg3kqaY3zS7ILUjvAksE+ItB1/ge538hO3awCNVtohN7POXs\nU1WBtTQi2LW8+GshrPUC5otoZcEeIIxhU/OyNIXHaGKkzlFrY7uzd5IXUXk4\nfGfj+RcD9/X0iqIT1slo0aWSCP46wS7Lku8NqVwuv5jRWE4+gThT1RE6tFSI\nr3AmG2TQHou7oQNPOyUBzTpAk/vyAclnn6yg4OVHwXywgNQ+itZAh/I0lZaJ\npThDFwCvA1O6HZLTazB0sW1Bw4X07uCQfmi4k/djAih1Slpzk9jbv0rD2XAd\nQge5\r\n=3SlZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"e35385dc294d20301dfc7ed3ab3d8f0f6bf6ee39","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.16.0","@apollosproject/server-core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.16.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.16.1-canary.4_1621626133357_0.08273225437048759","host":"s3://npm-registry-packages"}},"2.17.0":{"name":"@apollosproject/data-connector-postgres","version":"2.17.0","_id":"@apollosproject/data-connector-postgres@2.17.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c806e3aa4c820657bc54deab0da29e70802104b2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.17.0.tgz","fileCount":130,"integrity":"sha512-ciNrAfcM7u1LWo6Y8i9uM6HxwP/XWU6UG1zOHroOWJHdKw0Va7/o25JEAiF++0BiF3k7NGBnTgB5V2ByHipLPg==","signatures":[{"sig":"MEUCIQCYE8ZHxDGQT5Sa1nDh/SKdY55lYmKuk3z/0vxB3HWNUgIgfj6/AN4vRUxaeAZKsnCQ3kIpu8oLV02AF1Drxd4t1Fk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":441775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq/OPCRA9TVsSAnZWagAApKoP/i7Qzta4dX+XV0/tOLgI\n4BL7EQpN3mhpJwhiOlikYBh56zB07lC0ljAgwuamQcSTiVAyGPVmvXEE1RDk\nUvL4cNFUN0kPFUcFC42dAbrUFMfqeSlvioklvtTP1LtfTsIyrxiEC4laOGaZ\naz8ozxX6YXrBRAmrvvN8w8gnMjajFkaamlBD6qo19O4sU6kP8NYNaHWPuBrD\n0No9ST6NJgnQyOi9neVMDSjLVOUm1ONwY45AKGbtoYQ4TXHdCcAxdI8AlK7H\n0eguQHOTdh0wffuXYUPpgB3Rq/6bSAsH2WG9BkJ0vJt5zwYeqD0CW20/06CV\nBHHppd6PDUVLng7afbg/Y+VqkccA/EvTkTndC3ix7aQYTVluBiqLPgleyPW2\n1uk1w28n796fB5u0ziSe3nXjCQbWmVqZf1p9yUGvFTYCKRuoFXh+ueiuBLYw\nExNICpKWUzy6ud6QE08cBaAcNERd0FvPaMwPhKMR2cPwOR/PzabpKnfae6wh\noMMqNU1qIXSIwAVfqrq4RYDuHXZCzGk2jZD0FC0vIjJIzWS7oDBT0A7qc7TX\nximNleThndyM3UMce27cpqUiVjdifPy3ZXL1sfdGsdbOhs6XVWdYziVipPG9\n+JivhZ0WyGH60/uJ85jOFlonHRyXGoIsQlCfpyPWjza03F1PrEjvJ9W6mu9N\naqKP\r\n=G9+U\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"008f0cb96c1a1c1ef39a35216e906d6eecd3f11a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.17.0","@apollosproject/server-core":"^2.17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.17.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.17.0_1621881742803_0.019385119180457044","host":"s3://npm-registry-packages"}},"2.18.0":{"name":"@apollosproject/data-connector-postgres","version":"2.18.0","_id":"@apollosproject/data-connector-postgres@2.18.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9e58123b0812e8b41bf81298c8ab2527607210fb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.18.0.tgz","fileCount":130,"integrity":"sha512-yu/Up1won44KpK70Y8OEc141MhMc8DX5jTGBHkgYKAj7lSbAdtm8hbrAs0XF4m6GJIc3fCZmP4h4KNBYtBgq8Q==","signatures":[{"sig":"MEYCIQCOYvdcW/DnI9dga30b7nAwiyhRUpIbf481fQit/ewg1gIhANIYSY7msnipbQY1N0F12TpKa6D+307145q27Dcz26Ds","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":441960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr+OsCRA9TVsSAnZWagAAzSYP/RUgRL6qWjnFAEC/U4Xi\ng/CZ5THsZElazQAxGbnQ32Spg5zb+IxDQwr47HrpnhvHsmImDFBJbVkkkD7C\nIII4nardWS0xvsb2bwCg3Ge4AkZmwRzeefKOabqv7ZI35O2OzUHd+14sxMSm\nbzbyiJrPFkltjy41lIKJ8rnaUD/SNUnT/PTf/NoXQFSg11WaRRdOSoctlaLu\nW6LAoLsjlubfaVi8XT/jLQ2YfoWeoUim6Gqhy7B8Sc6FWC4QXtGfoLqJfyR/\nAtAGxmg7yCOOWCIw9I4Ac7czU/cFcEjzpfekXNcOZxCG+oqUZtPP3O03EbJq\nrXhlm23LpSPLFE1ZDKmrnNw0nziuiYaITgxt/w2A/RAUnyroM4FyIwzck4u5\n2zxmKEg34GnXacMGeLdvaFYnuIsnvfIKHm4WhXJsSER1mDEF2Y7LmLulkVLN\n5I/d21XV+SnX3bToFVLj4V7WTPyZXsmhp91FrbnCNKtqcHdiQvtBoqE0t2UW\nkyujAlfmvlzvIAyOAgSGpVysKjsL3dH+uwQV3xueqgmTuQ4bFzvGNzLncOtO\njeHqmKCwnfQa7JZcCBErUbecjVwRED7oTpPOjPTEPhv34svfo8H8WL/ekNJv\nrxF4h7lKH0C1qQKFmHy6MWDSY29HXj13UtOQzVaSicZ7/2cKQv7OROW6z20C\nkYN7\r\n=xjNJ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"ec65d9c8d6eebaa1f85e64a980e8af7e5f41e6fa","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.18.0","@apollosproject/server-core":"^2.18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.18.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.18.0_1622139820042_0.8502363895551046","host":"s3://npm-registry-packages"}},"2.18.1":{"name":"@apollosproject/data-connector-postgres","version":"2.18.1","_id":"@apollosproject/data-connector-postgres@2.18.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"30b535ad629a4874439f22c1352a3c18e3bb1853","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.18.1.tgz","fileCount":130,"integrity":"sha512-FfQz0dVSRJwFdaGKqx6ikWodHsknIc6F8bUqUg+AthWZ7NQwKXTWwbVD6voy76qqyMlyyc2S+R2NtrNYZk3Whw==","signatures":[{"sig":"MEQCIGiEi3CzTLS4njqYm4i0Cl//aNikjOUXuQ+IPKZDDq3LAiAOheY+0Ocq1LEpMkl1IzafFoGjwOjK6ZC2SqvWrUquUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":442146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtnUJCRA9TVsSAnZWagAAxvYP/1iLUjkoiLnCgvQCqsBo\n6/ZT5jvpcCvXYyXukcTvpBWZ6rQ8OXLsdFGNeMRGJisj1/IPVTAgE7HzpOgp\nJgsSAFjO1WpuAFBMCUNK/TFVwSZmXv523/J+f/kXOhtHmbf0GtEU3gUdXtaB\nWoVA4K/cl7yd0MWE6WecD4piRgEuxruNonXbrB1s+dOq90HhP/j7i6x4DVFo\nQ8mgdf4VWLgFki09EXu2Bb7G7Qxi9VkRPojPlbIbE9d3u74lUrm18RaYjHYr\nv+q8NXyZmckeyW00q5In3B9yO/cNmQxvRvqw8OdEyqfkynUapE8zCHAqUEuZ\n1yBE9uhsi+SzSWnloXZPxDZhKyE//dhYML5ITbaEpcqze/kjo1bYc2r4+9Af\nzab1FGVCJRzbd9xbrZMc8byS8br0Zi9dTmTwgJa63xBfFdge1RGtsafe7UB4\nAscNtHQnS0qCIKLSTfDp8ExYAWdTcZz1pAbRgbtH07btldl2p4SMQCx2mIDu\nS6dstWw8d9q//mWt1KKy1qs4VrpS8+u5gwpj8W+c30yQnrIDS6QoN1VYNHNB\nznirPEl8pmMvzV25kSBkdjoyJpuBW+qSQqLwHk5UdJw5lo/Ki7wM4B6mqnXn\njpywiDCjrk8rjff8Ak+DHukjltTCOh4FqEoP0C2UbRVUJReaaZrB2wlyV2WY\neTGc\r\n=3Q6S\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"94fd41c7dea0690b83e5e8796a06c7bdf0a7ab98","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.18.1","@apollosproject/server-core":"^2.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.18.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.18.1_1622570248926_0.5697663743738477","host":"s3://npm-registry-packages"}},"2.18.2-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.18.2-canary.1","_id":"@apollosproject/data-connector-postgres@2.18.2-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0984a74c9c04b8780f1fb471ac310773fea76886","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.18.2-canary.1.tgz","fileCount":130,"integrity":"sha512-XIcuSPJ5JvVqM9Jcr8wDOsFma81owrPIo4xE5rXiE9O48bAlGVuUXkL7OEJQnFl0EhmYZW6R/utyTEN39et2Zg==","signatures":[{"sig":"MEUCIBg/uvLxtamoNnuZ4h1m+0S8veKcK+yYesqlTBtf7gxJAiEA1E/cSPWB8an4qJ7RKgt8tRH9uP41rgBtqOtCLVEsLu0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":442200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguPEbCRA9TVsSAnZWagAApb8P/i1ISyJTNs2COLykRkCR\nkO+grvtRijRR2tit9ZCKNrcrotyPk2o883M7fztLcrjM0KU/gTbtsGPI+QaM\nKUF35CQbTkgyPgut3ag3giSZ+xL+YUUg1FmxwJANEJVJ0RMpqjhpNsn0KaHp\n9a14uvQbPlpBivftryHwNwzCdfyLpF6sn36c6WNbs+dBvqV2Irstql7OtRpV\nPxc+VgYpESKbELtJzhTKHZtl5U8LMtUBf7Cfwx4ZE9leT7jZ5sQ9+iT+G0HW\ntPjY2h2msbjRpJTID8G0zcPyKHt03u0xxFsbPuoWVsgyiIhSQ7mmaQZoftNW\n7pmDG08FnnijUa6BQ750sg+jGx60sdq3NFy3HRBnjOSR5RoCLUTya4EgcJXw\nLJ9YAafgnSNLibCtoYwUcYh6zamI3z9SLy9x5T5JbGD4JDXo48Dsh6YZfQiA\nnIMT2RnYNq+o/idmaNzXuLnzztOSuN5KYXUpbeCbWilOxCDrOfYiKYz4FlSm\na9orUGBwNM7zk5sjftmX3JTGtss5h+qOCKkRzknXD2ucklnfncrJGL4uEZQL\nNxp82ortVWA2Z+b1m96cmRNktnbuPoIAzZOf7kv0XfDJ2TSWbDuIpGt+IwIk\n6lvKuC/3GbguWk5yf4scknGjXonazWNiw+hp8M1qIN6mMcUzfUKQDtPScCO+\nc8WW\r\n=LA8x\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"9658282b52e2f0e4369bb49cb4b09fb0dbbc12d7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.18.2-canary.1+9658282b","@apollosproject/server-core":"^2.18.2-canary.1+9658282b"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.18.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.18.2-canary.1_1622733083797_0.7696108732651119","host":"s3://npm-registry-packages"}},"2.18.2-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.18.2-canary.4","_id":"@apollosproject/data-connector-postgres@2.18.2-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1ebd3c0bad380ca693395f7af5f317afbf98155c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.18.2-canary.4.tgz","fileCount":144,"integrity":"sha512-vEssSokq332TxDouRvT1GAfAVJJ3aazGUUSg/ig7GMJTVa0tcJq9kwSAVwlkWjCIltLNv1uviP43+GvP0Jiw7g==","signatures":[{"sig":"MEUCIQCeIl0Luw0ICPmgVGP6uU2p3TNl/+jQIzSBvM1y7dqUHwIgRW0mEfhBRz/SWw81JWTuw6XcUoJATPEiyhpu2xPaPuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguoJnCRA9TVsSAnZWagAApeAP/Rueq9W1zMVuAG6L7tlR\nuVbd154D1RSpigtkTUq+ucxNoPPj6RHJlwUHCkFI4aZbEimXF/SJ1reMjkSt\nICZu2dp0wfkPDz3dDWObg53ysIM6+UOaOgKsATtSDE94IAGhzaBD4nwxtLz7\nWnjnMfXAAMWCIv1JtZczC9Xatk7wLMO3fFUG9HAWP4vZBaqsQ/raAgmhfDpG\n2/XMlFdqgyi9ekiCroKNv/3wCxcqCyyobN+boL4YoO1TDonDWvnatZvjkkLV\nQgWP8uYUDnBdJzapCvJPgO7c0SQoVPmc1TIsUG2dBQmAcJIk6YmeMOyRlGtz\nBkR87kjMrf4+UIRyncHFyVIfHbaDdUjgz4lbBluT5YhumCqHjZDc0xZgak/t\n8wpgIBRvfq6OtH3v0DiR+Y6JUdPm4+KfEjSyAsHmz3L35wSKnglmP8jx5GRH\n+HLY98xnotolCzW3k35KFK8UtfT9KuN/t7B5dLZC3wDSz/YMsgbnB8MjOni4\ngub8EITVyxc68QKXlAjS6XDafyTLhWXfdpiYyjaqvDEsAHFIDr4MfPaAGGzd\nRc+ecGzseMN2Vl/qgRdk8KFIGfWsMwNJHKqqo89rxWWfdI4me2H0wWY05oFb\nqdzL8gwldmYyFC8RdHJY9Nxeb5aT5EisRtGwFjytJvuaatFAFLRwaLDErKPG\ntpZD\r\n=nGEX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"1cb2589d4a67c2c596c96ccffcdd095a08299dd5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.18.1","@apollosproject/server-core":"^2.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.18.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.18.2-canary.4_1622835815747_0.8896994993765728","host":"s3://npm-registry-packages"}},"2.18.2-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.18.2-canary.5","_id":"@apollosproject/data-connector-postgres@2.18.2-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"19654abeb159cafc552c04fe2f3137acf1321538","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.18.2-canary.5.tgz","fileCount":144,"integrity":"sha512-KExxzh6OTtfflWc9OCbzIIALC8mFRQVhKdhvWsP7xFY2rtfF3QwrUzRD0czyENjnNaUCzbO3X0n50pvHSzf1wA==","signatures":[{"sig":"MEYCIQCn65iWaAxsevVJt/TUkiEoEBTNG3Z78X3SQ8M3+Iq0iAIhAIob+A+XNwBq+s7w1HnbQL8U7g35S1wOkHpyhHYaH6bH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvhVbCRA9TVsSAnZWagAAMQoP/01t/PtI3CFsIK9Gvz2f\n9EnrCHQsVby+UeYeJVx8GKscj0WArgO9AEl6Pp8maMGhg1/7GamOFRNZUxUw\nACvrKNNc1pNo18G891NymE5/F1lpcEjzchpRxsgU+u3/LG9sXGRXB0i9u2HG\nomknCvUv4N4bc7gk8gglD273Rm1O3Y9572hEY5/HFzY5pNJ/5sHyPUm7ugt6\nD41MPaXSzho2DYxuHI9KdtMZ7LVnCE3FbE+1gyhMaLE9pPR3tC3XFAIYPrnl\nxqrlyUSMzghvvQHPbf2T3nQqZsEHKKzgmI+ZnXSZCAn1Hp4qiOFWNrYqUiK0\n6aGvyct/x5O17H2bL+rOaU0yK7hVF4DcyEXyiv9VnHlCgxc0pxal5NwONcKd\nyEQRmcNupLyLfjXq5VWba12b++E6gAa0buurhQ7HvUcbNc9jShU+xJvfm1/k\niafUv9Tj5iiQkyQOXYd6TG4B4rDDWgzlqkGGH5VT4MouMVIcx0HU5suJ/74i\nmuaeM39MpjL57R3FZuVaRsJ5zhzwpX8OIlPd36/2BpTFsPKWXs0shoRKkphG\nWTe2jIGj4GeRCuI/yiqybKZ52ytFVlHvu6XGfHnaYr7JpY5NUzYZkAUntBD2\nsTYE9Ta/IOTsimoI3IENTbI64DtczSUFqxGbmJx0Wz9pxagzjF6mpTTQv7/1\nhkOb\r\n=Wm7i\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"58f64b916ea489fd44ec191fa266fd7bcf6f4fe3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.18.1","@apollosproject/server-core":"^2.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.18.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.18.2-canary.5_1623070043083_0.40851031470526933","host":"s3://npm-registry-packages"}},"2.19.0":{"name":"@apollosproject/data-connector-postgres","version":"2.19.0","_id":"@apollosproject/data-connector-postgres@2.19.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c633ec0f7988c63fa9c06885f8d3566bcdb615aa","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.19.0.tgz","fileCount":144,"integrity":"sha512-QzysBtfjz9tM3RVoy9B25i0hQEWQ0gbfLezhi+GLiyNNq2uvD44mB08DLSvU9H6ofqjo/OI25hr9XVS30HUK7w==","signatures":[{"sig":"MEUCIQDR0loD82cyVu7X/FJXMJMglfTi4D1DdLXZd4f0PDIiBQIgFiz/BTaI/kxgfacSQ/C+9RFTfn7TgHlDEtI57NJeUNU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":477235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgviSBCRA9TVsSAnZWagAAt1EP/jn5oLrjOMbTE9DuvPAy\n/8L2jileKm1uWMeeuDksglDxaNzRYi/zhqDVAXkTHBzBpLTCK5kGoJRK0GM0\n+N+cD/qt/HG8x8v11ccPr5McK/rouqj9UQJSVzCFJ2Uumlca0OTk87mijDC8\nbgAgUF7B2U8Ozv/sQMv0/RMDTZD4I+3cp0c4DfEFi3lAD2izazeuyEPWWJ3u\nQwc27zskkOmhytD8Dyh0VaOOIybKee77Jsbau7T0R5VJB+gyF0yHRm7v1vGi\nMeJgSDzdBAsRSfRGvIc8/47kmge6+E+/vq0xrn77d0tfUqjt/L29R/eSxk/O\nn/9CCX64iGyfhqP9ePdbqn61zsGo1qjdN2yYdtJlL1d2pvnc1ylm6MS2GR/f\n4/Z/cJB9dfu+dZiFAYA5uwVywsUadrIvADm4OFnc2e2Tk9wiMOLi6wreQBsh\nsv2zGRBY67TeGOwOWKG15NFkVLacBfxxfEtDIjbvrlTW1wX7ydZ0taRaSss7\nrfEQ5Dr0lwcaWonxE9N1aGdRZufVWNIjfHi/j14+YnuuBN6FPtxMfKMvnmYh\nLX+hARDDG4gshYXWAasDYPBLYwx6Rnw6OJ4qu0q+VZ2F7gj1R4ug88IE42FG\naO14bYh+wDOi37xoYPvh4285bO9UpG9vM1c9Irkwz7GEojILHvyZbBDWKGj9\n6niC\r\n=G8OA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"9ee85feb3e1be9718c6996ddeef78b2a5aed34e7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.19.0","@apollosproject/server-core":"^2.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.19.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.19.0_1623073921413_0.3650527524674223","host":"s3://npm-registry-packages"}},"2.19.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.19.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.19.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7fa30cac5703c9133789873b65999c5449f96aec","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.19.1-canary.7.tgz","fileCount":144,"integrity":"sha512-wWj9IRE1FnvjFhjg0cN0XIX1umI4IFiiYVYiB3A8utiHZn+1+14LIAdKHihbRFY9jBIMi9i7G52iUCxk5LjRmg==","signatures":[{"sig":"MEYCIQDHGv1al4SrMGfosP2lTBaKU0+gWHjEO4a/LntXwTMgqAIhAIcOJUpCW6Ab4QX071KxEW5nkb+6Gt7GJhoudUug5o7/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgw3hxCRA9TVsSAnZWagAA2kcP/3YDwUZb/PhvbllYNDaD\n0FacMdtOeqLvYtDBdGqUOH++rK3tEeR5HWbAIbFnkeJE8yZHqdC1sjoL4cNn\nbbUfG1TxHs9TNPbtnHBbqV1NCz0JTOwiNpYiily4DkRJRis7ZV42vmKjkcer\nmmcmWiSefaXsrYrNB4WCa+cybvb7Q6tFuy8fi/E7Jo4ODnD//8wtLAmqwydS\nl/wQepKNrTye4pYntVDFRW6CyLia7pH3/dm/oewuwJMr45fzyG7Qy2hgK1u5\ny1MHY08Ey1o/gXEYtGM6ePTxWd83hsmu5M2RXKUyiASMr0tWvO6s1b4SVe0+\nKvNoK5GIiE/aQCjfeMeZdQP5pA1Tc9mnOEQjZIzHeF/tk36I9IocnPizSWWH\nDcvvJH5+oRMc3k69IGOdb/zK9BeOmKww77zy08/BXtnys9dSm85K7nR9FTI0\nB7QlkZkHOLArM6K8uopLokjryI2u9KDsc4H4T+MWeid9llfLKm3/+HFfdZN2\nHCFWcO/9RuGGmOn7oT1i1FQ0m8d5QmFLIVlSmXsXR/9sbwzW/KQbAII9fV0z\nKcQQnRE7taPNsOWgfWLjovyYxdJuaF4P/K7YmmypfrATxVLVyF2KqeM1zZND\nYZT2B92TufL6axooI+s2urbwlNNrJOBrowjQRy4ld9XGtSlHoC+kfYSIm9YD\nA1fu\r\n=jmMY\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"bc6ec1db336a86a2ccd530ad3063aeb01b05ba3e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.19.1-canary.7+bc6ec1db","@apollosproject/server-core":"^2.19.1-canary.7+bc6ec1db"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.19.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.19.1-canary.7_1623423089018_0.44297370564507577","host":"s3://npm-registry-packages"}},"2.20.0":{"name":"@apollosproject/data-connector-postgres","version":"2.20.0","_id":"@apollosproject/data-connector-postgres@2.20.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"621e104085dd4f5c3eecf65a61ea0fc8d4ed1ab2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.20.0.tgz","fileCount":144,"integrity":"sha512-aGVgiPCNfRpxhdlOORpQ01Rx7o8dC8Trf6o4xRlfrHpV25tdgPKxSHsYQPCwC91ySZLwqpz8SgRTXY/sFum1Pw==","signatures":[{"sig":"MEYCIQDZB29/5Y5l+q/atyHAmGWh/GUaFTYAGFxon0//vAzbwwIhAOi1HxmgGhjtluPvL1PL05BKjU7bga6jXyxL/u8u/sg0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx09NCRA9TVsSAnZWagAAsOcP/Apxd2kBdBh/B5bQAdF3\nn7XJZElP2uhBqOqrUgwJ0iRO0CflZz7uUS6Sd5BoC2qcfU7eZl3lVKknOP4K\nGZu4JP2VNa7i+LWgIRIS7coMevVcusl2KeY1WBWNXoQcVQoD1G1EA28A0bDk\n03l5ga0oDRA6OOUSSOUasaxsXjQKgBKq8Y7qEVPpqqIKdYPURqKIcvXAhBWe\nNTydS9NGxSWs/GytQ5Shki/qgKd+Fq4KAcD+xnO/g06Je9xJDxUGbcjkIDx2\nHt2BzWJzpDq6+jXqQcSOLqK6Cj+mpwmPmFfh4N5MmH5mo1va1L3Iu0KE6tTJ\nIRnr5+3mHFR0/hj2WvbfK3R/ILUAkck0FGY0arnzfMvruMLQAzu1VQ1YK+l9\nIeMiVz3WggCldHo7UO8DlPIMYfA/Haz3VtIFGGwLO7JjfAJtZQFldIn/LdRN\nTQZYW7EYGm8SlWCtPUcHAaOv365NmAnjHt5t8QZoC0FYN/s6kOwxTOnl7zob\nGkFdOAtKE4DG3MTanW0WRbQOZqAgu518gOYweXjRWs9+b+3ngv7Mx6MsJpQT\nKTQGJT4eMTmrJydKn1BOgWKxgkdT0f3cGtEqsxCEncgjCZKmIM4FKeV+XMNK\nEXbcUD3qqys9NPilA1j9QcabuckeZHyUfv/LAzySHqqq2v1aZqepJs7+cgoK\ngh1Y\r\n=vkIC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"1495867f88c35e8462842b7f09aad1fb29d896c4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.20.0","@apollosproject/server-core":"^2.20.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.20.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.20.0_1623674701236_0.4457293993478546","host":"s3://npm-registry-packages"}},"2.21.0":{"name":"@apollosproject/data-connector-postgres","version":"2.21.0","_id":"@apollosproject/data-connector-postgres@2.21.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"86f075e5591c9a6bc23e9c4de269f5c4932f057f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.21.0.tgz","fileCount":144,"integrity":"sha512-3BzDT0Fl1d2Kiwo6XJ8IQJuxsHEDjf7kRHEyg8SHmjYsnEn3CBdo401cgtWFNypZCLSCflUjSZUio30gRoR3Ow==","signatures":[{"sig":"MEUCIQDsNOrRjaxvieYvoy5KPNyRXvhf01REriyxLvNVONrOAgIgIN8cbeQSOuAmLSyqUVSOLadoorOgHIDujMEfGSfEHUk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgymR2CRA9TVsSAnZWagAAXuUP+wQxdv9IEsIhkfjM+qHU\nITg+JnzUluartKOB8QtqMHBhYJpaR8CUy3AuFMkt1ShQU8c0kmR7KyyFRgK7\n9Q8j0AHBuOuQhk0/lJJGLKcx0UFMKAjd6d3FYMKoC4XutG6pZjVOPs3I9FJF\n5izYf8ZF6Bnw31zTrnhF7e3P8kK2tj9VmsCy27/uha39ppENdeoMsLXcBd3H\nAt8tDzhUCwO+knir/nMiWIA7WZhI7mtHujpnzi47AGULSI7uXe0yOUyXENOD\nqMLfToNpHSgr/m/F9Hd3iVCuwc7yx3Aphm2A0jZbKDlXHI4qm7R/EWCtz+6n\n2EAlVCfv96VewzXwjTYxfOQ0gA0AOK1vFNdaRFGhN8AbKOHnP/u4Q10xML07\nH4sftuxF7Yj29BPHuTwr5DqaYdzaF6pC63O6R7YBAY5b99tUPXsdEKqbr+hn\n7+96Ji2Y+0cTaSgpQWd1U4Urp9Ta1SbCpjfNrPwJd9A04j0/vsRx7cBKHERh\nQbsAq0PxZlG0Kw2+ia8kGu8JoH05/g9V4w5kls4967HfFV7iZ5A/2TGgCgul\ntPAn1wotrDCv5OZabNs3jOo2Tv7RHhs6K4+5Eb7/acUusC0SVjCiaQjdlkrL\nuLJQSCVeegSkb/m6ijhnhtD6B0nfB7IDOJOGsC9BWZTpyqUasgd+dsvjStQP\nL/oR\r\n=ggdk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"e005cdc1709f1c91ce3ba308aa65ad2532a08630","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.21.0","@apollosproject/server-core":"^2.21.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.21.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.21.0_1623876725924_0.07669938980300417","host":"s3://npm-registry-packages"}},"2.21.1":{"name":"@apollosproject/data-connector-postgres","version":"2.21.1","_id":"@apollosproject/data-connector-postgres@2.21.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f65a561d81bc8597f9c77455f1d8756b1afd89bb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.21.1.tgz","fileCount":144,"integrity":"sha512-NXJIQRutMODn3NP/nMFkCGrFE+iAN3DG1LCPDdGFLuwj3tb95/o55VaxUHwwrlJ/nlNO3yBdq1Vz6FxhbU6NrQ==","signatures":[{"sig":"MEYCIQCuOq/3wKStVas6Yo0MLwkDyVI0DcNGWkJg5sp95VfDdgIhAOhsMJFSVd3LVoDGhc+J3HvXfIi97bHT/8ZFJIDIJd3/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479270,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgy26ECRA9TVsSAnZWagAAZdoP/3o6swuRC8VK0LsGVkss\nornqpQAeRksgb6KL6ORhCBgHGhAd6l0RDiD21WNDQZwZkS4IWOpPHbzS9FRX\nmGHPwG+z0PddzAJXXnJKsElRiQ/Xl8JUVurQq51Q3TriTHJDFnM3soflxMnn\nGev2PwPj+vKAbGgv1Ifm5uujtwRyLmSxtpnmuSguT/IfFShsIjTPY8n6W9sJ\nNHJAqSdlKmVPsZCIkfPz8f1/NYkewfvw/nc4WRlxxie5vTd1ymIESeF3ONM8\n4Guouflah9PG8ne1cqWDHt6WCcqqh8inngqKPgCsDYBci53uSuYos/22rVHT\nxCYAemO5z3ZAYYGfaWXjMuqIUZ0iYTQ4jZLy3DJaL8N8mTZ+XwO/lLYgim5G\nRlf9GEWEsiu1fx7FOIGErsyK5ZDzjttYd+aflK7jQPNOURlMzv3mDdlLAapQ\nC3oEPTYDsemC+ODXe3Fn6JTACoNBPbw4fnu0M2gpx9Z7nN1eK5JxRCd7e5Ka\np4g2onxP53dls9CE3UEN4gFrPA0y7xFo+/2yZpIabF4cHw7aq4ujMx9uJEk/\n/IV5vRD/yR+cNh8HjcKjFqJME/+tyXpbatltJsZC625w2Ubv+51Q8U5CiO0g\nE4PvaRiU9riakLOW8MZ2gN/Ql2aHYaHwD+M7VKSasB19+4LV3+JNVE1yVOaH\nhoq2\r\n=0pSm\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"ea79f438b8c422ae19803d793f96d44a0a4d98af","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.21.1","@apollosproject/server-core":"^2.21.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.21.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.21.1_1623944836079_0.5596958283958764","host":"s3://npm-registry-packages"}},"2.21.2":{"name":"@apollosproject/data-connector-postgres","version":"2.21.2","_id":"@apollosproject/data-connector-postgres@2.21.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7eb6e9c48fc6421d4cb36fa39ad662ad3407605a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.21.2.tgz","fileCount":144,"integrity":"sha512-+Uy+sXa5nG4IZdWDeWJQ9ew45IdaWwWBJp05k58bE1xCmMaGNBdBFYdWLEUG0FvqstUPe99dHRb6Nmu5oMX7xw==","signatures":[{"sig":"MEUCIQDVmMHMD0YYG5gM0EIoYKhUxMJz7lJ3jF96iEFxI++ycAIgd7bAm3LcfGxhS0ZuH31HKJ7ZhavPOXGvRX1Dv5viPoo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzN2oCRA9TVsSAnZWagAApSkQAKTine8W3kTEsVlMQeSr\ndUbovvpXaYfxZ/2KBT7kuPoP5lKtkAC30+RQ2sKDfCruj1mQp30WcqW+6MHv\nmn651mR4DBz93Fw4/Dpu14wvfsV2LI7foMj7nXIvpKyqgDwdmQ+5rFG7Ndga\nRME8ITywdTcBwXsEhCJiE23YBJSFQnNCZslvAsS+dRFbraaovFkQNF8uMvr8\nFpFne3gNPFW3Rn0QRFVUklwM1Ww/52NXXYYEaHRgSAklmWB/36trj/7te7tf\n4O5RjvHe8t06iRoCn4W0/II8ToFMIXjb4b1IKfw2Itq8TAHepqGyZqk6TD0B\n4mBs/QtOrtfG31kh3w6cdhYrx/vrYauo4MAcuP/s0gY5dvMxzyfXz+UXjtQQ\nJbUpnzhZSS55/EnuqhO4LAmVnsmqs5rq1WmO6M1YtNBEYPFrpHWLXkuj78mj\ncsoPojW2tB/n6lWhafQH8BFdL+u0gOjNuAn+RIq9DPeNRCE8Iwni1USmc43p\nO7ula2CV0F7Xv1/StGCi6/ZprA8gM2+cx5xrBRUFC/J3CbO2dDIlsYHXgDIB\nfIi+6PbChnT9D7E9a/eWscvFWbx/EvI2V0hShTdGxI0WZt1FmPWwS9qTEuzp\n4cWJhzz1/Tl6OKNcK9VO7q0JFRyUhHpSxAcRGtnmHBo9r59o8KHpDrd4/wWC\n9U0Q\r\n=Cqg6\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"92fb733c108694c7deed1f564b3eadbb19c84dd8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.21.2","@apollosproject/server-core":"^2.21.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.21.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.21.2_1624038824451_0.6014753617533857","host":"s3://npm-registry-packages"}},"2.21.3-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.21.3-canary.1","_id":"@apollosproject/data-connector-postgres@2.21.3-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e5c0c143209d79c82dc01179b4444f730458a675","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.21.3-canary.1.tgz","fileCount":154,"integrity":"sha512-mahEcn5RRtBnI7p3i2JkksyWGm3LGpMsy8px468yKFOjVPIgBws/XUvhOThZP/V4KAsyZWEklIYwb+eFdAl1uw==","signatures":[{"sig":"MEUCIQCvgSyY80NExrZ9mu9VYzxP77Dk7QjWaRn/oLzYH9hQ3AIgNlIpVy8AjnfB7HQX2OSRr83qw8EDs4KtYTrzudSWans=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg028mCRA9TVsSAnZWagAAl/AP/1+ltFof9GBxJtoHWtRZ\nMCwIYONuxgbnEEyjuSaXrX1/GcNA6WI0nI0wDZzIjE8/+xufC5f3H7aBbp0o\nJJeVFgdJom3dmEnuVXFqyBFUfWjK7+vgNYQnRlnvkAk+Cy4fQMsVdSu0/k8O\nqxG+3JHCgQswRnkucIHL3dGFWMbKbdRwbynsgcw81GPkm8s+RnIquN4qcrs2\nRduZ4bd/OnZ28fVBAa5Neokxbk2vVsFwu6p7HorW6D7quMzbnZhjgwoL/njy\n34hHmSBv123nEqBpT0Aa4LKCiHborE73RW8xOzBqagMQbXaJ7LZ+qAisNyKo\nos6TCZWDwjsJINhnHg+CQQwNKuruwIfBNzwAsIdJPSagIlgJiMZkE1ABQdPo\ntlQPasN8fNDBdHY++AD4foK+1aNOneCLqueDhGoST/PIcPBeY60xfBHIBC6O\nl3W9KgLSmeqh+FdZ1aTx9YGeLYJH6/j6OhW+7z6ef5hdstKr+bPDE8Hm4n+L\nseJ0WVEEJuLgbU/FaDzmr3+I3YC+uBVVLkz9XaNFHqFe7I3ZP3cl28oHup5m\nuWiggyqSgNFLVwuaAw4JmyvfMOi2uldFKiuIrwOBIiRWCRlMjJ/SG2/tY3g2\nydsIKW4plUeA+Fk7IoQad0q9FLXCN1mVDxE8m0mHusXw6yH+YwjYtco2LAe8\nSMmk\r\n=4NxW\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"0fc23a42e0ea974eb7fc9a51537ea46861c2fc1d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.21.2","@apollosproject/server-core":"^2.21.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.21.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.21.3-canary.1_1624469285680_0.32613651777363684","host":"s3://npm-registry-packages"}},"2.21.3-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.21.3-canary.2","_id":"@apollosproject/data-connector-postgres@2.21.3-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7c9c42d365f51703e7d9dc48d70aa1ad64d15145","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.21.3-canary.2.tgz","fileCount":162,"integrity":"sha512-v+tk/iL7UW+3hY2yEcdFq7xQl+nqgfEshVRxkmLrBM+wKQ646CRN+MeBrwv2vLxNSFAeQDBKIoznSrFOexPGWA==","signatures":[{"sig":"MEUCIQCudERPzJTcdoJKwjpXMVcCEjnOGEmyNcBRSI9ZcDRiaQIgAbkrNf3cqZkm21zWEI3k5RsDrYeEJ0sS0EitoW1cTsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":496000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg03VQCRA9TVsSAnZWagAALA0P/RU6BHJPadGC8QSDI20H\nBdRpkfU92cBn9yUN37X3yzWXp4y6RAZR6kOnCGWUi3jZhlR+ERkkE6DEKY8z\nu9pfk5tqLfQV4zs+jb1FdrvTk2N9jmmCV/4Fd0b8CFOQxXH5xdQza+P9KpXf\nMFUKHaKrD86FPfZt3B2g+5mE1TyPcvLh6HddD0fsf0uMMj7FoJ+/af731j5I\nF3j4CVIVUWqEWj+iDLg0iAgsY5sJi+raylU456l1KA9Ms2lx9kxyrUe482Gz\nNLCvbuUBMF1aP/MOXrcNBOP1r5Tc5I2sARKZWBHxxUxcRFboWb8XwUniv0HU\ndnd2eXgTi27ahx3SVuTED3uLTyW1Z10jimQokkZDr6z2QyATOV91EXw91Kwc\ny1O8+KkcNr43VupLbMzd7BcqAp1c4Q5uUI8+i0/KnqyuUsEByh/em54lF+Ll\nJWCfkJgRkKjzX0uQuUEJogWo0zUlEITzPAGQCEji4cOHfgjT7Wq355EfjwYa\nkkTRg0t4qzIyI9a4AwUkLoEG3fIYcPWBGxwQ69wuWtJgE0m1V67bBS9lPuHz\nUC5m9vZs7FLeLSXgs2av1Z8f6jCJKWkAxCHoEa9r6xYurb0hnSD4gZ7N3BNg\nq+RbKX+33vsE+3wBew/L28eRrYl0mMNOEGaZM7FF+amR6tSVL0jeKHCcxSlV\nb5lh\r\n=/bLz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"870aca5189e92b38d89b57b6e67417a6253d3206","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.21.2","@apollosproject/server-core":"^2.21.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.21.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.21.3-canary.2_1624470864089_0.4442797106832006","host":"s3://npm-registry-packages"}},"2.22.0":{"name":"@apollosproject/data-connector-postgres","version":"2.22.0","_id":"@apollosproject/data-connector-postgres@2.22.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0b60374d41a41d52dedbd1e2414920c725ef0e79","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.22.0.tgz","fileCount":162,"integrity":"sha512-yNloDgKpLOSYQrp/XGnsoabKRi+tAp0vP3OuIm2cJ/vnmVx24oUDIn/7INbxnH3N1ALWTnhX00MYfGOJEMKXdg==","signatures":[{"sig":"MEUCIEjxAAUdb4ke1wQcWBP7eiMbnjqvd65DqBkbJd2yzLPxAiEAljs1V6o4jAj74RgIoNmFFzmVEMlz4KV7Yf34ypVkTtY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":496528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0317CRA9TVsSAnZWagAACB8P/ihH5r+ytjMvnWYCnVGe\nO/QUtnnIwX2QJmSzRtkYqopsQOLSYLX3hN17zC7k31RQ0PXMfRAWih2Qv+xH\nyzl08jjNUy7Iowww95QIml+y68+j5p42rz53EHf68ko2Q9LC0c9+S8EbwKcd\nxPP95COmcaSARjkF8UNw7wo5dKBiS+mup8MDhT2H2+fmIBlpIOTq7Q7FXeBY\nBicrOLYROvrf7DdfXqb3Uuijr+dXT4mfcoHTOiWzy46lL30yKfYA46z3zYnf\nFSnVx6HYGd/Rvy9znjHf12FdEC9EKsDBvccIZu7pn1FGv2iQSpvoI2+EWruI\nOOKMPvtrSJCGw+iyyYy/6Zwh27PKd3KhXCQL8gSvlCsXknNaz97wxBp2MsAO\nf5KSNineGssPaTYfKORFnME9h0hZQxf3MEuY6G7NEi8MB0lCiHmv0Rcw6YUo\nPGbuFvG9f1uJxHyMW4fk7Gk4GelwiM64RSNFyZznDqjQdnbZoxsZkZzQr0Tw\nbIJvedJhRo2Jk5jJIcF3ryAmXI2AufOijEwIto2TffFxJ20xXfUBrjRKvZYY\nOFN7BXdIpPs/dtT3vUAvlOUn2qgOf4kHqYdR26Kx9+jZcEfJ3A39ZtImCTKR\n16ntXEaLNawv++AXkr4BkZzllR0ZgmVF+lhqgm+CY00nXGV0W259n2+JXNR4\nJfl4\r\n=hkJi\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"cb462a535f0424635319d010a8cf51aeebfa2512","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.22.0","@apollosproject/server-core":"^2.22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.22.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.22.0_1624472954742_0.26201138182016326","host":"s3://npm-registry-packages"}},"2.22.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.22.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.22.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bbcb88643928c1aef47f12cda5dd9e73ad8c19e3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.22.1-canary.2.tgz","fileCount":162,"integrity":"sha512-rlw0/J69Q9GzNRbdHL6qNdHM3zKSarbXHU2INsqYSlkFKPVNAeOMqIMNPGRhy235MnkeJ/TAFfTjA3GE4qL1Xg==","signatures":[{"sig":"MEYCIQDTaMI7Nm4Bl/jjqTiCBVWJCucm7nlyHkGSTIMYG1PPKQIhANjaVdbQg5HLGZNp1gyht4HXS0XLdAUxAwoa2GoN0nqC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":502956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg04WyCRA9TVsSAnZWagAAiOoQAILXlrCkiXW1ZXb79l+e\nQYwjTUItOYLqYn25Dt+yzjKxQViiRoN5Tbf4anJu9q5idytUwmn8LBk8iG2g\nvNPOsJ8hjTLo394R8yYojSL+esytJy1C2JyNkfTP3+cQGQscrUdRYypVKI6X\nFHNMq/iDFSvbCIukiM0g0eZp7UnJwKgHtOnKR1hTgCrnL/ud9+FmS9gpswGC\nPZfHpU9b35xxChs44D43UFaMTkivA9LpgvOkojevMoXYCDrBKov8vGsy2S9b\nVajnObSTfNFDZDjUsYtu/ctZDP9SaaPgZWl1OP6TrM4m9eCibu8Xu2Dl6h6e\ngiblnkBi97zVA7CcuayDhPZbeerjPPCDJKdsTyw97ABmjbgriQx/JWJIzgXp\nssRDFpl3PovJFhPbl54EiH51wCRxBs0RfA2qmADf+ZPt6OIfTrHGm/7KxApb\n4QU6pTJezzHWKyw+EhWlF5bFOxu5QhoRU/1Pc1mnqY+9SAX5FEXyzUUTsHUK\nXDw0+QCe2jKAhvhAm9S4eas76auSyXnWto8WxeWtpsr8s0m0G/0Chz4xWkBR\nanDIpRGnC3d6FoOk6GFHTs5rPX3pk8y+ClIiCXYYvDJwJJxcISPkkKAhpDU5\nlA+8CatdNRV3K54uK3u7WoC+DivkCgrrLgJXLfNOgw1iXacXZZ5Od1YBeUqc\nC7rz\r\n=UETM\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"f84b2b7e50517cc5ef6c32a18f77546f41c85d9a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.22.0","@apollosproject/server-core":"^2.22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.22.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.22.1-canary.2_1624475057697_0.016877203062976243","host":"s3://npm-registry-packages"}},"2.22.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.22.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.22.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"84133cace944eb94c58d58eb0555bee68bfc78a0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.22.1-canary.4.tgz","fileCount":172,"integrity":"sha512-ZFFit3FDYDYW672GKmH6pbWhZRpXg1JDkVzcFgXKb01IO8azvI29tBn6m/s2NaHvtt7/Q2zG/9kaL9x/AnZDQA==","signatures":[{"sig":"MEQCIDvOlvTyaeECQkJDrUEDhioa68D2PXvwAw6tQf+UZzw+AiBTmTSaRHJgWTghl+Oo+P+AMrdm/jC0u1L5i0ABHBXwIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":519133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1L75CRA9TVsSAnZWagAAgm8P/08B+IZ2GpCr1wGB3S3K\nYJQsfpGUiaY5GApt6A4WjgqFEYcC7YiuxnrZk03qfHHE3BUxI5vZgbA5KCdb\nWnkG52FKMrSYqEZyb/jGNh6hAT5Dy4NwMkUHD9o1NEud9U8v1RDsvJsl26rl\nLWUzQ4cjTi1G43UOsuWgby0U37UJO7u7HX07i0StFrYydYxmFzdB+VwhnEwF\nAN0sLwZDXbtxTX9CBatDJD1ehMX+aOr0IYjUuLSIn0bzKVJ8JzE+Fc2nx4nr\ngMpQdAThjJKZtJx66ltfnjShLcX7RpisoYdRZkslYh4OAaA8goAKAiTjekB8\ne5Mo6szg3BpVSz9ZWjncuaHYybqSqCLv70/D/FIEhdXUzP5GGLYSWYkXDqZ6\n1+/cy5d0vNRvPCA8JdYt28EJKOFniQqa2WtRE6vGbojd53abn78htNPjgjPB\nalBCkZXRfZs1S3ZrxHNVTH+vjaQWHK0/9wkY8kJax0Vd0dsV0gJl+GIh9GGT\n/hglO45gD63D3fLxTEGbGFGrP9jkVyxkd3AZQmsTH65ejWuJ9svxZC/U/xoj\nGDOZihRmVdZLGSpD6+7mdNj11f8NXfRMObkPACnhyVT7fbT4qCFrJq8p8AEG\nG/Ef+Mxn+azrr40KG5VsMaYHAxTnw09wyz7nAvaSusUrde/YebzotZ47oe2J\nDG+r\r\n=IirO\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"511e3a19057e0f7955cf12976770726f4de7574a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.22.0","@apollosproject/server-core":"^2.22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.22.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.22.1-canary.4_1624555257210_0.7478621298355312","host":"s3://npm-registry-packages"}},"2.23.0":{"name":"@apollosproject/data-connector-postgres","version":"2.23.0","_id":"@apollosproject/data-connector-postgres@2.23.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"45b59d77597040a8ed8f99c1ed5b242d70b55949","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.23.0.tgz","fileCount":172,"integrity":"sha512-W6T1LlaoIRRQp7juEOAnT43vU+6YRg5Um7mw0ybUpKhlcvGJ/NvdnWec8VgWG0qMVeToombjkdiFO8FQ6iRbyw==","signatures":[{"sig":"MEMCHyWxuMTkvUGvcpsQ5jqKxNUOOO6UEpfGQIIDa9N4uGgCIFppHay2mLl3mc93ObzpCMAux6ZZqYh3YiWJ7Q1P5XZ1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":519675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1MkiCRA9TVsSAnZWagAAXrgP/1Y0QJqsPOLQj8qg1b8M\nAjd/WeDwGDbsMV/1p7cLsScpZwprzUHUcu6qerp98ykmGiejFiEMHk/I2cR/\nvVoRAVvBzUdHtv+AYpOdgWJxsZ5exaYj64zebw9n1T8jGOzgKoirOi6nNOx2\n2LVf4yxxU5FkG+FmLRHvb7X+IXu40uBdk32OfmGxEKtpMCf0Ib1UNVtD8rCU\nb8tc5nIs+RQPAFwIMjyUGYPPOANUFgfdXKun+OYkf7VV424uqCcCBihrSKWc\ntgaQmiEwBMYZPwTh9wbDHdZjW4mhJC5a7oieX0TODryfuF8w7XzIOWWuInqi\n2dewc60YjCgBZtJ0/WLmYom1dn1FCuIOsAKyBijDoeb3C5Zqt/cy1XzP0b6M\nLxgX5SLumdJVk18V1mj0zN21pzgputr6+uDVd1ZwMucNUL1TOWn1DGufCarr\nGYm+utpZIHzzZssx9IQ4Ncl+BFCs48T0udqbs8S4sJh+572s6GrmX0BP9kv3\nqQwvQsk5/TugXh9bWO7PZJOK+Bz3c3ApuZrm3Hq8WyE2/UJzC9QSlBzZaux6\ntE8D3bqahy8JLtBRyPs9M+Xh+BWVtURKr9xhMd92N92wPe+35sNoY36kpxgg\nklIee2EHm9KPndwnXC+UjttvZNMOeq/A9unzBBpQ39QZ3Hdenqvvai/kHhdd\nTO3Q\r\n=Km7q\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"de9125d2b9149891aca6804689dbadfef767568e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.23.0","@apollosproject/server-core":"^2.23.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.23.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.23.0_1624557858504_0.4453241323098285","host":"s3://npm-registry-packages"}},"2.23.1":{"name":"@apollosproject/data-connector-postgres","version":"2.23.1","_id":"@apollosproject/data-connector-postgres@2.23.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a2ea22e93f942d34108dce13d97ed5f81d43ebc5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.23.1.tgz","fileCount":172,"integrity":"sha512-h1faE1WXLofQ4M++ZjpuzP3bRxo/lGQTFLSRJEb1SR3L09olI/gBk7aRhGd+AvsVSDj6Xmh/8FoCKJ3MZiht0A==","signatures":[{"sig":"MEYCIQCQS1xC2yUNMpknUGQU+JuP7h2dup8YAeQmcInu8QzmywIhANazCBodBXeiTNm//N09ue2AOSTxfhwyfluDJoSogVk8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":519861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1NTWCRA9TVsSAnZWagAAUQ0P/judJHx2b5tpjyvSLHsS\n/0pl5H9W7huYvpVcQKa+8wlQOTiq8Dv8wO6g1hHSPBp6XwMLxdhsi+RibGDK\n7TWyz7ibT1fT0Wle/KD8j/avVDoDKeYFTgI9ofJ2m4zBYfY+6kSZfvu9QtWA\nrOI5fFksfpa10J1EVy3kwF/WUsGJZq87nR2vnMv+4u4T8zBeSCXpwzuMY80X\n+hm3jChwvEMyFHguabuFfJp7BKtp3lP2gp5Ra4wiwPdT7YEqk7IOtKpYNi1u\nxrEGEvyQq1p7rGxsng2IXvjrLhhRBPp+5gFrtgaw8jf1wvWJOXAr88EIukdR\neL4kJr1Ow+QELEDy80QUu7Hl/prHEZvsaQzbLU5/bx6Bk9cF6Ey1oHVs1hcy\njHVu6/Ut377ULRRg5PB3QSkLNJrB58a/DdhRxWfCuB1BY9S1+3257HFq3i4l\nFVoKrYts9mkrPyHnI+XDpk0vGFatQ/wWMnwZoHrBIUZuDySzeHtSBeamevu0\nxSCBOpOn0ZkRYhnn4be5F/tth4/DBcDbc7A0KGDJ9AWalEtsUDt+7Q/lF8PD\n4O8bqssBVjFVfRuhsw2N3nvTrDNUr3C7PRgbP+RleNU5zingeyoqmnd2t8PL\niDO2rqSLEbf9PcRxgiFkkCWg2Sy7HILoLT095DZ8BG76e1wdybjDpyjOAovt\nIgDT\r\n=csvE\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"2a603ad82333f4f968585b971e9fa67de2d59726","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.23.1","@apollosproject/server-core":"^2.23.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.23.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.23.1_1624560854515_0.7718859386439021","host":"s3://npm-registry-packages"}},"2.23.2-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.23.2-canary.3","_id":"@apollosproject/data-connector-postgres@2.23.2-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"db8138f543cab308d836b53543beadb2e8e4ef01","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.23.2-canary.3.tgz","fileCount":174,"integrity":"sha512-XGd4UX6rWDCZ+tmplkmB8Gfx71+2ddm1iEHHFaB4ND+d0IXJpC1SHf0EwldMGsbvpMSzreHAsBeGr0FxI7z4TA==","signatures":[{"sig":"MEQCIEd57QqBwobhL3Jr5pNY8q9hRgo5vHAjwvuZYo5Zyao/AiBSURxNGmyYx6tQtlxRQdembMtX2vvP3Fx/BpkF4mdNdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":526837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1ikHCRA9TVsSAnZWagAA8D8P/j55Xl6Q/RL14h71QwuX\nMxqDjsk+XX9n5/io9s1UAryz5VlU6znuYJOfheUfDiasJw6J+gzboBY4vl/8\n/ZGm+zlpBNyhnUefjZZTyCyXme+vGX0iPabwd24hdUPq6sq60H047Tkxo2Dp\nvmSBP+//ci5yJB7LLmCy6X494RLrr6ju29yr48si7EonHosjOI8wWum+bAhz\n95TvRqLbZHI9a61+6Z1Uzz4RC7NkJiV46LAzEkHFg1EvBcTRToJkOoGf6jOH\nfKhEgPVbfuI29IyU6I3rnYkt+nGMa9Duk0D1+Y1D3+sNSw0n2F9rtPSN99FX\nXGe0dIEMZn08Uq3faGRx0gQzTQ0hcoIMKEtMw8xbGu5taGJu3LSpS7O7HDiL\n/9EcDwJviGJ4Fh0TW19T+wZaTDd+hA7gPReYmtLV9QGnCgWL3On90wbPpm4k\n/3n7Np/1kvMoWI3Oe4VX00lV4Z3EYl+ER2IIiycyYXFEot9mUeJjc/rmDUc0\n7DW3p4uW9keNtrGLy3w/2lR4IAgc5ajs0L1UmBOdbnXOHCfTUE7imbhfNaUa\no+2tsepHIMNN6bmlq7Q6QdZWud5ZBuVMwhIlA1Lnv8d+fPv9Ic+bPeIyY7ar\nGGFDkX5aonA6uqzsUO/I53w4d81KiD0UPDujYw33Vdj+a6K1w/ot98zy5Qgu\nHRxb\r\n=D/qn\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"52395ef75941c5fa260fd9bd860deeead2e3be5d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.23.1","@apollosproject/server-core":"^2.23.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.23.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.23.2-canary.3_1624647942661_0.07284304656091622","host":"s3://npm-registry-packages"}},"2.24.0":{"name":"@apollosproject/data-connector-postgres","version":"2.24.0","_id":"@apollosproject/data-connector-postgres@2.24.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"92d37fa4a12e0594d744a9ad1aac1b5689f9bb23","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.24.0.tgz","fileCount":174,"integrity":"sha512-EKJ3JWCbqU9bGmJ7VoMq5IpTuChFjIwDAQTBpdZwMkrQDvX3v07C9rN8vb8iNCkYYdSJmdzQcH7lcuo61Eo14g==","signatures":[{"sig":"MEQCIDB/pziyxgUS7odW3LoA7V2kobaNQQ4WYaTGXr0dUMGFAiBHHWmRyNrXqtn4VjN7z7x5hEGFl9l1oLQQZybp8RMN2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":527004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2dr4CRA9TVsSAnZWagAAqToP/jKYcxf8naRAqaC3Grrv\nHMbIOShc4+eaCm5I7hYqsh3aS9nFYOtTYqQjZWCZKkPut3JVQlNIuPMWUQzf\nHi1nL8uhOwhiOoT/K0sGxPzs82Bv3ay/mNfhu/E0CaynXLvjKuTWP6bLLyYW\n91wKTWZ90/nv2zKcrw9+tugJhC4du4Mv65Hzdfv8fuxZXIQtYLtvbvskGnhD\nZlGRMn4jtbY2CwrPXTCg2VBkVZsQuwTMZpN44lUjNvGstWR37SwWbmYyrvQt\ngqpif3SrDcVCujqNjVhDGFekLpBZCx78yuH8+jKYbqf2kX5/BqB77AZuGqy0\n1IGjOX+aimXeRteMFM6hGvpSlzC+5eRcF0XvbI452wX1Pypp4JPlsKoGmchI\nFP8Quy49HKYVPrjhaZ/3uqDn6tYNkwuGvG1RoWzoKv08V7q35CQvfcfPTc3/\nO/b+XzFZzYA2I8wt3Y9TpwDRbSjEDZkoeghRyxnxk0kfHRoAI6e9XVhZxgoR\ncabgO8/y6bXrpYjJQUw7bDJbpAGrkwaO4Ieb1VdoH9S3TGlZoEy4I9iMfiKA\nua9Yoye9A+AerwpoNC1/JTVK2wmhk/ZFG2DFaNlUuFSXwzBPBRVUXbc5aFuz\nPa0yiHQQah/VJhxpJyNxF4SJ8i/KNFZ7M8BiUwWQj4GfD+aXwJjNf9G6vBzK\nKnJ7\r\n=Q2+O\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"750290295526fbfe0a2c6b841233acf7c998c2b6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.24.0","@apollosproject/server-core":"^2.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.24.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.24.0_1624890103762_0.15818524916789367","host":"s3://npm-registry-packages"}},"2.24.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.24.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.24.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"47928d29e0bbe0706e818f6534b1029a1192fd4d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.24.1-canary.1.tgz","fileCount":176,"integrity":"sha512-cGX4bwgU67E+zFgYhGmASNCcNQFBrn3NpHxcc6Tk45bdw7B7QutVUYt3I1JiGZ3jjBgKfeWAsm5dZhZj+h/R/w==","signatures":[{"sig":"MEUCIQDUy3mSxBRbGMQvY2GPyfDUyrjCI/SjHBNMslw8BW/xQQIgaZyODfX/fS97wY2P4mVngulnnKFve9n4hG3ki0+jBOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2hVtCRA9TVsSAnZWagAAR5sQAItcidPH1QrXzOWB2ayI\nnA84n3n4qtpohnSs3E5dzS25Mds5hv3wuxxM+0J0qCSRZmup8xL6JUZwfzAJ\nEVnNOK4I4g5NmTlzJk+NLL0hz86Qoc22HejbT9ziVJr+LzEaoQwtmnwxT4gU\nqXI3IMeRJrG3XEsqhJc0H+mVZma+awfT4yLZNFcoh/R4vS2agC6PpWsDXZLc\noCt/Tem9fth+TB05IdTa98JY84oct/FbN97vQ2n22qHjbba6NCnCJRwU/IdW\nu8MbVohXgWpcjp1uOd/mKDoQYNsN1sdS+TElAhrFTcwGsvU+SrLkL9BP1Vqs\nPE41jSjURqvzNZcEKDavkvrtKB3iQi4ehBgUkwKV0EkNNamA9ozpHDDmzB+O\nohIA3lXCBg3+WMRM5Q/UuMKArxMR9rE0A8NTkMTNbvbRTeMtTPmiItzGI1gM\ntX54QlRzsLc9JLimBtDH8+BKWn1Ff87P5UlMtTWix6Dp44X20U204VgaEI4G\nZGKnBCI6TVd4w10BW8AU0/MVfnYmdgfELeUtOVL4g11H3/bjNtAEyWaowCZg\nL82aiV/no6O2auZevzTFpgp1HxypfnWgyd4WF7OCbp3DY44mcVi0ACvxnsCW\nvXi5KMxhmJHiLj5YZxTHdPwP4kw5BDKsC6312XfgNVJR5jNwbyjqYUT+s2E4\nVxR4\r\n=g1EY\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"3d3b61de6582750ec4609b8b30a5add3475fabf8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.24.0","@apollosproject/server-core":"^2.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.24.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.24.1-canary.1_1624905068704_0.13983441537064434","host":"s3://npm-registry-packages"}},"2.24.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.24.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.24.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fc67c1718a0876bdbce98f1263da72f54544dd80","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.24.1-canary.2.tgz","fileCount":186,"integrity":"sha512-4lCjweqcio4fXlc1LdMG2dKtVVnlowL8Ut4ZM5mxZW/7A57g1cMWN0w7Fp2Hd8N+XfoJEbaWH/ztZu07y1CRxg==","signatures":[{"sig":"MEUCIAFEujgim6m+WYqzcoQ/ef2+bICFja3VN9cdRAN7jiY+AiEAqgHw0kCaYB94oSOXgOaAbIDVnajXmiteW1LVIbVqazw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":545629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2wgQCRA9TVsSAnZWagAA3ngP/jbAnGYy0KytA7PwzqAi\nzWs/H58rD1c1wAfSSGFvGd1RWysqQiUbTgzaS5kj2HsUuoLuE6kNQKpbyxUF\nV02F5g4vZwocg8Sdfc3znQUhGm6he8oB9M/qWIN0tPP/08Hhh0VwU+IN0gET\nWnvr2A0CKJpNhinTqz+4BnGtkII+pEE9CY8ZkHd2A9SArX/7qNMAJUpVRzst\nJusVXxJo1uCSniqEPYB1D36jbIIyCu5e0o9mOaIDYIqGJmlviCmmQqon43of\nOFgS/74YH+AzWgWA16QMUsM8oIMvswhtUHp6zNJYSKQm0C2IUXeMO4geIofx\nyHrsoawk2U7kb28xoHYXT3OR1lDoJqLAkF6U0rsRSdWk7zaX7avQxWFIl+oZ\n0iqM/J3zGvLnOPvS/KkzJVG2hODJ/iIT1aXRRpo6PeuBiBQFoIXM51y7CDtT\ntgXlk6WArOPHKlmptaF2NUqFQWd4OSG4u3is+JjJI2Ys9tb+ISo7kgU2/jFK\nLtq5bafI3IPuviHU2grRW3VJBkDEnloUwPlmzBC8w4ZAkgmA1Ph0/53FnmNI\nwauNub6VeBC39kj+C8T38qF3k3YRTHuiu8bOijxej7fXi9MZuwjVnxIrRn0x\nSsRrQuu2gVUd3QSjIuy2Di+tLFvGbXDXk9SAHjHBvfT0fzYvPCvlEOTpuHAT\noB2r\r\n=WDYq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"cb4edbf02b6dac586f1e2438d58f9e67e261aa30","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.24.0","@apollosproject/server-core":"^2.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.24.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.24.1-canary.2_1624967184068_0.9634893637491551","host":"s3://npm-registry-packages"}},"2.24.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.24.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.24.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"76705347d06f272a61efd7b2757dac93bd38b40c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.24.1-canary.7.tgz","fileCount":186,"integrity":"sha512-p1e/8uIpq/ac9Xo1tnE2/c3vVALWwt0b3HR8UZJKUbpQ3O5dkVErdJ3JTHlv/jI+TiHGHuzjIHgcUKzvM0KsEw==","signatures":[{"sig":"MEQCIBGWnA8uqijKFuFKLJ3GLdjB1hNgP+nRvzgZsHRFdhhSAiB02xz/jRaZm2OKHTSmEpzxGaa6RyNZnnJkyu2ZdPuzwA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":551478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3H8UCRA9TVsSAnZWagAAgDQP/22J80/3lSoA+chw+L6e\nD9V7Rndn9VbYk8VOwpUIb6XJG54NnW4s7j7HveUqyGhXlSj4ESHn5I2xA2fn\na4degkVdK4kk3Mte5hLIvgut454/C+Vi07tWCZ5nCi6CynR7hkoRiEV1OcTN\nxy8bE3p4dBNn22mtdDcPu/mO3fgDhEqBsqlAsvC7+5dtLaY5o9dNjSUYnP/0\nfs1E0ZKdJsLUUW0KZI+A50Nf0f+n+5gR4H4XL0RH3TP7q7f1QCjUjIEgqPet\nXoIdzAeNjhbIhlMzBlfSiefvHbL4GU4ytUat7IwO1brhURUFXd5zeOBdsAC6\ngwjWNkKK7gA6ldikh+VOqupSjxZ6qTV22x9BMq7tzCJPD73ul2CqHXtIgxYF\njYOGbpVKH8aCVct51Ou0u6OAWAZHTXvNm1h7wgNJ48YbQJxMJpoDIiimPF2i\nh+LSQKEDYv7GY9w0CFBGg9ptstfUYvacLCJwyoxqcxfEMv9Gr0C0wsi/trRM\nvAC5vN7K2uk5z5GfaY5BXk24ybdtLrrGdx/XpUNT1Mz/aov4u5W+hDCCs7FS\nyRprSI/SOBk8ZK0w5dg6no7edoa60DqPZ+UuQdapBz92aKmDLWCOsis+0Wx6\nPTgO2eFteDJWTolliuUl8su/nVF8tB1u5F3qZjRi4DB976+sBBoiZFdnwd2o\nOiCD\r\n=xX2D\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"e15a03212ee40787f8cd7ecf23358ef6997b9a92","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.24.0","@apollosproject/server-core":"^2.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.24.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.24.1-canary.7_1625063187640_0.48581775374576797","host":"s3://npm-registry-packages"}},"2.24.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.24.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.24.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a019abb8a68e5251d128bf269be621cbd9ad627b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.24.1-canary.8.tgz","fileCount":188,"integrity":"sha512-uF6SEnskU5bum7LuuTQTqaGRktxY6qLSZ83DCnFpoiIy0/DlfnySIpY1yYAZeMC0NLT+0UF8VDiiwq9PjZ1PFQ==","signatures":[{"sig":"MEQCIG1aWtBtooqVdI8hRi1qsIB/rYBl/k0fVvxE8XZ7KGPBAiAFDeYuxw10udhl/wHmRGM0YyWFfEAvPD300r/EoJa5XQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":554222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3IuwCRA9TVsSAnZWagAAcJoQAJOoLYK+xIS/GiBFTDI8\nhZWJfi2/aiBApDk4ptrnYj4BrophsCsmL+0bmeHzs9FOuFqXgA7UE3JHm79r\n8GwDAqSVXQLpGfGpO8dVn5Q6KZrucDGJ2I5jJqB+nuGZfLRWblR56XWBgIMT\nATd9WD3363WyhkwZN09uO1rRE+/lT25dzBkSfXIiH15Sr4u6DgsTbE3atTzy\nfp6QJxmGrXDKTKP+05jioiG12ARkOJsDF3CzQxpGUJF+39aCck9hZJ82TN9W\nbkd5imyyx04uxOC1VWPoRkYQ1A8GXfPh5rFYXP963lt4IgeTYwSjNMpgZTOc\nsUMIfyDzfKnjAXrYw8r/BPrfIgHU3rx9PlTUBiFu8KLJV2+LAcFaMABHOMo/\nDa5qnCy8wk0zjRNS6l/o1NNP7p/TStxGxkVgC3UgTmaYEGrfCx/pKO5wHyTc\npINX4P+c9/0RvaS2sZJrVCuzgkSFBQICmx4H2xlB6E/p+gPGx49rUUnWbmvo\nEoJgjXS94qUrOi/6ujD9CA3o40of5kckOim4AumfQ9ONHf27BUon2Hk9M1To\n9B2WIdvUW8Fs5ah7FsmXgwd7LTV21vwwl4EOLOugJH2bPnDpEwAwdKISrsWK\n9D06lBxtlgkR5F3SkIcIrsItzH2WXfB2lJgBTapZAZT1nRCxpjT9wVSyFHl7\nC+zN\r\n=jio/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"2b131f1bd89cd820d8f5217cecef8a79f4e86660","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.24.0","@apollosproject/server-core":"^2.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.24.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.24.1-canary.8_1625066416114_0.4216219833382211","host":"s3://npm-registry-packages"}},"2.25.0":{"name":"@apollosproject/data-connector-postgres","version":"2.25.0","_id":"@apollosproject/data-connector-postgres@2.25.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dfc5da4814d6b3b2d2bc64ca656f5e5e5d9ffa12","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.0.tgz","fileCount":188,"integrity":"sha512-yr7tHjvqDLxfU+Gu0RoFUBh+yduQjt6WxcPI9cpv+qHAyvgM7s4hjNLgDmavirynNEdBxYXzPsufLaeX9dLUng==","signatures":[{"sig":"MEUCIQDjEdLT9Yb3o9NOGCZYDEi2Yw4GGG1agUaH/F3+SeaYJQIgJnbl+gXHF/yjbKOt6WW2fmJKjRcqyjBTRWEUplzBWAY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":554975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3JsfCRA9TVsSAnZWagAAEGAP+gKQJmmU4D1hOF3k7rcc\n2MaXU2TgqXGoC6URzOeaQgWrypTzqYb3djyYPwx0yaKUM6tVnkVs8QR1OVKH\n5iJkg/wUXeJsObXgevrtr8/FGt/N+Pnmha6Kf4taY8zB8bM8XfWh8mYniurD\nQflmYZodtNQTlGXvJHUxb877wD2gcROEoldkW9TkQXpz29Ll/R0zDU/NvbeP\nIEM40xIKLSso8meu70iGZCnp0y5Yls6Bi3mgpBx7uShsnxykLGfqr7ctTZb2\niWTm/YNyBm9gTJOikMHsk+YHmGiD/TJrACrPPfc1kY57RYqhD6DrdGBq+mcA\nhQAH7we0rwZrGmOk7MoAGBv9MX3eBpODy+5nVjVEGJMkLGixwTWtQuyhEWqS\nFB/O0x3MJkmyrCvx0B8+jrSEO627QH5ky9KiiOuWgHdFDY5TS68k8tAnOWrg\nMa2z4ZvX1+E7LLX3ZClT9MZ9tujGfOwYUknnu5zsA3gajKNjhGFIbbKsWuPx\nmJEnisqmpKbT+Uof2thypgS7gYHtQ8DnjBhx77Ml/unznq7L9pV6BPrT9NkZ\nTUvJ3TEk8DPITpsQEiNV8FF1OyKAeu6Hccrs0CPizyro9l9lAwnkpAhZ+Fez\naUtKf/vZS04Kj0HMy4QALrUK0CAKOn/w6D3//ns4D/SJdD8vSj1+C5SzlLdT\nNO2C\r\n=3p9j\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"ea7f4cc1ed49aa9a58c0a4b5116ee222a9cb4fd7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.0_1625070367359_0.8819962078993198","host":"s3://npm-registry-packages"}},"2.25.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5ad5ddcb0242117fe1934284dc8dd7211a6a4d5a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.1.tgz","fileCount":190,"integrity":"sha512-y6WRUAEGDpw9dqiUGtdsQBvABXDz1Whelw0WRMNgX1QW+fYY9iICRtzbm6VXsx6tr7bHCh2Isc+YtW+BEZUNOA==","signatures":[{"sig":"MEYCIQCovhwiaOTlMQD4ss6AFXWcP9dxOesDAKPbDY675PT5PgIhAM7N4n5xy+PAnUYNTfjmUjkinn213OEi2RSNvpC3jw9e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":557543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3L2HCRA9TVsSAnZWagAAI+4P/027hAldCOL17LIBVv71\nix4D63tBrAwdWpxJ0TLKrjLEX5k/ttR+qZ68ifAHVoBqz7cT8GbDcvqKa5wj\nHgL1R9rIgDAaYM4Cx9lejpdmT7ImAmeBpjMrSFqPf2y3nHl3j5GiTcEj4xg3\nOF7P46XMKlFEUH0LFS6SK2YP1wTTYyC6xlVYgAqH1mclE65eWZ1T+oob5wIy\nZReHb6ksePntUKPiR8Jmk6wW+GyASi89Mn+J/xuV1DDXMJgwuy2vsb5IU88b\nHgAuyu3soikA5SCQZ6Z8S1Isq2rAs2UV07GqgOJzwe2ILZKb0E7PPaYwDtAX\nfqNnOCgRtKAWsCpyP53Bqoh9mBhMmfgfHMmfnTXXm05BzOt5juODu3eeOH6K\neAgBB9hm/NKthqF2DgwXxWbecV6hZfp+tLIRbSj4CjzRDnoDxcfurM55NrQa\n8IsGJk0rDNXO+RYztnpl6GQlhsnUQbWRxumlzaVsIaZQ/bFOdmNBTUtARHVS\n6Q7r6waYFwmDXxyO9cioIP3MW+Z4E7Qzlm0VxS2/Hz1XYUc6gAKu0CEvMUJL\n+XG7aXFKUiNH3WXqd7OSYYIyFMjz4qHEM+xWb+TW5cMyGh5dm5PAqt2CJBxw\ngUOc4ga5Irn0BDedecKtpsdrOaDU+iwz9Xf6i5aZvihSCJJLxImcZVj6hZlv\nukdC\r\n=v5Fy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"2989c7596d5298eab4ca22e34f667dfbb0af28cb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.1_1625079174804_0.441141901408157","host":"s3://npm-registry-packages"}},"2.25.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fb6ded4caf338702604a06369b7cce93348db213","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.8.tgz","fileCount":190,"integrity":"sha512-6nSTBWIhcX0YoOzdKYk2F3UXIs0E54HYo9F88F/vD/R4fq2U8JHzCKVJRMCoor5snIvt0UEMduB4slDJY0wNkA==","signatures":[{"sig":"MEYCIQDe8wikMGsZABe5h1R5a1eK3DJEPWhn2EVv28ESptBUUgIhAOVLeF2DMqUfi6LDJw0rU+Z7A7QGyZDQB3wOM2P4J6bM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":557579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg32sICRA9TVsSAnZWagAA140QAJTMg9J6tIscI1HTvyAh\nTT9vvUCcq65VAXSNfvOxL2yDdI4o+kV17Qo47jWLdY9o66NOA8uXp1J69wvR\n/K3nTPCdhfRhfU11ixFKiEm3XDlQXGV68UM3Y7uxNvGbZu+nk2KwXAfTOUMn\nX3rpdgqGDUfhoNNx7zQ9jWj0pcXXbyT4rb1Q963BLDBmDzTcZFVNTyETf1EO\nf6oZHr9CXh2w9biyHoseaW3/Pk5oI6+94soxRABS542HXNFlGEe1MYSAlmHV\n49S8BCYNA0bJog6ZUkVmLVzd8rWCHHHHEh53P3TtTZzeytLiToMCbBrK87nv\nxYkxNpxzIfw73hq1Xu26cWbhviCY197/j7LV3b9f+th9bDBJxupnieA+RMqt\nT8R+ROvFGdKcU67NfjBdIyysN9z5PgLToizD8ny8AYVoYE42XC2V7nMqyuLT\nXbQKCExu27iivRdtSlYCPnc8kfMfUXA7EuVYvfN8KJI1M/G5vPM4crFvzc63\nevBwUx0/dG8JV/4FqHY0RtxuUW7atR8Eqp/TaoE+FzsRxe3It6ACfwnAjpVE\nd3Gj/yCmwjFFAQLlk+qAJ0ElrvtCFqhKRwZbkzkP9KWnyK5Oi5q0CUgFCigw\nllSdJTTrepERtKi5JZqJV0hVvZB2/kGRRnnjmdiLx00mxTq2sMPUZ+ZJkXFE\nb9eS\r\n=ZGFo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"189b822944d146f9e1e97d67fc6421a01f371c0f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.1-canary.8+189b8229","@apollosproject/server-core":"^2.25.1-canary.8+189b8229"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.8_1625254664333_0.6273463426591963","host":"s3://npm-registry-packages"}},"2.25.1-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.10","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"689e72602fe31a3eef8be35cbfc2ceeb1bd1a2a2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.10.tgz","fileCount":202,"integrity":"sha512-8j/9RhDSvbvAvP1LZ14QlKHIOWfN1KMvPHqdwUUMP+QdxvDZAgQ1LydBnpNhGCakssc8vlJJJvlX5wLjF6n+Qg==","signatures":[{"sig":"MEUCICnLRdZevQjwOHVzuj6Z8fAKK91tqSLxumGlfyy7GcxbAiEAtMUJXakrelQnaOsisxHiFECSjN39jB9xhTGT+PHmVaA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":573942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5GgsCRA9TVsSAnZWagAAxy0P/3ly9fB3VAY2HU4wX0+E\nVpvDlguydS95iLPw8B5mNw20YBxiKcjpsJgbqDxzk8TOhsLcA8FF/x0UTCu2\n5H/XauKBd23zCoSSUlRWk3lsFZZ/90As2DY/a5cO2BlNE3J4TaGBW7FBdpkO\nyYljoCrae1KD45Hi6DkwK5tUNDLr/H9DC8q1tIqq1DWZWoUYn5x58H3OzfhG\nD6xUfRJjDYnA2igWtuPtgsiAKqXdUD+S5dP4hLcNcKkocWmH0ko1PkWbcUd4\nyXZkmon/W4Dlve5HUmpmro8ajFJjthTKSFTNHHqS/qn3+kFGj42nJZtmwbYs\nJ6NMdoR2abbxd1iHsToCcXjEY7BbyNPecn4FZHLMkpyTbbtoM2RAKfG4XYBO\n3jbjP6H7c4BCqxJQNT3l9JyH67z/t4x4iP6kash2YRTAYyrM7K8zYMYCcWBu\nahBSvjzeM/4rOMDNx1s3dzqY7nsdEy8RaGpDbkduX8UZeqoVxnFR7L5RkQE0\nJc9Dv+K/+efWQarOKBhrXxUCqOpnDRQo/5JemoUGykeNeWZ7k4X/qi8KZ0gC\nFRdfJ9LEJOxlBPZa9q4KMUDBQb86MJPbvBmYMInJHfm0xDuNDwNYxqYHR2Ce\nBaVjyzf2ihg0uq/IcWhUk86O8dw2yLBQCQJEcem3xSUamY0KwSUtzK6iNzQi\n9nvA\r\n=eFLe\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"0cd43d9507ada243dc5a24865e6be977881d4588","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.10_1625581611593_0.04449270498885127","host":"s3://npm-registry-packages"}},"2.25.1-canary.11":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.11","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.11","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3f41a455bd71da81e11178933ec02ba97f1627d1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.11.tgz","fileCount":204,"integrity":"sha512-fVOqhjbagd9TPtE5WZY4dmLh7qxgzsg9+bdkPCU85Kdp/rRQrMbmcKyX3Sg1OegetuZVe9GiTds6T3HdR1yFmw==","signatures":[{"sig":"MEUCIQDyugzTVZsjy0Qk045IRlssxcyAbOHkevjCyhVEGTEz/gIgXpd/yQAysOurML2minNxHSZpoXCpUMq9shK+RQRLlNA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":575798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5Q0ZCRA9TVsSAnZWagAA51YP/RDYq01WfdpWrgUQrDGn\niUYfIYH/KBKfLmpGk+diVtL++ce5/vZTlgpCktq/cqrbtWLAGhG2WaRWtBh5\nP4jKX+bH+I/EoWTx0v4w0HahZCiJniBXO3oi2Ql3+CxrH+ez4s3iy7BwZJnH\nxAq6U0RQBQByDOxwC2lbiS/jb+Sv8AOv3QasaN13gZn/5wC2EmmBoinDc8fJ\nWJX2Le3LPZSolUDgGMyvJGl3APgPDSyrrUcVSfV7rAKnKwi1M+Lec98ENGw4\n2Ed4TRY3C8WEPc8O7FW/bQVXFnRK96GyxteuTlfLfUmKd2GrV9EqNkEjEdmZ\nl6WAWUNf6vOLNvJkSx9Hf6hLIn+elgQQb3lpIyNLRJmAwkqGADLEXkr4DmNP\nZ4WoLDeH8v5bFb+jEauS+xN+NG8eA166EU6wSAf8kvRHM47DX45l38lynNSZ\n/VyFIdCZg84FX3GMu7eZKxDG6/MeQ1gKnoA+1+6jDFqcAXw1N3bMdKTTcQ/O\n+SYw6CDPdKH2XoZQ8baGkKQ0rluxuvhJT2XJpEw2CL3PkXJvC7SL/YUZbBWe\nzzpst5VfgM71FJ+VIfX/NvY3mjhUzaua4Hhcd11jcdDImHayrdU2wg8CyCYk\ngrOtC4QSnFq0B8zZP2cEAf9K9E8NHS++NWuA3zEsn4MZUYUJ7Mgn169nodnP\nljgU\r\n=mHFA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"eea23df3d05b830e10fa1d421790582ab6adf4e1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.11_1625623833230_0.17614504584562418","host":"s3://npm-registry-packages"}},"2.25.1-canary.12":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.12","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"68cc6437d80ecdacd87c60fbc70c22f2090c9a18","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.12.tgz","fileCount":216,"integrity":"sha512-0SARFYzv3TpebaePVYkjFodjdYgvIl7w6o8ectol9xPnbqCgMfVHN7mqYfQdRBd5TlRnYJ3ZyLXnfqQDxPcrtg==","signatures":[{"sig":"MEQCIGl+ps8HjyL+AL0tAAmKabNbiCHWY2+BVBROBu5nRx88AiApjyHuBS7jNKT9xNmwDl7/8xhNSoGf4/Q4QdD5Nk3nvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":599721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5Zw2CRA9TVsSAnZWagAADIEP/1K35iy1YvSJd/3UC+QS\nUhq5XnscnfOv29IW3RfoUdicr4cbcfaLZb5qImz/bjvhXCKg5w+ZAjkbWAe1\nZhJ3vIveOrvy8Mpp91/wLDojltjGWN6GkRKAaS17CCkC8s+0FF8/i/Z2Hb85\nO5egHwA7Ukd2gO7xSBhzbiT/0TLQ4IO9u3kUthguqKUdOzfYArQkFcPSnl9R\nEf/Ik2hDtR5uFjbKigWkJc8q8soE8kbEpxjKUvoHyvWw4Eb+NqqRL9as6ycK\noJeMRD58oE9JUij66gqdw6Jga9qKejqzaGlBf4PjnNtOP22OpHQWh1+IwTW/\nDQTUSZpzMjuUHgPB/gfqjPiZN+mIBMjd4H+11LylU/OMN34wpgaThBriUqGR\nWbK4s0+Z/7UqcdH0+IBkFbVO8rfmUPVQTJN4QW03bMCCWVkJpIdCLSUI5Jcx\nOhFn3me5bIfwAASD9lXQ+c4LMJQr9DdTbSPj1DGdNyml9HbqtAbxCVc47znq\nBnEPWIck4BwJSJrRozD2kNtn/fPRNPfvJ8O2PcLEyke/i4nYE20PDZqgzgJK\nrhT+/3YgPwtT9M8igOfkw/EXz+jK5v0BWxrXRUGq/VABuSoWdKpIcYAO6YjB\n2ryJp2TiBVm75NglgST0K+ZTvfpRWQv02+Wqw3JkCR4LWwOcE1Hs0LHoZS2V\nmxJy\r\n=ErHu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"662c6d9a1fd5d6c8e9a002749636e6c9394b0e41","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.12_1625660470106_0.41230439394095475","host":"s3://npm-registry-packages"}},"2.25.1-canary.13":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.13","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.13","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dde74123277dbf99e24e9f7874854a405b919e09","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.13.tgz","fileCount":216,"integrity":"sha512-4MKyqRJoCbhGyO4eZX+Tf/KUyvXGJ5ENeZPdCiJuMs8fnngZQfKHk0BrguuoHEM/k3qco3enp6zFCxWifzHzfw==","signatures":[{"sig":"MEYCIQDaD1I0H4UQxcVgmXhNfQ6A65iC90mvjbTaotkUKKPvpQIhAOygKJ/bmhQ4DU/x3cm9LaTXydqd9mRKwlNuoPZDbqMs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":599740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5a9RCRA9TVsSAnZWagAA9GQP/2G8Ts/nR5OWy1Q6se6P\ngqr8EdSGN2xDxuZT+fxvyGdbOyzP/41kUBAeIvf0Zm7vlxxeT1UCfpxorfxL\no4nlT2rhFbsnJhSYRZZp4rD4s5gfYEhateYIirBfDvrhcJZLyCXQy1hSSgDW\nFzpsrzgmLq+7oX5zjtFT92+1hTKBDcjxmX9c22EXfWtIA2orkNeGi6wkFQQ0\nBc7i6mNjTBMDmzRLdj7F/R49WuMo6VCep5rrfH+4aQTbjynZh2OTsCwQlnG2\n0pDvr6jfL7iwG5sbKiw9UNB3KvQvojvD046T7Uyy0qGI+PnSNz+ejFcV5t1b\n5vzJLQeuHRUGNEDRSjym6ooNDEJ/gnMUwyCAy9SUhgEayIblqahq6vcz3KJ+\njQf7RCcmerqZujRpzPhNHHbGxfK66dgBBN1OLeDY81zEcI6/CaiJs3HbkybN\nKFM7W+HJl0EyWxg1AnXrWRYqWrHXbcvRr9D0bDZULuwbN1jnqVMSpgsJepsR\nS6NmK6+bn34z2+NaN0mNKp5z/UdZa8Jgyt5UPlOj66FPZwl1PZIFC8XfivbV\n7E1D/Lyvjf45VQp5DE9vG6/hHj8v/MYCqbe0+9K65SkaPiKq3NI+1fwiH2Gm\nYhHbnhYJwZK3N5F9a3TaZ+WTfg2JOa2JnU/pOzkHjpwWCq2gMNK0GlN3wV9A\n575Z\r\n=QxMS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"feaded63ef2e52557629aa53016d646b26e238e0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.1-canary.13+feaded63"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.13_1625665361298_0.9302195329411644","host":"s3://npm-registry-packages"}},"2.25.1-canary.15":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.15","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.15","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"014294acbc8248893e08fa16d9c521f983d3c8f7","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.15.tgz","fileCount":218,"integrity":"sha512-d+GszM/0QaRWWny35CCTwep3EocNmvI3j7OvA81o2TnRUbX8JbkrT2PveOhtD886oRZSPZmdGsCwvASRf62RfA==","signatures":[{"sig":"MEYCIQDlVIiq7BZ2qygSOCr8EibUx44fapKNsawzLLG+X5WXjgIhAI1TZ1SJxC6ikSEoOsA+qi389ikT7yIdmBK8wvFUGn6Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":601546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6FuNCRA9TVsSAnZWagAA69oQAIQAL3wIWdiRZ1+aOtd8\nuJbYZfvv9+SNrkis0lYc86MuL0GSOAVP6XVjLSC7rjZKdblYkGTEaKNCxN07\nZ8B6pMC/av23d4lFl107HeZcJHwafcPzP6HMgYhI2NQSe2kCfHQZpIGoMpxr\na8HINFFIMVHhtcNQFlllugpbuES0n0I9VqkJc2UJQZBY/8jWyeZUDeWUXHRs\nf8EmwJakbXwm8u0kO5KZF/ykdaIXgMuxtIhkNQboc/omZZQf6FztgGqHYJwi\nFYIX7ItnynWhTSYmIjtMJn8hcwwCemDwZ+69xcxD4dNIohxM3H6X/vBcbJWn\nr7RzcxS4+Z/sGsnPgV16DbGtmd14+UQ82rQR+vdpZQ8hCkBexfZgwzn6l6ds\n0j9keiGw8LBNrnCiUxv7GuIVyfQllBpQd+Z9MJ8VwqfZxCmeEdMswmgkuJo2\n/ZDBLlEaVguV4J9vmHmHkIiQB+kLOk/AyUU+ce0L86jT6fAjdqFaClHgSZ9a\nfXwL2XsW/hRr0tK8y2bYeESHhV2K8NQ/GOlkx/2CLKCFaTxwBiDo1NyplbXk\nJHJN47HJkCQ/s2qAPJnX4bHzqJWTwiuMsgDvM/FTbWMQd0xYi93NYcyNdBQy\nxtwebLVJKCRWGgEKBCUzoKPytYCKA9TZPD1PCg9S+tFpBaUcGENBntxfDZKq\nS+jM\r\n=DErZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"91bcd6c866aa945537f64b6091288917d3e3de60","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.15_1625840524586_0.8994946314074115","host":"s3://npm-registry-packages"}},"2.25.1-canary.16":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.16","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.16","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"049545ebfbc5d006f0f354ec6fe68f74b55d9e56","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.16.tgz","fileCount":218,"integrity":"sha512-ZlGG0jdy93cfF9RUuPdrCazfxe4QV6tsBxXVxT51AGbt4Q5ifHOZ4xDuN4TBN1/LlmoKsvgcAw0RQKNElWrf6g==","signatures":[{"sig":"MEUCIGaEykQAr09BQGAiNB95yRrIGasXLn6zCek1/YgTuessAiEA8Fs6p6KgrkWzt+1+3P7Oo/+L9Kx8b3edWKWbkOObQM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":601524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6G72CRA9TVsSAnZWagAAoUcP/iN53M0BCtH1dMsPL99X\niKSyo0kBMAy2dEs2haRDyHqPy0CEqL8HNfoTX1Cdpld6vN2KojB/aAfcLRbO\nxS1yvQOthqjC4zNmfwOlnaP3AAnKQ6RmRYB8e3HkVWUVFz2GyxDQawiAvvuE\ni7vc/2VQTipG9ICc8XldhY7J8IEWjiknioaFY+a3YzL1zC+8LmzrxlHhhI7G\nf/JRLTq4ZUiQNAe4X+sA+ZWtm7rB1ZEaFUD9Ata8kn78bSi9kde+g5urOTWA\nn9WGVQ7kWl6e3uaFtBmG+pVt4cfI07pxMfZFENPdvYseNVUKy758H/qacis3\nfBBLuQNpE/MwgdkRKcM7Y9aTPpIxj+Fx4dnpclV+9gEIr8Oqvt3I+TGBuAdo\nif+uCR/9JnoxuznI2nKprRJ2Vf8fBGNV3lJaYgoXOL36oSruY8e0TyavblZP\nfEZTDhDnEDJsha3mvq989Aah13a6KQnwjPOE2XGZs5pNteZ4a5ejXlzL9NR5\nJg2zAy/wmAqS02cBMVK3VW7NFN+4dHvHIw79vWgIjmRV8lBubv5bThAc3Chg\n7x888B7QCt3xD3iVWo4rgy+2jc4JNfGk5EJJDsRHyPHO3Mz/Pmk0LEY7jEfh\nJDLuVg6N2vBBLAthOkrk3sWm/8CdcpnspYJR21IBYFUMTuRbqlSZg3GDGK2i\nvpRD\r\n=EpC/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"6b2ae327aa34b54186ea6f83c92909a027bf4191","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.16_1625845493793_0.8679079885412835","host":"s3://npm-registry-packages"}},"2.25.1-canary.17":{"name":"@apollosproject/data-connector-postgres","version":"2.25.1-canary.17","_id":"@apollosproject/data-connector-postgres@2.25.1-canary.17","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"56b749b690681ed669ee3fa9d85518504ca32fb1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.25.1-canary.17.tgz","fileCount":220,"integrity":"sha512-BGxchEJGCG4sZL/nYOXWRSci/955+Z6OtgYrvrbI7TAvd6cqFQXxl0To+8bfH0mbpGqMdkywS00JSmIgbwFUwg==","signatures":[{"sig":"MEQCICvqbFNkvpTrLxuHnI8tOwkleZFXyK7OUfxkhBRLaHQ3AiBBPAUAQ6bQYYashu4Zo6Q4XfJyIAXZ5zXF4Xb0vfSOCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6HRECRA9TVsSAnZWagAAymQP/A+p22jsUSBhUfvDVXEj\n/aZ2PgnkO8xiJfp6Y2JyaPdc4kpihLD5uquxyctNHKb0ekcnX4ZTChijnyQh\navkTf2XC2sB85y5eso8dgL1t5bZoszg70Momjsx17oSWw/X6rVSsGjo/aH58\nDNDKkWlMoZlaHGcmpKUsu9Hqnbvf+1TGt5Sl62QKPOMF3lUlbucKuvcoqzY4\nXX1QVV7xnAGjnf79F/kTRFN+MtBYrovibHfH6NEbRRqHKOk4D3nb353bxF5d\nlKqvo7yqsV0XM5crUjKFvzaFTyGMjHtQsbjq03tX8+MppfM5QCnpMXGxCgf6\ns4MkmLAdBqTk+TkDQ157vKi/FMInO2tzUgoUbqusDAtIoFPsqZFvAcQlO8Yz\nYX+umU/Jk3Qaza2bG3mFY0hEpR4zB0wq/oz93rWGJGsQ/mM4wJOyVGfbPC/5\nKhkEDSljXtRYwCnq17lPljmLL6b7F7ivhRulDcYrFNK3MSTvw+CsDwB02x4O\nLizm8Cr6sZKbtaXlfRKIJ6ghhEOivmlLd2RCBzdegrhXyKZYsSoJRzY1w2IC\n6RbpH71xAPszu+LCbstPPUDe/fXGgIvuiCr+fTJ9yx5EFG3PGA909Dc8mU5l\nFbcp9aa/jdmf5TmeSlJQ4Nm7IBVFPeOdBz1RZSccMtOotf5ioLZ7LiTGcC3q\n/djz\r\n=gf3r\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"821910be0183dd32eafca800ad3e984cf6ac039c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.25.0","@apollosproject/server-core":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.25.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.25.1-canary.17_1625846851943_0.6218098580045393","host":"s3://npm-registry-packages"}},"2.26.0":{"name":"@apollosproject/data-connector-postgres","version":"2.26.0","_id":"@apollosproject/data-connector-postgres@2.26.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fbe9bee4938f065985341684589bda7f5783b2fe","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.26.0.tgz","fileCount":220,"integrity":"sha512-xOpcJmkk22KCtJ0NLl4UXbWNHG9UNBbKSawce5fcXOnOLJu5S0vfzCScUW6jEjzk7EZ+FvgxAYd5FBdFrk0Qhw==","signatures":[{"sig":"MEYCIQCFKDCDA2UXJwkZTh+pQ9YeJGLl++4B8TeAfxC9O29DSQIhAOXDiWY81TUC/90+hnQfsUqOXncthJd3owz/sRqv+QR4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":604081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6JHwCRA9TVsSAnZWagAAKkAP/io92JSJ+oocRKbrGA8M\n5qeGSr5Fd+5BuucFOdG2mSX2y14PLVp6djNjOiMWV3BSmgyRVwn4AnK2pOY3\nudKxrYCmf6vAzZjUplD/lbipPbxw5JKaATwc80iqF1g49pSHqTQLb/7GaaI0\n/9dfcszd76zA2upSgZioy7cFjv5F/zusN79Z9D3K1gWX//8L6ya1szr/CD5T\nxrbPBvy3OxqA/1A3KHcXjb/gsqHQQdn6fgx/aTMKFiHM+SKFSjbFOLRZnyWh\nIHWsa9FOqEa7tymXUmLXy4zSt8O/1MZBCoVaSpgEgNdnaAjzoVm2TbNSdmNd\nrLN9xia0F8Lw2Kolt+LQIlAZVa7PHDrHlbBwxv8B5s/V0brE6VkWsjQHt7d0\nMj6uMKR08PCFrG4qCAqwtsIhsktGv7X0jg3MOMU0rVIcOSPiMnJTaIsdI2WI\nUP53Zzrrs6maNA1sLkLgzBo5/m+AKwMNci/DEyg2jn2MG6nI3vdhdqfrOtUe\nFg3MsyQZVVeRmV9ceXccUy/67kCEvY1UjYXljC9QLhh9xzbF/5b4+MY7B/0N\nr8qPiWbRB/xihgPD/YQUgypHOJtot+y9bsxevNJdBClOYalojSutydyik2yN\n3XQnFBgD/JGghwuvu2ikglM15T1FZxY4WfXwD9iKLjhKOy8ocDKiDienwYiR\nMrT3\r\n=ZXNx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"d2fda542fd8141b27075ea03cb637270428310c9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","@apollosproject/data-schema":"^2.26.0","@apollosproject/server-core":"^2.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.26.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.26.0_1625854447962_0.33261074847635763","host":"s3://npm-registry-packages"}},"2.26.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.26.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.26.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"26802ea45f1e0a3eac27b977bd30f2609b0bd7fe","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.26.1-canary.6.tgz","fileCount":238,"integrity":"sha512-D8RtWAgLodmttWRqhn/ixx2oAwdrVizEKOiPNXCe4U2nqixCnNyV9aAjyZKEYOa61X2tUHsYS+zS3rbkTwRhQQ==","signatures":[{"sig":"MEUCIHu4TDop5uKuEpRN28/hd2TgFbR+1MyxwdKwA+366t4BAiEAjzydWvRSuvwPdzxrIT8JRQEm2fLWQ9U0AwNAj42A2MY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":751340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9bIPCRA9TVsSAnZWagAA37AQAIJw4bSJu4BhyHIuhVxR\nb/JGdX5CgfaQlb2vVRUalb3nmrsdIk9MG8RBGeEEQKqe6TAkx9IcigXuupFX\nAm/A5BiqCHeLvHjLTlVgVy77sTVPUOcDbzhN3x/7hbmibblTkVvNxHKla2cq\nELFO7+np7kLpqFyXpBc+xqjFduWY0bztkB8T+1dYDbeePa5tlVgYz3zUPjKi\n/50u8elBPlaIgQcI/savAAz+58gxw3S/H/PdO5vgC73V3IY9j+iVLfIdlGd2\n9/DupqkW4cLZcKRAbB+Rlu7+InBIHkBcTdterwfqy5LUeumYFt/6kjcGT6E/\n1gR73SQqUGcd4tzV8ZHjVN0ZI2YuHP516F6tSgFZAUU8fyrMsVyq5WMTwCO7\nrPr8c/xDK3zbzw+frWSdSkrRSgRlNJLBjMnoNvSXUsI+VQWIjcDL7cRvdCEP\nNK858MF8VxcM+piCHEISWquJTQhCQE4h+E1tODpupSQozBrZDUu1HBKS1Dn7\naAJfZoR5wG3O2QuB/CTfosw0ycNeQlQ8xrch+yywBcLmicaw6hjWG6D7b2lK\nr3zmX1nh3HWEzxe906LBZ8bUs9iv2WtSU3rdpm960OMQ48g6RBwGsXm5gsoD\ny+3V/eWiDtYHaMbAd6K1USMEW7cFV5I+IglOC6l1nOONqCBVAkngZKKtuEtY\nXgDy\r\n=R6ZE\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"51c297e60a8fc8aa409d0288ab534111eba208d7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.26.1-canary.6+51c297e6","@apollosproject/server-core":"^2.26.1-canary.6+51c297e6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.26.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.26.1-canary.6_1626714638787_0.36578856533121273","host":"s3://npm-registry-packages"}},"2.27.0":{"name":"@apollosproject/data-connector-postgres","version":"2.27.0","_id":"@apollosproject/data-connector-postgres@2.27.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"992db849b3e3f34c21e51683575e52791bacc976","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.0.tgz","fileCount":238,"integrity":"sha512-ACaMwcBzfm5fayQDaE7d5oG4CJTnOm3/XpuvWfjht0PSwsPgiKYWXOolk4pLEdDorCtIhipgLnFn9CFWy0jQiw==","signatures":[{"sig":"MEQCIBFOToG1ntfEqzsBlqfb6W+2D/do32a8hk+pyFSqDKWoAiB9fEsL/BNBBhFACkdwEdBYSHB9dcjIi9e336Oan/6sEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":751617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9bJmCRA9TVsSAnZWagAAMFsP/A8ozhWLAh4IMmqDPh00\nRDovpxrg/B3b0lMXfyGumsxqsiJLiX9MyTW6+5b4bKgJVatjH4PgnS63KVc1\ncyWvc9D3cWGbDN/bmfTG0sKIrr+591rL9nwNrO2MnVQ4UoQh3pWvaD+76PAG\nh8m2n5MLhssCgj2F6nXTi3x14DGBMpDlqQK4t/CHn5fnZMPvDh5GdgohoU/k\nCZ5mE3d/NYf5sqHzRQQF3swuxD79AJUuVfuefvE3VS3infFL7lgrqvr7rAqe\n7GJm9gmCmohS7j5XhFkNdCu4ZoeVRLF+2TPXPR/RWWLx5CwhVSKAtdF1Kn7o\nn0Yh5UFyUkzXBMaDqpC/PBmSEpshdcaOjiiyTXcEGAw50HfXfuBWcqlz00MG\nmEg79SpWH3zogD6M9xoAzKhtqgxPhWPjei5AXSFP8piuCd2f6qpjOENjhqz5\nbHnE5z5p6S+R5xyFgm4srqYWqK/4Qc5XnvD+PmWnd6/bmnK/GMgz0tBuYU7E\nbAayQa7wjKa7DhqtaFpTirEv4al9xvKpbz4gY5zc3MrlduN9FCM8ty0upMn2\n99dtdchyIhjz2R5u0MyKUswY9NR3W7If4+swkDWI0m/EW6GX0NSXDdD/meO6\niwkJLdK6r3kB2Xr5B2c5L3He/kEwP2K36cmt8KmhFF41WtImsZCEjDkZTtbM\nicFU\r\n=1wIw\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"616ccefacbf10c5625d559b564880e55776abe0b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.0","@apollosproject/server-core":"^2.27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.0_1626714726337_0.8195531263222631","host":"s3://npm-registry-packages"}},"2.27.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.27.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.27.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"91e72dc45e48e75e7044b3947910a8aaa749f828","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.1-canary.1.tgz","fileCount":240,"integrity":"sha512-U1YbzSO0TBFKjNA10ir2vRTUY5+lqualKoNWNOv5Wq0u5o1Cmtqfstxv5bGvXltVfKiMCsks5wEXzQWhFEoNvw==","signatures":[{"sig":"MEUCIEGvwLmfq4jrzZmV51rUyisevMOspKdX6dflIT4p8GqRAiEAm06lXHlg28BmyTRFnx4ikj/gKgsJfiPovhgEMsNTGgk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":755484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9c9BCRA9TVsSAnZWagAAZfoP/ilCO7nJc5Qvd8n5LUjL\nE2haJ3rxFYpW9QiAb/wJ+uYvz0ScOTJ4T/S+gzPYR6cvB+CtqD2ZLOZm84+r\nOaFD98BCDuuTaVvJA0adjU30KnGHf6TE4RIFOlyZeZWBOKC6nVNb7Y1WRJHA\nWluZVJ6CitBPnI7aYoidDlB5ObiaE7UDngIeQLd4fMpOFJCt1Y5fM8DLutYY\npUK9poYIBKYzsydqt2+Kp7bdsjZ7i4yeaoY0iu/EXRygqnnZERE/hoDGTy9C\nFMEGJqHfRKY6KycHeW8enGbif3/c/poxjyQEHE4uhFV+Vi+yocdIKs749Kwx\nxdseVgNcymQbGBLVnG6drhKym0PH4x68QOt3I3EbXsvtlKNVJwE3Yf/1P/wA\n856M7niV9Lhi+RX7cnNk9j7jtgDJOPCNDt1fsZ3igemi7cRiQ1oYGXDnqrSM\nUof98X/mq+qKHwZZEo74XYQssg3exmsPYsxptgzqJzIIFPyD1hRet88ElU10\n41K42gpXyzlegZaXwaEe6+pa5/HhQPCjhD1Q6j0OLqBqtx/egyZ9GqplOY3R\nz9xuOsjC7X27oL8oC7afAS734BubPt6+4WZkplZ8zSs/F2HAEuRUwxELBujf\nkHYRTLX8hi5uhEEeAN3031WE3Hiktut4k5iB2v2KNo2faNwbplVuynwZ56Cr\n/B59\r\n=Q+yx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"de14e3d4ad62255c0b7a6c9a057fc336a7fb592d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.0","@apollosproject/server-core":"^2.27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.1-canary.1_1626722112953_0.0067521633144731474","host":"s3://npm-registry-packages"}},"2.27.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.27.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.27.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3685632b14f19a026ee4991ab43b82ac7cbbada6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.1-canary.2.tgz","fileCount":240,"integrity":"sha512-zx0AHTzqIsdKjgici8RK4GpDcPOvV2IggVLNwi46XaufJ/0tmAz+Nf+6RQZ6c43jF5Llcd80l1M9Y3/bLa0sTA==","signatures":[{"sig":"MEUCIB+NL7G/p3XosXpjvi391+goicgF73wHie585gTlxq4EAiEAusip6DFdRI01MY15ByXe8pFWuBIBOXIBE6pbckzbNNU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":756501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9rh4CRA9TVsSAnZWagAAFN8P+QD3RLNn9wuRAU8Cl+gl\n4ykVmJ5AaRMZjc163HOj3YFXiPyAuTkJI67sd7fYlrUmO0LQS16wnFCa4kPF\nZuMqR12iuuO2zjCac7nLhnW1gQVlS7S8MmTrgvMmALB2UnhzO718WDtzgds2\n1Y98/ZzPjNpTD9lYmoTX6hvpXXJaRD2NjGjsmy3uOiv4sOu/5yatvIQpOfnP\nBE5KZOLL/PdLM32uW/BwyDoxNlZ+fcmySwyWmNj/DnwugAeH2ewXJ4M912IK\nkZsVhIQVyfDjgN4Zl+25K5fcKRmWppNunizcxsw0Ask1OR8RegLnN02XwZEr\nge7v91k+4raHWU77ro5zgizWDw2AwBiX6I9e64coEmaMoNHE/xOGetpuUlzk\njPul7sLB43h2aTXi/b5XoMBQFp9fSJ7541MUnehL1xgnqWSvxxOmwUkNfkeh\nKPuXgk2svlfm6eBv9rwkrEdKqqJzmlPJzDDsbr7oU55Nr+4LFhOmGr24eRnx\nxsyooBmKUMcpWstOVdHglUuO4xLlxreQFrfIZSfrrMrEnISx/YaX6DRdnY5E\nBAcz73qrzpxY0Jwc826z7+ABxkXSAxiv8uBcTs+RTZ++i2QzH9k5fgcetQBw\nXYEKdjvAN7HG5TykqEf8N/TIHflx69up0Fqt1zVhdwFwHpd1rgkIh7PUdntU\nI4Qm\r\n=kz6a\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"d718e38b6a027cecaef128fc78c7115fd0c633e6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.0","@apollosproject/server-core":"^2.27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.1-canary.2_1626781815968_0.230414923249324","host":"s3://npm-registry-packages"}},"2.27.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.27.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.27.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dbc57721f235b58de571010c92f97651e357319a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.1-canary.3.tgz","fileCount":240,"integrity":"sha512-avaEox016p2mYZ1Zc+G5aUUhlTLux3NVoKKpwXhuh40Qtc3LoyXBEDRUjmEWnzbUumbSN2JqY1t+cmAMTc9dsA==","signatures":[{"sig":"MEYCIQDyfQIVMRqSEjT0T7ocOxt33OM77jTOGWrx/O7UOV5htgIhANJ5YjFdi37U1TXATEDeo4shfInh/+BajaLTWNuszccA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":756895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9soTCRA9TVsSAnZWagAAM24QAJy/LnRboInA7bVaHSln\nDjDPIPFXAYMXeKRQ7+J0VM4UU8uGJD/V/LCtU1JMDZ6RuOZz3y8ngAix7Gko\nEdhVWTBqJ45Us6vkgQF/k8o1ezefIFshRPQw0WFRjvg3w3BynmQJMdrTu0Bi\nm2Op936ZQkFKMXXtb164TgIp7dJ2sJCIAaw4S78JWUMb5/dB61TMKghMBV6+\nLbFauxA7x4GjIyIu2EXhjgP+g5n4srFrjXn3vC5b2AbNTaoiY/+xhBvLknAi\nowmpW+1KrEuoRRiItjQ9IhLMRX8wfnGnDumX55PKQLBXBJWIToVD5tYHg74d\nQ71nHzG/25CH83cmV6oxUf1veWeQAUl2U0tOagVTQq4jt+6Um7Yoc4nTjd0M\n7UyTe0IqpKPPFmAaKlSSW/MQM4cyrTOTinrIgwgLhk/kOUXO+bMRbr3eb+h7\nBbsGbVaRiFTlwlviOHvTTITBdjmvRiDVj/jWStSzoHnDeg1EWjw+6/eI17tq\nszwMx/gMdV4BZRgLtBVYXaywpOJDZQbNV9B+KQtnSmLjX361jZkWxx/37d0B\nWVk+QoIRHjXcfP0rDyQ3zvk69zSoMkBslbilAiHEQoIbZwOPXJbvLiEW7eHy\n64l80+IJwCCsgKuJpWikvoMO9236LZ2VXe3xr1I8NQLXhpoXkTpYgH3gbT8/\nC47F\r\n=qBGP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"467fcf83a3c21d1889bd33c9552dd2e5a14ee61d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.0","@apollosproject/server-core":"^2.27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.1-canary.3_1626786323564_0.6639937666208551","host":"s3://npm-registry-packages"}},"2.27.1":{"name":"@apollosproject/data-connector-postgres","version":"2.27.1","_id":"@apollosproject/data-connector-postgres@2.27.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a0cfea6b24162bf2c4df300e9411631544e371e3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.1.tgz","fileCount":240,"integrity":"sha512-uHBWAow0Alin9OZqQt7N3Q6SahjMgoqwFsZBMm4rF8YtkCXocKy/FcIa5FTh8qM5fk8VJJV4Q/t54oCydXlk9g==","signatures":[{"sig":"MEUCIBcASRqR5sKLvJTfbXzj5vwz0o9OUyYfumcx901+U9niAiEAuHwGdgUSod4SUir0t08oZH3093wj37/JZDj+fhcThjU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":757063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9s5ACRA9TVsSAnZWagAA4s8QAILOO1uSp2Oo9XT4Nw1f\nLOFcHK2yhJCD5bMMX85yYVo8TmyQj5OdcdyrpjFFLRwYxmbZgBsQckEFMJ7s\nWndx9hyU758mc4Qj6GsjnZwmQ+q+1wugevJCzHWCsxaDOo3D4cR5esnQ2x64\net25RTeilQftZ5IKmAOJBkbIEl8B4hXplymKg1HI8H8pWP8j0rdRhW5sVG+M\nZVwMi8k1vbiHc3UT89eCQtoaSB6pioJ4lfWWlkcczjkojcnO/SpdpLlIFDU9\nVewvvJ5QFL1FZ2ecp9Z26KItWFe9UwhZ/3uQE5sxKOnxCcpJ8xvke3vkCugo\n37gbi0rwuC+261QeANS80pVjjHvzN5SqQ2KLyxxNSyJrPsD9MuCQn47AwDEv\ncln8ECxOebjKEYbUB0IcBlWUpOO/TRl2Syr3h7rQtlY63PKasiCy27td1sgQ\nz4AZyyYEleU3mCvLUPmaCDewOqiN6kqjPZzTWb7a/NNIHIo3ZiDQ8PzwaA3t\nd+lPOvJBFr9743E+2m9fxgVYE0vphNhzMmY5UcEERbIEGTWV4xi7/ldE1Qft\n1UY4CJ4ZEuIrkOP5ux7Tm1cSXrD5Ey8GBxT6HUkjJaeM+1+XhPMlpqvBXLdK\nwHajeL+04yo2TSFzB6G6HoGuvJ92faqgsfQv6pozUFZESG2/3YFeXI2lz06y\nFZE4\r\n=Lf5Q\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"b0717da516617733c322d19be561ee402c499b06","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.1","@apollosproject/server-core":"^2.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.1_1626787391988_0.5437991270340472","host":"s3://npm-registry-packages"}},"2.27.2-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.27.2-canary.1","_id":"@apollosproject/data-connector-postgres@2.27.2-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7e99aedd217de89c16b10a87c288826f54228d86","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.2-canary.1.tgz","fileCount":244,"integrity":"sha512-ck8zExQxFtf+cdm+e9nLhor0/Gs7fmwShMXhEXCRGsm4/zrmn+PSAQJwDBPMhsOn5SkxuBPRrlH2o3qQXNwKyw==","signatures":[{"sig":"MEUCIAeEGiQuvfAPnA//dU+qI1T/uclVqsFXrqB1uZ3qmmPhAiEA0cP4/fYPi4Lj0unqg+Z6BpbPsUBwbuGgflvyYkHy9eE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":766661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9tm3CRA9TVsSAnZWagAAl8kQAJZHkee/mQwXs977Dsdd\nvcTNYibJCS4K2tFc488p4P40aMsyQaCCWiHl//h7Qf4r/zjxPmLE17TuFrc/\nYMt1BxZWa/p14PrLLQLDLrUOarq3/J+7gz/mjMlFISOe/mrW/Q2mSAiv5WIT\nW+5UaXBM80QME8nvTd7CWO+gUVXsKesKZSzzLJKrBfXiUXZ+f6NrYrgMsh2V\nS5+YBChjuO2VrVLmsp3GhwI5jxLoNAlGKmi9cTGzfJUR1IxZSHrkW2qiIlTh\nS4q+rEEvtep0RwtOOcOnkcU0VqcM6+42j2fZq7VZQf94iuz7UWMstzOEygZb\n9bTG0U+EIyddmT1VsJFCodJMjMjZCJY+Opsbx8iHjw9uFvLrCFDAeOeV1UTu\n3Cxh6aU2bP6AUdA9u6cO9ivAaZ8PkWx7BGMKxVq+ppstRchQJbbu9xU1XWxf\n/y8Lqkw1ceP4pRE2XOCiZWSAUlQa/HsjndyrafFEFDDYZUSRpaa2ZeZSfdTy\ny0yUx2pcphlXCEoq+/jo+FJSZPm3hhRRvbqdT1BN4t08BJabMtaiRsQ7R5Xu\nyaGYxrMz5jm5HhlowJKt8+R2p4bF7bgGhYBGu3Yro93lGuOZBIYTBZ4fvl5c\neMoBIA+d2iOa/7WtRiaAblHMusKSqmMhfTQuMb0VXqGl9q8+/Dyq7iWBQ4z2\nevJl\r\n=PPZH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"8f82add5b071865ff8006faf0c8edc65f8cd4320","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.1","@apollosproject/server-core":"^2.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.2-canary.1_1626790326944_0.07749738732425038","host":"s3://npm-registry-packages"}},"2.27.2-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.27.2-canary.2","_id":"@apollosproject/data-connector-postgres@2.27.2-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"638ad81b94951128a7bbb935c018830243bf9f59","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.2-canary.2.tgz","fileCount":244,"integrity":"sha512-wyNRGTLZ/fIj+MD59/E6nPSIEyNbggviu5cfnxP1KCO0ILmQ/0WjPDI4Q9MXwYqajyBIEEdQtEKsXDJOEvyCXQ==","signatures":[{"sig":"MEUCIFbA6chy6PqTJlA/3Ou7RM7HS+sfs50OzwSXpy3mi9PqAiEAw46r9pDhYXg2BL1hd5dnh+9Ksv/usBZl9U3q6KwBTKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":766607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9uG9CRA9TVsSAnZWagAAuMQQAI6qIxwvIuqPUIceDD36\nYtjGXfn1g/QScXVq53n8RJRg/RaIKk+gpg86UG0WjbYQqrjydxUyo6Y3zF4o\nkNEeV1liA2qofmR12Q7QoEAq9VKU2z5xLpoLArgjPHY3WYjsgEvlQmX84UmY\niG8xcs55q8Uicxv3/RlfZnos2T/gB+THVg5cxua+8bf40KOg1Hbdagqx6sDq\nc4vaSAZEMLgPo3o2g6a9hH83/Dix9jZgoO1u6B5DXmtUqqZRjwlmar0Jss+c\nr81MpTxtW2FlkoV4naOeQ1qeHqcFJKohmOlhszRYIYK1ddShvDe8um8Ett5E\nYA7uilH6M1LS4Xm0CmXnxbmdxhkRFeVwl4/+a1bots1ABkxnKTWmeLCNhH9Y\nHr1lfGi4hE50ajPGrfdCE1K1dYOQeyabQ0w82okLqQ9Deshvw4p5dlkwW9bk\nH20+zzvBrVgOPt422AZZKiVVwnYu3UkAIKPRYIw2ceaZ2A9/4HT0vzHDw7kB\nvNbM7iKWAwS+ala/NKdG8VezzIZwNrxFDhXblEOm8usivhrDT7hazcbS55JE\ngMbNCkHD1bNjNkYXiu2jouHioHGPrTZT1LWeDKAI0Fp+nBRuS1Oj7PRdsccb\nuzvxD/inB1yNQU2MvDtis3VIbZoc+KyIxRSsmZQXss/fRiAitlP5KZpAP+FD\nE7ex\r\n=GWNa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"35cfa6226063cbfad88f716bf141e56f7ff092b2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.1","@apollosproject/server-core":"^2.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.2-canary.2_1626792381592_0.6925969140827459","host":"s3://npm-registry-packages"}},"2.27.2":{"name":"@apollosproject/data-connector-postgres","version":"2.27.2","_id":"@apollosproject/data-connector-postgres@2.27.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"54b3440f70abf16cbb3ce346719595496df873d1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.2.tgz","fileCount":244,"integrity":"sha512-0316Axkpmd1EpCsQCX38UmLf8cj95KDvsrrGr362CKdFF8Yf7qe2nOA4wgkAdwxGYe+ksenl3vBTLfrW7uMvpQ==","signatures":[{"sig":"MEYCIQDOY34MoRcfOyI/fswYEGJ+nZjaXghoQRWEoVgUMlIoKgIhALpnyVEoJudRJmTWkEDtKicqirA4nMGNgQo7RXSMxOIn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":766775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9yb9CRA9TVsSAnZWagAAf1wQAKK20iQO9SevAxrH0p6j\nuYcBroDZt6Ye9NtgbjLyCU/kMJTt98WYb34Pifch3Gaoe+IylRmssny+1d1e\npCxL79CT4/YMDFfsCukVX8WZALJp38czBTeHF9yrPU4Whh9e0snCv0sfdhx+\nXd9IMaa46t8NN/zSMZZ71YI67hd11rVR4tGO4yvaSoHGUeVtmDOfbHTYkzft\nxdouhlZDf/X55P2+Stytp3u3J3Lm97Iod4h02a9tWQvUJUdfhE+j8iu3AKvg\n5wBnAz7t6D3WdnXvK1BLwoImFJOti8OzCExqmmMSJKRqAz3TMmkOjhQmUjC6\nzdwtELRNqYqRp0f0rDmltfJOawZt4tsdoCBC7BrdWjc7J0/eRBw7jCDdMp5C\n+hq22NFkrTuri7NxqoeIXfz+I38SVCMQI4h8ja/7vz7uKv9WJoWAKFzHbcjA\ngIZzwdoXXTQLKqDELRG244bdGDizcyMwnKBKnHcmWw9k3fqQvhu0d6NeBP69\nVd3v644RoygdRACsvrGDgwx86tkt7DXc4uzi4YVvWWKi7JN8c6nl9cDvkUd8\nPqWy0AIv74HxQLZhNdT4t+SwTN7mGD8wiPxOf3p1GcqijGzebvD6V6hnsux0\nhiVIkB7Yeycd5ONiTBDrcO8JqW4xFT35f0N84/C1kl3MGwkNZyBCKWRcMwzv\nhc01\r\n=1WTi\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"fd9f79cf8876c862cd6a50abba490916fecebc5a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.2","@apollosproject/server-core":"^2.27.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.2_1626810109682_0.11038706714009927","host":"s3://npm-registry-packages"}},"2.27.3-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.27.3-canary.3","_id":"@apollosproject/data-connector-postgres@2.27.3-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bbd6f4764fea889d3d8679f738c68494a1d03411","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.3-canary.3.tgz","fileCount":242,"integrity":"sha512-z8Tl7cUnwPUSuTB2tyYvjx4aVdtB2WwbZWPj4phNP2sDmps8tUelbk+DGD87yrdiHBLvoPjE9zo0qDEsBA0/pw==","signatures":[{"sig":"MEUCIQCznWtinkuaowtR1ucYHuNu3AXYH1s2S1sPXCWsBOBizwIgKNvOtzUt0xbFrDMZTm32AEPpNn4B46Gf0rcOdKr5pxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":758164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+MoBCRA9TVsSAnZWagAA1DcP/RqfTE9C8VK0sIplGSRS\nh17IXkNdMRq3aNGNA2GMliYlLhI6LyJSelHoJERrP8mteSp/PSPuNSs9xsCC\ncKUlsDFAKidjDnlKnR+SMSsIDyDymJkwPFsgc7vQyou+WkfpIhNAl+LFcDRt\nCZqzhs8k4MDTHhKNN2sQK/ytwfRAaOmSoGBYCXgwSOME7Dl8H4otxzrBOAe4\nGChEKM6K5Fnov++wprRtJ1uiRq3pUHTHjoXU9AdC7gaBoDzj4Bka7MdwARLK\nZ5c0edkzeL1TsYZken85MC7/VW7N3h498rnTR397Wqs/KVSzuBk0s/GQp6D3\nn4jJfmpc/YfBXUlYZ3+HJvDlSP1pizVuslB+9vcVPyrr2p9JBL7r1CVgCfIT\n55kNhevFEaespuQFtA5Jt3jwp+Ax8Mxcr34Oyj8YsiUjWsrncyYBwLH3szLE\n/ufE6gu6JyM3mylakiECyw51HegyFq46asaPVz5zaZ6PM5bPz8HyufYBYpVm\nx9eIIbmQgmS29maQOE1n7jVJSwucmP6VIULeYFk9x2RgRFTg+i1LbJVUQZEP\nO5+YtyAiJokDUcti40/YF6wpBmjet0NMGVlMA96mbLuRhixJakRasYD+ByHj\nmftlc03e13UNbgTfPed6ffpUJLgsKFuz8luYdGn0wRETIS/Y0Hy28Tu0P9AC\nwcG4\r\n=yeUq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"792a2b78832aa8c6cb5fb9f90eab733c76bbaad1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.2","@apollosproject/server-core":"^2.27.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.3-canary.3_1626917377560_0.35924629175810274","host":"s3://npm-registry-packages"}},"2.27.3-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.27.3-canary.4","_id":"@apollosproject/data-connector-postgres@2.27.3-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2cc9cfe905f3104e7cb2f0226e769c19cda3a2cc","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.3-canary.4.tgz","fileCount":242,"integrity":"sha512-cf1xUgJk/hDdG7u47cs9zbYUHn4AMD5jfQF1wChdwg3tCsBLjOV1+5WAC4W9QLPoZ9ZEbikMWuWv5fPK/HDL3A==","signatures":[{"sig":"MEUCIQDd32c7yW4Q7pPfGZ2IJreDpVEKUMGkTYqXdQeGtJe3IAIgRhh1qIVKqu5ew63zqzdCeO+tF2Dcao3GaXStYifnWmw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":758182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+cGsCRA9TVsSAnZWagAAoSsP/2CyNITVfLrbq8Ciex8c\nfB4AFAboPNPUhMQT4nMxEOHii+Pv5RfXLDF52CNhdBvPQTIyrVVoq0NXP8nk\nA3dCh7OlpvbPCKA8IUkv55I5Cy+ZqT45yWuwyAhm7EqjtOQCZqUoeGDw8XdM\n3SsFKCuag9PdfiMfpNJKh/A9OL15Wlx2r9/xeQmQG4wVeU0/8rtHJVuKn/on\nhaTdJF3VCiQy8GWR99eTzR5YZ5iwL3WWpFjiNrWRc7BNdrfMvm+MxXD08+AR\noduItVT7OT9AmbtgWroCYEZko1VwcbFaUG/XkFQYLzmkeLpo2qB9zn6VZXRt\nluqgteb3e3v8kZkL07lkbNMzmb+ARLgW4/YGAmDfcFyr8JNY0tXTIvXq3pMy\nSJtaAQEsu8vCJN0Ykod4GXDEikLjRO5C683OtuMmY67Rzs9+uuRs/eFNQIfP\nCuK2TnqeCtcmQxe49FmUSnqGVNhZHng95kEDWlXCgYMC/JXL6Ima3i0EWN02\nVXDZmtRSElL1L5yBcCpbRrE2sW9kh/z7xV/NjGEMAkOkHLirnQWSJ1JuHHhy\nHzKW61Grfxjrh4+i5y75QS7M0N0pJ5dWx/ocumIj8BvvMcJy0HXnEkv8CoH/\nA15GiKp6tSp4vUaPhPEqND9uCr08KbilOoyiYPkeld5WKwK8TePdBsUImhV9\nHGxY\r\n=Z8cB\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"a4ef9ab75b10a16fe62814e0ba0be032745d6394","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.2","@apollosproject/server-core":"^2.27.3-canary.4+a4ef9ab7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.3-canary.4_1626980780707_0.04319585040434504","host":"s3://npm-registry-packages"}},"2.27.3-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.27.3-canary.7","_id":"@apollosproject/data-connector-postgres@2.27.3-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"08513ad91629fdf173d08a6b721a1d9abdac7927","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.3-canary.7.tgz","fileCount":242,"integrity":"sha512-8bxWEmfvifRRdu61pAbzqxXk2LPrzRhfn+WqYGg4IsRJJaP2PzI+WiFWRmlm6DknMjDotmctmExGHOqjBfOMnw==","signatures":[{"sig":"MEUCIHtCEKDHXySJWdtUsibwPTRS5o8rcSHk08yEhPaTUEslAiEA6qBsr8E9fGEUtSWr7+HLzcfPvVAY9GrrRntkbIvDU5Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":758200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAHhECRA9TVsSAnZWagAAeHUP/2lcgbE+lJixBp8qqr/4\nGlyoMsFOdeK3HZCwT9HStkjsAwzNUM5jAllT5hRHbMLI76JkP1H6I84JyJ6g\nts+3ZaWf5XtM6Sj0y9VXrU/95UmAUO7gd21dC2WZMAkM3+MW9jZareJlW/9v\nxhhSrdzcft5YVw78HJAG33ptKmB9T4+PUEXz9r+e7/H890rAcbL/WyC1B58V\n1iid5hE22g+IGpyDNm5J1++u1LPWC8Z/X8O0Yo3pXd4Dyy/4zgmDeDXvGVzl\n4NjAIefXGbdh6AE2eREqwFo6Pi0uHJN6OmULsdm5iAXfLE8nKey4Rpe1oAuX\n/aQQXo9lju6rjAggfzB0u+EnZJ678ja9OS7e154zPm69L6H9c/8jC7POAQ19\nfUEcx9wv6tTBgkoI3coMTtDiGFOx5e84Fi5ne1lTquBl/UfXO5Fs+CDEtMZA\nAIUjNfHEnVgrKT+QWjCYxsFux9/Qo7NCKLaFRflvfmVsc9lozb0NeOFwH/lC\ndYcxZi342y1odlNZfzFd7wbCT9uby34v5/j/DKVsLqF+BO/mEPaSY9kTZgK2\nigoxV6twjvxU8tKGu9lcT0vBLxSFvENyVswLjHE31g5YKTj92jFs3jFGSChm\n4zxtCZjygzHtHcV/fnKwXSdlLSuk3R1hkUvD4gqz73kCnvSxf+6oB9gGGHYO\nUkr6\r\n=Fdhq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"4946de9242b21919af8538c204943ebd5bac8ec5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.3-canary.7+4946de92","@apollosproject/server-core":"^2.27.3-canary.7+4946de92"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.3-canary.7_1627420740286_0.30806316695568103","host":"s3://npm-registry-packages"}},"2.27.3-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.27.3-canary.9","_id":"@apollosproject/data-connector-postgres@2.27.3-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"64f344bb7529199f7b7bcaa45a4d77891d462428","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.27.3-canary.9.tgz","fileCount":272,"integrity":"sha512-W9FdtY/vQvaBuLiOJtYj725o3fnbDcVxLkO22oaM4Ngi63TLseptUFHeNlfkLe2kFssIxC7i0rgjSA92s4+gDg==","signatures":[{"sig":"MEQCIEtDpFhvtKC7TyVZgmNEtjnx4U7W/180aMIvT0JOvIExAiBPhYCmgMniWZ/S19hV24zmNssriHuL8E5t2fBSKz+PCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCC1PCRA9TVsSAnZWagAAOMgP/AlDQKm0wRuVV2BPaZJ0\n9Z/grWt2eFNTrAHx3n9cfdtUWncaLwO3BJw1hqOidYKStV3maCE6lOroi3fa\nozSCGDRQ4iE1+m3CNOYQ0fB9arttHahsvC40ne67+nHTzsd6Oz9kRrAc0dL3\njPV9uFhs8/aD8h0WGriQB0Yi9QIqsZwqpBTZ2FbNn+nldS+n/61SjgEL7L81\n2wplP0LBG5wgHVbF0V5q240wtiHVwplfzox+C7D8Gnjmdb/9CIrYG+CEXaAg\nSBvUfcnqu6jODo8gmiH4EF38pkq7CDbq6GsXJ8dnB/xF6W/soVe/2o40x/HQ\nJ6EMioH88KGjj4qU93AndQc1MfCtEjzwrdlVvLf/0Dip574XPCQgVjIsUKb4\n4TU94SrSuq42Lmi/xUnOzXq+bZdM3xfyUHDnaedzuor2lbsunBkh4RPtc3sg\nrMqvf0RID1G+5otdcNdxyYY2Tg9DRvv0o+G16xtwJ+cgoc7b2vc1rjMSFljR\nGANLNBrHuWNZiYAz40omRfsIspsuZJiiQ6B8nVnW+i4naynmsrEQgb+Hs6Me\nZnIZdc2FxrZtbvzO6ktyNxEx8A1QgPOET4I1Oedjr9bAofgIlnjzFt1VtZvP\nVW8eEgk+lk6IUjCm37xrYVXtGhaGyqIN0FZxdmoL2e0hfZP1VADlWgoLeXES\n4RLt\r\n=9pjT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"925553adf514fb8a1d9f3263cc4932d60f23368c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.27.2","@apollosproject/server-core":"^2.27.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.27.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.27.3-canary.9_1627925839150_0.4046641938321991","host":"s3://npm-registry-packages"}},"2.28.0":{"name":"@apollosproject/data-connector-postgres","version":"2.28.0","_id":"@apollosproject/data-connector-postgres@2.28.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e87f3c2db0701dbf674cb8bca96877df92b81acd","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.28.0.tgz","fileCount":272,"integrity":"sha512-3eREn1ld1YQL4xoLhP95glqe9Kgzmi1lqYkvpP9Abd18Wq2RhNlbg4XozyQX4S1HkRbJNjEhv5TYQRR4eUEueA==","signatures":[{"sig":"MEYCIQD4xqb0cwnk8DoNiqwYT1GpIeZ71KdG4BxMkE1ubrMbiwIhALbZrHyHs1iN/YrqZtpaMRhD7hOeIlzwAB6Hu3Ueaw5T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCqmwCRA9TVsSAnZWagAAxR4P/A/Y6N4dpOgxHquKCRPS\nPneKyBrmthG6s3KXWuWMJwnhSLl+AXax/Eqq+Di3tyR+oQxv1/CQQ1cKUzjx\nTtX5RlNFxHs1EhccB+0qxI9q0yO1Y3g6NVk7+A3BltDfFxb+lvWWtBTRWvAq\nUBSyzRZDZWFB2/krQDiQ2LyQZYziitKHZ9IvexE6EmSW/JKb7KcqCucB9IeM\ntATMKb5lgEdKRmOcv/qR2r/rKx7qbeRH/B0hB0ytiOKDz/dDJiU4yKA3CUEq\ngEk1jZ7VA3RgI8Kqog/ig+27FZB64dhxozSnMHLuNJMI7VHB3/iITvb5PmIO\nuPOfNwQZwa3lRbD/fT4fHIaDszOK+nJjLgbu+zQiudt8GgKG0A2zStNN9dZm\nEPDqKXWrKL2yygtd399vzjVOLyY94QrbJehWBkYnIF8nJMQQeOnct9ZJIUgw\n4MiYwARNmAU/d0vao0Un1VThiz28EwrlKInjzqkM+5OIFvmfuQMVXYhGKr5P\nAJm1uqzSq3TGDScIpDZmE/lpSsXBwDpm9+B1aEWr3OeA6jo+REYp+N6aX4WQ\nsPfNofeF7RToaSNFFcS5VetchukfXiijQSavdDIJ0NsFv7XZE0HJP/SB4pr3\ncLJdly2JqeUFisOwAfe3ZYg+CB53HGbCIBvVLq98pUBZYOfXTjfNRr/zNTER\nyvbm\r\n=gZ5I\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=12"},"gitHead":"b4af302d4bb5d8fc2258638ad0d21c7c8bc5da8c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.28.0","@apollosproject/server-core":"^2.28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.28.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.28.0_1628088752415_0.6378796860817679","host":"s3://npm-registry-packages"}},"2.28.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.28.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.28.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0847227de60827fa034412ebff6c51ef0897bfdc","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.28.1-canary.0.tgz","fileCount":272,"integrity":"sha512-ebp/hFKRlqsB/dRhwZGu7QF2C98TR3+y76fmXpgXToRU4GLJs89E3E9bJ7St2LHazMKQ0SPDAuA1cMBFrU1+7A==","signatures":[{"sig":"MEUCIH1Q2TeB3Ya8BCoKGudzk11P8C+BqjvHOdHzg8xZS26BAiEAi+lh1mnamYdPDrydzx+MKQ/XFnfjHY0IL5yFEWtTydM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCqoXCRA9TVsSAnZWagAApfAP/3pvG/p+FQS1PP6B5GKi\nSc3PsEmWChfjZSvnVrZ7q2JeYHQWlp1NTeWWhWvRtx4M5r18VeoBb6tqTKjk\nycsL9z417qHigoUxP59zIkCdylaclTl9AtMz2iK03mXtVNsDeErpskoakTZG\nK3QHYsHcXEbCkl1zd0TlXzGWV4SfCMBihzyDyj/CW7kqVY5W3A/qtAhJ1/Ju\nE5G7wOopMHmy5VVM24ZE/m2VAvowdsZO5cgdqacgrT5FAf476qC3DD05VuTP\nNUtm+WHdTEj0d/4qymZI7/JUoFKnu16VYBe+rT8v+TvAlJJMMKfHPiQu+Ub5\nxDkEbodBaT52YmQGRVj9/YMypZBEY0216+4JfpzGdz30oHW6Mw9L8kjFE9t7\npqMZSFWMuE2SLYkxQTOBXphibSu6oDWIy88EeS7n6XC963IDI9R9QszLGi+A\nUzAPL+z9LQpCVgR9RpE8bHYRSx177L0S63XVr/uieIgznaCJIMtfzAb8otVa\nXBQ//PwMB2XazhCkvuTFqYmAQdi6dvjSCVdjti40OsPM5ndCr20Osbm7WzaK\nXE6r1MqjaOzlqhxq73pszudgoamkbNA+9SC6UAKfBe8yn1DmSxxavUkeW093\nm1KToD/rKZlR/saRaxb1uhYXDGUvPD/MH5/yixTEq9D2s+5iGg/lr7DAgp3u\nKxzE\r\n=trJN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=12"},"gitHead":"b4af302d4bb5d8fc2258638ad0d21c7c8bc5da8c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"12.22.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.28.1-canary.0+b4af302d","@apollosproject/server-core":"^2.28.1-canary.0+b4af302d"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.28.1-canary.0+b4af302d"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.28.1-canary.0_1628088855422_0.11216546594947419","host":"s3://npm-registry-packages"}},"2.28.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.28.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.28.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cf3ced3765e4990d30af09bda753d3762ea8de54","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.28.1-canary.3.tgz","fileCount":274,"integrity":"sha512-alY7VnExpVBGLBs/8lxU6JypoR233S5WWdcbZJXs5RLYJOuzYCJlxb48dMddmy/DJIKy0Xa5wkHZKVffs7ZWmA==","signatures":[{"sig":"MEUCIGCH9TSf6jNSwHEr3mYllLjNgifStz7XZ0RVmHzZ4S0uAiEA30RD9rEqFM9FefljlveZiNZn2OVXZlr7g5JNe0k40KA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDCkhCRA9TVsSAnZWagAA7jAP/1HBOMovZGBaLkCavx54\nDlPzsAavYArgXExxopX6sx4LS/MNB+963nt+swZLi3Vhb9IcIfRftpktmj7n\n9+Qm2vwIKEf18A1zPayVJKGjhXcK2HKCE1qzH6COBwS0VXLprLXYUr4BdDl5\nO4CW5IIee1+WLZUzcS0AHL8oBnLuEkGBTc31ArIBSN7pgKCYAKROxnC/GWPb\n2VPrVyXk84lj5hj/B6td0BHu9owVkhETZkGOTsJUI0hdFqK2ZRfaS4oFJxEy\nDsHrGRDe14W3NTXKDl2H6sseO4lNFMhALfvylhqWiFk4QIrfV/Q6N7Mm7gDz\nL9tfoD2wths5UpldFAW7GAbx0nvy7dqjyIAs6tRif4ymTSxztqbMPqSGpvr3\nB5MHgr2UTM3sb6GPVEOvEDgrx+HWWxDIKhuespnP4xKyvK3zrfR8hL5OxEc4\njCylMgbFN9T2IIiLTh55Rur8VEH3OXFe5JNgUeN9bJqu72Gp2FARpd3K/14u\n1sLU0inCHsJmh2/uxgiAaZVWFxTumFXAwqWhlCJPInwZ+NlBIPVovDb/xRt/\nCKgKUhp13MuVhEKKFM2ZsU2pOO6zL+VILW54sJX3NFpu7WVUfEMWv/3rj4tS\nLYDglrNNEE/FR6j3bZ1dfRHZQ44y8l/Hh6A5CZHuEJxoUGp8rb3CshJYcKX5\nHReo\r\n=qaZv\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=14"},"gitHead":"b4ec2f37c62b18fe4911f0486ea51c121daec39a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.28.0","@apollosproject/server-core":"^2.28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.28.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.28.1-canary.3_1628186913046_0.588062517858984","host":"s3://npm-registry-packages"}},"2.29.0":{"name":"@apollosproject/data-connector-postgres","version":"2.29.0","_id":"@apollosproject/data-connector-postgres@2.29.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2ce34d3428d28ce2618b553caa84cd11cb7012df","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.0.tgz","fileCount":274,"integrity":"sha512-N9ijryuZRn9KGXzpHD4Vf1mpwO3lOD8Uh8S69QKSDYM5Jsox7wLTtzK2615MahZ8twDRkOYoOsKUJgzCOimS1g==","signatures":[{"sig":"MEYCIQDisv/4wxRQQ4uwX2pQ7tPQGWhzk67epXFVYJ3fdjPyugIhAKz1Iee2yUMzhgzeZb3YkoRdDzmJJR8mZ0zFNt3WFUP/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDC66CRA9TVsSAnZWagAABYwP/3NFyzt2Dppjvx/jBB36\nne32u5aScMf15TnY/b3OBOp1E+BAov2PsaO7xUk+5YxsyoAwtY10qr0gJwFG\nuBLglN6cfWuH3t7jalCA/S8ujlOnk8Fwp9tIpuz7MxMxRRp/gEHl2bMItQvd\nvlYn2xKuB6Y9+gCyzFvBAZ+jk3jcaPsyaYlyLughmFnC8uVwMVToRUp8rHUO\nh36sQnrNY8Z3Zfwa/8Ef3kJUh3jlOR2pFRWUjrfm5DNcS+XkGVVJI34JRm6j\n9F+8DSe9cwWqs4kYRozhcTwHuJQLaW0XZkBiXBJHeCyGaQUhalla/syxdu0F\nKEeLP+/5hadeb4OwV1U6UbzvElgrZ70TKF6PwUccav9Nv03iJZ3n/IPV5mwp\nZ2ecVt3/Kqqk8+jNDTdJGGhKa/uvxMe0DIfbk/h+VT2jzNIByh4yoJpbNVop\n9Yk7lHSGsKSERJNka5KfS42upOQNZ6vBrvpA/HBXTSjVAYhcDWBJXc7DkXvp\nwqqWOMWY2a4xSh6r4k1ZdHHBzDQdhROCQkLT6Ulk8aJnRwTuB+EJETZI4iSA\nd7s0sADVUlfU634/fQMNVVj9A8WAQq6tj3SmbgLa2lSk62yI53ri9CXVTTpM\nSFQ01cjA67aFD0ZxVejOHiQSimJiCnR70/uQw7FBb2nSH7fK8S9sQPQA30dK\ngdaH\r\n=hz63\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"ae40e735efe0280a5cb7f334de3c5e6e87ed2c42","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.0","@apollosproject/server-core":"^2.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.0_1628188346169_0.48760236703341375","host":"s3://npm-registry-packages"}},"2.29.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.29.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.29.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"28cc946034be9612ae7b73e08f38ab25513caff0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.1-canary.0.tgz","fileCount":274,"integrity":"sha512-vpYLyfJyVwIjUSOZudUr0btQK3H6kBCSOPCGiBhLLDvm0HDKiZ3G7p7A7nDtI6/gaVVRfvvVP+1QkZbuyfC8ew==","signatures":[{"sig":"MEUCIHFjXa3s7lclsmPmVaEFJdOSLXRvDd+apXYCvJAMr25aAiEA+Vx0nHXEf853GrZibsBnPh9FDhl9K9owWdKKpcmoqps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDC8kCRA9TVsSAnZWagAA+1QQAKJF3bCBGLpjvyzTlDHv\n9Bp9b3GgfrwVQ19BNQFDmyEbpEgLwpMCzko6phVIKG7uMw4iR2lNzgM1lNqp\nNU0hUPro268Or646rUH7F1ofkgWttxxIuP6V4qK696G4vVKX9VSaL820Zv4a\nvf2MO8qoMO2AUMGhfwHYygGOHA97BmY9mfgW6tJ9CKn8v8Nnsn/EUJjZcyEG\nFmK2BDE1CLYvOXYA4xUjC8TJ29hoq9XvNro2TmGpiLbaXfHSTNnlRR+EpoJu\nAR4/guGvesfmdiEDmlZ/KODFwPhOcx1n/nFW3HM2NF/dAgF0cwPlZmgZYMWP\nQSTymX2mNb0esy2wKxZg3wAhKkFssP0EFLyNSLUmVWmKOPzVywPQrgzkDCp9\ntANJFtJdDY7KotnCiXZFb5wQYrtBIcV46GFDlyuedTPyASfH+H/qcZ6VLA1V\nbEGo9ccd8ANIS3iJC/2VqvdkIWlpgwFQSapLWMTAzBeSBQgTEkfnD76uwv+3\nq9k/H2hKLxEb64bonqI1J542EVOIlmoarsKuVeZ4AdF7R+qHBfCOAUdVJeul\nDUoag7pipwSgaXRuTV3ulovH2hrS7+++p9beRxlhwJFQ5gQr61oBy6gFarFe\nPJSzumKgXosSOkocrhYYvAfViWcWCHqTrp3kAYjQwr0iUA44R2NMaMj3jZrE\nVl8U\r\n=hg4X\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=14"},"gitHead":"ae40e735efe0280a5cb7f334de3c5e6e87ed2c42","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.1-canary.0+ae40e735","@apollosproject/server-core":"^2.29.1-canary.0+ae40e735"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.1-canary.0+ae40e735"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.1-canary.0_1628188451818_0.5360410335138182","host":"s3://npm-registry-packages"}},"2.29.1":{"name":"@apollosproject/data-connector-postgres","version":"2.29.1","_id":"@apollosproject/data-connector-postgres@2.29.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"378e90627c530f77c68eae25e1707cd00a02481c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.1.tgz","fileCount":274,"integrity":"sha512-fEoEKyJK0yXBHaqC6zxereEVyDA3jqITpwIbt9jN+Zez/NCE3H2mVu5iuqvZ0JWJ0piHFN/TwhfDWppqf2700A==","signatures":[{"sig":"MEUCIAaIUYy9Bmj82I1xgIFMI0sLWgjR9l/2ebmirjxzz5Y4AiEAomOjbToj1EW2xXUYj3FvB2WXwfJaEhRsZMXXY+ZlUNg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDUR+CRA9TVsSAnZWagAASEcP/jaN5blv+Jd3hm7DwPrV\nrhwCkXHJLLU5eNY77hSgLpkXCVpHcRYZRVliSE5gSZ4RCL/dpShcAYnzUiQy\nD6XcOx0Q4QXX4HbXpKCL3YUkYTpCl0ICRct2jtiqdTU6qJhIkJAu3TJjnHaq\npPGGvdBe9D4DJ4A37psnX3dyxZbRendshrhucAzwFUYDtLaC/1QS/dbC0b0h\nsaI0Ixo5YQ6rOQdyjE3rmv8EwoT5aJZjQ0h7CVXQ4e5Llh2svonmVz1KTAEm\nCP95T/3OKS+etn8ln0EKudt54X4UNDjyUlNbU4Ye/IQ5Mj2WsiACcYQaL6nl\nAffp+ZeKyqBu0/7Xl8l+5/vSCsTVqi/m7Hx7ix3Dx7jJ0UUXtUZE3Yd+mxTJ\nqWygVzEvZE6DOIMUasZAZ9CY6dS95VDlW3mtNcq9bhlFn4R+DWr/jUShHlse\nG/htICOMEM6m7nIAbWI4+SW2VAXGfOhubFc7wIIQyURJDeI2EpMGTNFqViKf\niGhDlkkxocTfpnDlWISMdXzigRwYitLiNsaoBef0CwpQvllxF2xe1IVefYWf\nm986WZImw5P5iBfyEi0fwhakylt1lkbRElcQ8pMb0Oqg9aROQQisY66fmL6V\nsBhhSBwrqShYyoxFVf72cKThbyAw0KYqragjcZZdVGZyOyvP5IDjnMiSX5EO\nMzT0\r\n=TMqd\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"14660fe240565142e750f775dcfbc98b767f656a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.1","@apollosproject/server-core":"^2.29.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.1_1628259453857_0.3966366018062557","host":"s3://npm-registry-packages"}},"2.29.2-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.29.2-canary.0","_id":"@apollosproject/data-connector-postgres@2.29.2-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8a8038cdcbcf83334648b6d9ce49c4f10e4bb3db","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.2-canary.0.tgz","fileCount":274,"integrity":"sha512-5L5rszwWstFQcM4X23ZKlxU7Wk9VnTrNEKz4W+46KKLjFLLw9BmKtfOqNP8KpFbpbQ+04QSNPKk7EkBTL+UzLw==","signatures":[{"sig":"MEUCIBr86LLsCExS7GhPeJmqtdtqVjPpyfuc9N5n4hQPipM+AiEAip/PRbYZH4ddXwM/2TgsEy/6kGjH5G+8+1iI33CSTJA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDUTpCRA9TVsSAnZWagAApnoP/isDGipX3ZkKg5GyVaxl\ngTWb/NZGbogLpq/sRMMj0AKbYJaifrES2OkcLMeEsc++kth8G4Fu9odVx1iW\nIM1y1YMsZlp9RhNTuMplGe653j1EKrlunraLPg91zmO2pBkiFh8DlBnZDrFf\nsUX2WWTO27xrBMF8BsrO1i5xgFaV4HQhezhuDyakZG7ByM7rQa9UVBHCPyop\nWG1kQL53YlJ4BqDxjjI5rSQDKPS8Ft88GXp7lTlxty+ujq6UOvEqwOLHzTeQ\nfFCTvhdGL8e1KToNMJKT7GO2O9Mvgp9yKSqlmKqLlFafrHL9opGqgZHv4/rc\nw4T+dpfFa8QezVdns5qEQnzciL0nAzsaMuA5edLBtmOc3kcDXqAYpZi3jftb\nxMyAzEyipSQbk6CzDU4hfB2UeDMlqrnaFC2TlNQvdKM7vZgBsurnxLdE7miW\nS0hihL4jFQdBBxWEkffVFuVR6ImD9ImLeQetR/FdaVMAREfQEOttvUhmbA40\n3dNYcMd4hXFuQatEzr6Ye3oYTduQRxAA5ikdM899mb7CTxhWfU3S27F6AJVy\nFbmbUbdNPOiVMWbK6p5D0O6080UqLmtumbL2r4P1GUkqQa9PBxl7yO2BBT+0\niLiZvopGiN09oevpTNfOO6XKpIpClCxBjfjrMsbRWjRbZhUI1y4j5/dk59zJ\nVxY5\r\n=IYQF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=14"},"gitHead":"14660fe240565142e750f775dcfbc98b767f656a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.2-canary.0+14660fe2","@apollosproject/server-core":"^2.29.2-canary.0+14660fe2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.2-canary.0+14660fe2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.2-canary.0_1628259561553_0.11311185292934489","host":"s3://npm-registry-packages"}},"2.29.2":{"name":"@apollosproject/data-connector-postgres","version":"2.29.2","_id":"@apollosproject/data-connector-postgres@2.29.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ae9c7a50c133116e438fc203668f45d0e74f247a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.2.tgz","fileCount":274,"integrity":"sha512-ZrDnauP30JWqvZxvwXVXK7gSMVOzzNv4nE4RmeipfPFJft5UKfEd7ur2Fk49pIfR/jFyZNgZ6B+Ic9IsrOkjBQ==","signatures":[{"sig":"MEUCIGCBXNPcBs4X7a6gAhCgxr+WKziRopEQO9RTDjfYcIKYAiEAhL2RuBYFvvwQC6OByV5e+y29uFkaqR/gTryakKU/hxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDVd9CRA9TVsSAnZWagAA7uAP/j0iQY5EzOkqScfF+i6C\n3/gXA9Xwzysg+FfDaiZ1WJBq6zSDuqDGfWIWJEa445mt2yckf3z6slPM7T7V\nAc+6lbPj6WdtqzVyjzEGJjaLsewCVjVQ3xVI4eoa3FSyRY3drsY5Zmc8iMOU\nQjZNNq8TvFOJxxKvf2QMgEESPrN/JV0UP3m6Hi2a5LjTA9UOSROdHfcqjLdb\nftlK+rUxG9V9JijrBLbiHjxvzGDzWLVywsLlG/lDD0OVBtyn1h5pGZ9bbC4z\nsiCc9g5xD2KEQcwmeyNn4hC2BY8o1BuHzrEcTjYc878Upr7LRv9A+t8ugOv1\nOnHXOwVKGixVAFQgjfRllVRhjH3SJEpc5y3f9EiMcMPBt0VbldK11Huzym2f\nIfBpjLTPIfFe/AjfzpLSKYowS/D4zs2u7xq6T97d1DBMGWLkpR6ynLj/luKV\nxi0a+IJZlfEeV8PGtjfmxoqnYr+06IT6iOALzIJlJ/+Gq/49wSLRgoGHLKwn\nssrNgBvDJJE83JE0dqPjvdg9w1BMEXCpLFn3ukFtwg6w560wkAjofwQpih4Y\nGZpySQM+DA7fH7YkH+QeJ/T7G3QL67w4UuVO0Tl+F8PBcxqCoG+1zu2RQ1fD\nncsxHlO+p2WUbWVgmZKUMcLHg/5Wns4qp3d9xQnXoq2+En9oeYLDO4v9NCxJ\nVJ9T\r\n=fdyu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"aaa3a9fd7ad5254cc06aa87475ea348cc3294da8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.2","@apollosproject/server-core":"^2.29.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.2_1628264317481_0.39277297328573924","host":"s3://npm-registry-packages"}},"2.29.3-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.29.3-canary.0","_id":"@apollosproject/data-connector-postgres@2.29.3-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"32e3672b6edeb389f42afbd68247527452c605f9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.3-canary.0.tgz","fileCount":274,"integrity":"sha512-pK29Bb0evyj2KD92p8Hbr6TVUI/Sdd9J9pwjA4uuXDd9ZlsdvQKAfQWnNW7oZZOSDRJYlpQ7zcYHhS/C7MBp9g==","signatures":[{"sig":"MEYCIQC5XDkLED+lU0mNxRrtt6sRXIaON6jwBCxpZw1s5lw7bgIhAIyMs6Zvjc0gtXZ5NUWrRUoThj8PJA+iWITLOC/YUjQB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDVfiCRA9TVsSAnZWagAAdmwP/1KzxmX4tDLnZhSzGg4W\nXEgYWfeAlHNJhxcW7b3+u8mVAEXbBO6+eRUB2zYEgR+PGPiqOFZ+9UZmVzXT\nTU8sBFrJILpPM+/3koQp5IPvtv15v2V7SSR9OEVsNqWPGj6cGC7yZU5YZSbs\nTfri+n7lXvOmZcAI5eS0fSvL7D2kQqp9oJeOzDhC8hvN01JQ0Q937gelD9HX\ng7iwj8v+fPjXtvPg8tZ2Zu2jSxa3N0g5zr3uPXI8eWL6ukL/0sRfVVwhC1Ww\nbV4769h2KKTF4TSQ0ZE0XLZoXILdpPJtQApCgZx7JRTJNqiy2hFXBcnvYggH\nRin6+7l2ebTgrkp/b8hmbfMdbg5PgdprLjBDMaJF50our3kVpmoxTPywcQ2r\nBU1W/L0AP3Ap1RnfuKK0zRj3fox1Gn49BCN45xBRVxK7E9mTg4gxUJBTKn1e\ngQl+WRTo9pAgfctw1rT6yRbq5gsoaMf0S/jHbsG9EjjzIO2b/I+Waz1qX6zT\n7stP4J5Bu4WRjjz2dCQmG8Gj9+3N4IvghiT5ZaMAlTf3PCbMcH2vgKUBadpM\ndBUVkPD8opIe3VppeFUGDTk7Go513MU9BJgJTr/XGs47mHCO/ThSxCcTh8Kl\nYanyKeXCG25KDhuUBqcoYmjjufIIa1+pxjug3cSmZPzXq6j2QcwTp42L1MGM\nTNbU\r\n=aryy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=14"},"gitHead":"aaa3a9fd7ad5254cc06aa87475ea348cc3294da8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3-canary.0+aaa3a9fd","@apollosproject/server-core":"^2.29.3-canary.0+aaa3a9fd"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3-canary.0+aaa3a9fd"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.3-canary.0_1628264418285_0.6849999235391142","host":"s3://npm-registry-packages"}},"2.29.3-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.29.3-canary.7","_id":"@apollosproject/data-connector-postgres@2.29.3-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f44cc923045dc8311640c64ff23eef4136b69dd3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.3-canary.7.tgz","fileCount":274,"integrity":"sha512-51IeER6N7yuHoZ5x1qVWmKNMcLoTq9V3op9MOsMf84HWRetI9OBLOjidGKFIl7U7pji0EaX18xQj6GOF5ioBLg==","signatures":[{"sig":"MEUCIHA5U2PJlPpQBbbCIJd6kpSFFIvvsHl6OUYY/cHHbi3VAiEAwpmdW7hq7zzhqkFSiEqiZh7CgM+mGqULN7DtZgCmOl4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEtpECRA9TVsSAnZWagAA0m0P/j+k8+B6uSpm2Lzz2u20\nl/7HZZjLy572Q5CtcuPt2drmUbIqH06aWy9lJJ5rSZhOvPQYf7wEuheZczkR\ngTH7GsOnxn3rwKOeDxSSXOQkJmdM7wIi/9Ni3wf5qauHXb3EW03VLg3V8wG5\n7cXGOIElUmL9FO7qE/Ta7BKyTEgBKHn4z2qspp/cQHe0kEfmoan5J+siulB4\n35RxxDrPnuXtFDFU4jQLNCjN9CFvaLm/haGQsjtkWdB4NI3pC0uYGBRlymXW\n6QX/eWX7Xl8TM6P3/nLOZZQA08whWabLQ37a8SZkzmCyQSWeU4az7+xY4IKz\nSv/Wp2Xy2WRRNC7GOKQkOX0qNgrguXbWGXEthHhkxrqYFG6HMZcYU+Z/LfOj\nb88wqTuOBhELsf7QPBDqg7mph75Hf+cU7FY+A+MiWZFYnzSlf5fleyApCPeh\nl5GIiH0rgQ/o8AEapb31uz/B66IgWHrKqi5GTOGexWac0SbY9lkbCKYNZBY3\nrTdNKkgnvys4is4SWzKK4Tw1jjRdd1ILwPz+WYvmZ4oXlPxOT6Zxgz0rf7UL\nX0KJvBFNn5L9lhI6anFlwx0lLZr5vO6GDJWTeTenY94AOLw5P949BofmRqSv\nFUYe7i6tEFgjh+55u9mI7N7M9XotK/H5Lvxye0s+LSzxnHLODjPz6HOWR/BP\nzXGr\r\n=JBmI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=14"},"gitHead":"b23b981093d7a1b45e58849e880b0df081e61b17","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.2","@apollosproject/server-core":"^2.29.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.3-canary.7_1628625476453_0.15796329417628852","host":"s3://npm-registry-packages"}},"2.29.3":{"name":"@apollosproject/data-connector-postgres","version":"2.29.3","_id":"@apollosproject/data-connector-postgres@2.29.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f5a4dd0aa10c34731f5eecd8f75865d2e16bcf60","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.3.tgz","fileCount":274,"integrity":"sha512-6Z6DoHwldoeOvTBsHDxXeChnu6CNpoRBlMvlZG0A6sonSjS70QZ9YNzkIya33+5h959U4bbeyPstVg1hE+YdcA==","signatures":[{"sig":"MEUCIE/R5QOOnJmUhqSEOBiM750xA6T3bmUfUdHwLayfnwwJAiEAnyG6DuWsAKrXgBQfAFmEa+28GylzKw+oXK5+kPlb69g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE+QbCRA9TVsSAnZWagAAuLcP/ihl4PVepm2UkmJNkhau\nUBRgE29m3hvmqKhy+JWrhC/uCRi9k5LUIq7fJtsGQGrye4S6GrVgB1Ta2Dfm\nB19s/An+4c8qxmPTnK+TSllqLj8W1QLoDcU97ibZm6/EPRPxkqSokNhaI01M\nIAgGHERAjsgyayM1VAVysH4JY46sbFiDUJJ+eJWxcNF7lJtjOXi4fULkcY5Q\nJo9CipcM/uQmtJvq/4ZL3CImJJghiwmpJEoSn2Ez3Sjf5pojjWchtH7vzAD4\n+LPcCTz9ZxzxavGSX75R9NZ1WecWVuPQ03mrVmqD3oVgzTDpaklsz37aPQlD\nPJxwMDrOotw5y5SXwhCCShC0Q2KQvGUlVpiJNSEjF1tqpjBsCwMB5cqW2g3c\nDidfOSo+sGHih4v3KBtAKQVcnh9aUZREO3IO4SRJqaf1Y+C5JemSJaFoHCIF\nmFUHGk9ANzkJhWwjf1MEBNNOVAe/d88ObU+j8IHmbh8wDYMML9wZDfLDJktj\n06bmNZE8CIdvE1kidaGJtn3MX/YGxBFFVRrIjxrD898psqT0D7VUe9exKcCF\n/M+xVK+Jx4VsyyI/e1QLSD4ZMwabvZBr8VQtjUJbP2jpfFXMJm121Kyefr5F\n1QVSgvVHb2w2Gy8b/t1AwSZo+Cf3BHJenECPe2KxoVFjzMgNOMsgKsHB9N/H\nIU2I\r\n=BLDy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"2cb71a7cead244ac97af58a89e4c82b4ea6f1aec","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.3_1628693531532_0.11931388911274543","host":"s3://npm-registry-packages"}},"2.29.4-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.0","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e1e29aa416cdf06011c287d086e7b85b6a77830e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.0.tgz","fileCount":274,"integrity":"sha512-hhjfSpm8sUa2kQvFm8Tqu2f9mCeNKpgTs4dhOcQFvvwCnkpow6XBmMsCb4i4ycsMPq9a6To76d0HleQljLGv7w==","signatures":[{"sig":"MEUCIEkCCDGEEjRJkxV4tU+xgkNysLhOvXXzO7tkE9BQYgH8AiEA9AmetKV92cPJTWiswauI8kdKxtw5q9avmhnPSYaGEiA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE+SPCRA9TVsSAnZWagAA5A8P/jiJO5+qxoIAvBxfaunB\n5BFMgdmtC7ki4X4TtkLn3ck9XmDtypoVGtUOyxSuLzwgzdSAnnwia/LUgbV6\nONH055Ip+VTT+6yYhErEsCBdJgM9kRi5kI4eIMiRTaaLSTp0QMUUmrJ57duX\ncXX2S9A+lPB/YCHYyYuqWeyn8ldjxLk7/aPtO3FDY2qa7Vj10G4YOrFjZlnI\nRuvKXayYEVNvVmmn2IdIGdeiwJ+Vp+GL99UI2watbi6JvemtZP5EweZEYHxX\nnCudWehXKk+rRGN0q0NZMkDOdhDGG5UieM/wluuV3/05Co+ThkT2l6NYtDBm\nCIFLIhctfhntoPhXyFsXpxkHq8cXvDZmHjICiM2Y2F7x0og/RLtsmHzG0Unk\n46h/u7fcoctTBN6cDLgnfXax6gYeoy1WUb8bUDtnqNl9lDXX2IH8vNmt64S4\n+Bufx2JWuo/fP2z5ZjLZhhaheMa4+aEIKWji+E8ao1wSqCnBH129SUR+1KzJ\nSkwub3XG9nJzRXNNY689/IymJ5nu30daipCDQwLe9eMoGlPu7LQbeNk3DHaH\nQ2mexm6AkC1HQBia2QIg9/aptf8BZQohiR5P7OvIobcprVV1xnUiio+O/EFH\nIvTFD5egij1meZrnLx2u2AXbnVnJB2LYoqYKEWEcIsRwZTB+O+OhokoU1qrY\nMorr\r\n=8E6X\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.","engines":{"node":">=14"},"gitHead":"2cb71a7cead244ac97af58a89e4c82b4ea6f1aec","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.4-canary.0+2cb71a7c","@apollosproject/server-core":"^2.29.4-canary.0+2cb71a7c"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.4-canary.0+2cb71a7c"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.0_1628693647116_0.8692806240332183","host":"s3://npm-registry-packages"}},"2.29.4-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.1","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6b59eb8ddf53ed3c95f65cc09ba494479712192a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.1.tgz","fileCount":274,"integrity":"sha512-rPqPEytJ+J0QE2j6Y5TaC4jdiDXmH3ohZ6ykpnWwn7vvEkbB508C3els0pVjppQDbYNBHBLnC90QRCl97624Zw==","signatures":[{"sig":"MEUCICSM3ryV2COf7JGSvT4oO4+Fq8CAce186lfPFFzK8pEAAiEAxBtjp5eevUetdpFAyIDGNwjzbYMctrkl70SiGwBxjaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFCg1CRA9TVsSAnZWagAAlg8P/1kb7Fto52+BRg+9QGhi\nbzoX9NckwXLPeyv4leljQ3xWTXYiGaMWzfXk+e9e8B2dQMaTlYLGdCFgbbfe\n5lczD2E5IFFgg8irq3sXqGJYrt6ORdpiw/Ik9N1caEd0F9WZqM5HOuo/NyD8\nIPg5NSXy0/BhIudaUOHGaVHhkAoodUZm9FjarR/6L8lqpGKv5CQMGuBBy3lP\nPNlVCYedmbMIVDEJOk2AY3J2RkiyNv/FYPI63AnVfG9Ou6cgfEFAkM5v9pDb\nXkXpXq7S/a1vkUaEEosP2sKVaXO7jsLk4ap/2gce3V1IqAZfp5HVoNgfvS94\nzgMnTsoqDmoOscSyzfUrJTxf3b8UkYBM4/7EeK33BSqCu7xasoVW04/mLThl\nhXalxS6z5VYzxKRwIqPvd+cDoK1L41bZErjmf7GziYH67SrGfHq4F5jvhlsC\nUe1qI+QuXZTV8uZmCpEOfRHoWq4ufTjnzwihMKYBioGTBz0QCZYZ6he+C37Z\nPD/97un9o4u3jFqR4rFm6DkI9oMfxrLPEbcx3JNJjfwIUgxNyynU1RBjeikn\n0NBFqpTlo7W3vW4G5gPrq68uDs+3Okv6MkdEbJKyKMH3cbnfFbvHTgaRzJFk\n11sUYxbg/MlJk/c5fvDVLzqhiODXc6uWCI12PlukKZ95kMBz9SfOttBkhFMV\nf2/W\r\n=AzbP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0dbabfb7331f94714c2cd70d31ee34a50424e362","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.1_1628710965687_0.8260241013449179","host":"s3://npm-registry-packages"}},"2.29.4-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.2","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ac051e4763334293c5538c30b74473ee020efa63","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.2.tgz","fileCount":274,"integrity":"sha512-1ubHINN/u6EqGlB7FTKGRc6BNeFS0neoOeQLI6d4F3RzwCZLL6rvufVimMjDVt45aFPtdOGeg1z4+GlCHsfV7g==","signatures":[{"sig":"MEUCIDxlB9dct4oNRY/MeGmGFxWts++NfVkZHfrBSO5CiCHrAiEA2021uFwi6IYV551PS3gDWcdlCntcvs35cYsCZsBwTJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFVLdCRA9TVsSAnZWagAA4sMQAIHZ76nj7+1aBNxEKWeY\nX8fuQvR0dboA/zkDTO4j7XBCed50BiJtOBpUPeJDBiFZgBO0N4MoqKG5aBCp\npprr8AW2vzaLCimAVFMl/IkRz11uxnmzpMuT9TLOq5fDREDPEYq9kHXLEJLj\nHD/Nyl0iahO4D7oJrk10jyv/xDNOl1WnYJ2AT0TI51roAS9KqRcN1xXrugcG\nawwJ0rapPMBZO4i2lYpqOwSt6Byysn7oKU/ZjyvtVvmHQ4oSyegPeFA9MesI\nOGAeEQYr2GIygy727vXgM81yWDU0gWo1tLi5XYKFSVaIMnuhkyeNBsepXndj\n0tAkOwsSG+RaSylgjDrMVyBlnL56RNooH+BXVCzSHwPJLWVmb6Phhsf+1iQG\nM330jIljbCquS3o7IX91MiNTl30ZYV//gj++vrJEsAsZZprtXRL/QdK46zP2\nzFSCiM1ldcUXOlfcKQZ91kt9SjZQlWHABVUmo31ac/tSLXa9zoGtA1JXDKsR\nJ2VrrFTJRaIS4PufXxrpYEUvLNLj4KqsU8WIybrxLuGEPNUfwBcM6xpde0GS\n/foPWspzMzqXHaKTLsnj0CWTulxkDaGEFdLCcsAV5n4PsDqb10qyc2WnZhb0\nzdxESJXF2NlKNaTBDDkVNP2wSyp1P4yzVvNV44GLs/I5yVn1iQqP5UnaCojs\nayIx\r\n=qNXN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f05790a0e38104dcebb340d96ab99ea9e54ab227","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.2_1628787420974_0.19498791971562812","host":"s3://npm-registry-packages"}},"2.29.4-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.3","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"959baf38c547df9e7288e008f5f25e36deb2ba74","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.3.tgz","fileCount":274,"integrity":"sha512-0PdpLpYz7wNqAJFG5E5NnsLVej/k1dP3HlcUZAjk35FTu7vB5V4uQYBvQX+Cr75ghcBq49jaTmFe3aGwh5CH8g==","signatures":[{"sig":"MEQCICFhENLds4tVHfqlQUc4YvmBT2m8Sp7Lyijq7MKDUX1tAiAIFa4emM9EYos9+ysmTGrCHo23ALc7ktkMojRTm293VQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFaNqCRA9TVsSAnZWagAAh0QP/3Qw+pydnTlYzc6bnCKa\nE9dBYemCYPL7cprQvhpRuNBq1k4dDly5aSdqY6N7YH2HX7ZakjPGJEk84oAE\nosYCQfoobkaxAl+WtEwloubVo2gXLr2r/Dzv+uuQvxG6UgFz6gqD27azClh8\nCnNPAY25wYVNVsdZe1jf34gtDqQvYhoqiH91lKgIzIjjCcqpkeDV4DbSeW00\nQLIzptDbDRdTyDsJmlI5oiMLKYzt2Gesb7D3yHPPL3p3N1Ep6R1iq4FVBYiv\n4SJWD/SX29bp9gaXDZD2QRBn2mkqs9YAYYJVJ+k+jH4CinvF8oD9dLpWhhzx\nht+bupf0dCr2KKCISN8jpeLv0soWtwUlYKEQt37Q+f0geARJ42pQlc5AxJJn\nProyEL3l3hpM8+oKikXtB4C5WwcKyMK0kIiKeA0+uduRqCb3X5ZzTqMX1/hx\ntswhzc210qUzxwD0N5t5jJ3dA6OHTlvm8gmpX6fakeH13NnDJnI81o6BxQ/3\nc6GCVkcOai2fyv80ccWeWrkCm3T28SPHShkVNrFl6VbM5ad+dR0WOnWvdo8G\nS9s+4BX7hvHwPl9wihVSLM6BvXHEkS+ah+DnMAPLQWb1imu0R+EnyZuDQpr1\njjIaZbHt2CwDeKcoIXpWNU/DWDldvGMq2TJiksZQYD2PcVORNmJ1uKjs/n9r\nogZ6\r\n=Fo8u\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"37eab715d3d6d80cf68d10004df7dcdee4c12de9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.3_1628808042485_0.9523552023118038","host":"s3://npm-registry-packages"}},"2.29.4-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.6","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"72f38d76a9aa4e2ab2060369a405a9e87bf511f8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.6.tgz","fileCount":274,"integrity":"sha512-ojDUsHyxdN43gXziGYxSWJIbxdG+WAFi6KjUMd2g3LrgVL0SGBvybjq5REytpR89kVMR4Y+CyS4d5pNKwv1MDQ==","signatures":[{"sig":"MEQCIH6R31zZJqvfYbOJEYVPgi/Zu3w9UX+6xLNnD5rQBgjeAiAI3sCYhZLTObjWJK3RCKRtyLFQCkWYfZfEddi61xL2nA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826449,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFo3OCRA9TVsSAnZWagAA6OIP/jWKgxRYE0LwBBpF1odT\n0jPxW3wHsA+861pL7semkOed0h+GzGa49nCRwMp6xiBJNh+PkXDn31YZFoae\n9LMNq0yJSZlJS1AkQreutLa01Sv8vGN3Ezbw7wbfk/aMRsysaroXDWs5wNZv\nBXvl3LPkijVGEgFYi0SoHgA5FarnEO6ntAj1A/O2p7tMKXLQQWVF99dgEn2B\nk62D+ADUG3Yhpp9QKFAAOjBK56Hq+4pkjzZ1TKChFjM2kPbeJOMabYYRKUtY\nku82/Zs8DY36LJJ9u4K52iOKDTLWJhd8vK/s+Tj+08Guz0mnWhNA8FvGKbEu\ny2NIXeIkrzW1neXI+f3yOeRGk4eOzU2iki8NhFpV9gBMHlt5aS159NHUwOHR\nM4ocybLiuAI0UT/ScSGPxQJ+k8XpSLXLdlj4BnTY4yIXqs9kSgg6eCXslVnU\nr0pGstp1OcccqJDmK/H6WX65bWFzSZ+pm2gSzMLdEqqsp1uqcQEoRVQwbqOj\nbyBcTOjlM3RpzQK4hAupjXn7cGhereFcNgmm16WwPoDYact1DLKC5D/27nqv\n0FItt/a7BJ7CkaTcFqtW4L5YcVXS8OiV/E8E3zm8aJfAaz9sSAqmv+Z3CI/B\nl3+uzT9mzOg46JPMhXDTg9545X97rjvQK8KCWbtGHUrBR2TkLiEEZ/WymXss\n6pm1\r\n=s4k6\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3064982cb8639521faf783a7cde02a79193e4514","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.6_1628868046109_0.14125882704807258","host":"s3://npm-registry-packages"}},"2.29.4-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.7","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4fde65fac33d5c75a79037d0574b1b12ae8e1853","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.7.tgz","fileCount":274,"integrity":"sha512-YXsNh4Lz1fsGG7hH/7kBbQJqTg4fm5Lq7ouWj5bOfEE2gDYmjhyjob5BJAukK57zrBCGG74GwLtuscNDNaQVcg==","signatures":[{"sig":"MEQCIA+Z+gaLIab8HtC+kpJb7p/6McSVPxjVvivn45cGtD+4AiBQ0Fwg/YG+R2KlbyxgcZDrrOax45mByNnKADmuWx92mA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFp5VCRA9TVsSAnZWagAAzFQP/1N4WSeijYma8QpLsTDH\nW0YvCVqH4fc85iRue8UtEp7wYerE/FHULRL8kjQJL6jz3voEqfLHZ1GWjAvd\nhbHm1lyQdvrwWSaQwX4QbqKKrbaSpjslZEjOQhjnxW/T9fycaDoVT9RsWD3n\n5QPuV7EbbtR+OXIzkT+2fo1dOge6lq4FUwbeSaJ5C/flsf9QBoF41ggMYSD/\ncjlU6OAQdfKwp3gJX5c2ADdqYobU5WDhAHmP5PFq8YsvyTCnUZdmMH4yh/yN\nc+cUFdzV0CYlz3yJggtHDpr39Dw9mKnKUBhq5UCtEFaHZGkX8iK0r0qXcswx\nct/VO9+q9EDjG14f5PtIRPOS/QEcW5bb9s9P1WzqFU17Q1Lwp4qcNW6NwiAv\nZAsHbCndx9RzegX6UOe4obG/8buR6dTzVqosuAi8ukaozYaD7uyAyKvXG3e3\nVCOtyDyZPG3W3ZdJOwvOjVdsB6HsMm6fveJ/cWzk5KcT1BcDrpsYC2w1+aIr\nOiQw0fElwQGED55fXGF+xb58tXK1O0BKclecmA3OrhzcxNGDhFQ+HrY2m46E\n+pKDvsdsCqqY3jRv6YqVgRQUj9m8Hww4pxME8f5l851hZLzcD+E88TF5Xqr0\nCG/NwcRYF9uk5V6Mo5cID3QnWjflk4s8SLMAnAk8NedPYNpl3Z8Ci65G++Ik\npNp+\r\n=ESTY\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cf44b98999bd168d3982f9c57ddfed97a593615a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.7_1628872277462_0.5064983701423338","host":"s3://npm-registry-packages"}},"2.29.4-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.9","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b41090bd9a71547327fb0b3c86e7d464e9f05226","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.9.tgz","fileCount":274,"integrity":"sha512-TUSu0TJoP4hKu3qXSKqwonCHLYGnAK2wU3ITuPiyfN68UU2e7xRFFi/O6Vn9wDAMwP7OnpzKJTIgXfWUxi3WKA==","signatures":[{"sig":"MEYCIQCEMZZNhnHghmA2ENXChfnvdwDIgeC44CHkXI+ozRrO5wIhAMous4YmyjRmSbhNSgCmnZ+9xdWFcA7icR/qgivcjPy5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFqekCRA9TVsSAnZWagAA9zsP/1pIo+q4R0km1Kv8/pVh\ndsaAYhT0HXHcmSizHKMj4IP6OHYOkfUsg8KpGn2VNr/25PmTl0qhEQHInDd+\nrGLZAxyJTlLtTUkuo+qpmn1QQx4A4ZUNVomlQUT9OAytNK+ybI5p+H40J50m\nnRP8yt+2ZN3LnH5dcOgmAaAwjmmuSFzV81vn7vhZenbPWhVinWVhbW4vRB01\nms38t/1kvFxGwl3MxZyZrrlS/fGjG/yLdxAZxaRTvGIAu48A8R9pDPzujhpW\nUXSZ3fV3bcuObqCYeAlqTG9m23EsLgNGoBkNLWAL6LpLDtSHXbxNOMmXAWqS\n7PkhoPGcv+aFZksKjNIUIa7B1/uH0iG6vSQ3C6pNGcQKu+nm+JBLBs20GBQF\n8DcPsDXXml1GjDHI4KGNC2N96hNsPeZuJqJSCQrfRNXGZ+xtQGwn1t9MA8KG\nuxt9a+8VdUuYDHdoXDXN0p+amzQJVBE5X6RuBFFkBfYs4FabtK+JhlAj1nHv\nzg0MmKCg4pANw+6C4vD8/AfUct2QoiZB/hqKpZaunlJO7HjnsPKMVT+j1DZX\ngIM8n6yxw+1kPRXizvt2mzevJ6i5+xpsFAsb+C9pt/r8GlKFKabSftf4Qug2\n7ghL7kX3ZYpfrjSodcPgXUmAa+xuWmDmQjj1E70fv9r489xBPzFMW1Wan76V\napBg\r\n=KH8G\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"bc0de38d0574669069b13e563a88a306e102b8de","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.9_1628874659966_0.5387517990265731","host":"s3://npm-registry-packages"}},"2.29.4-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.10","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e727e7478bfcc50f154ea244f3d397c5362b1c20","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.10.tgz","fileCount":274,"integrity":"sha512-cbqJN0TMTVC1spGSEggPnwdxFbXaaW8gJD+ZpbwdO9/dM6lOrpAFEC7f6Zq6eG+DneryNh6Os5hWjUOX+aGZCA==","signatures":[{"sig":"MEUCIC5y847dhDe2v8V/J+BS7nyKweNeDS5ulTGCm20aNCqGAiEAz7tFG1UM8RU9qdLab99acNw49Q41bwaPo2cFXUcdPhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFrgoCRA9TVsSAnZWagAAeSgP/RUivBBJKWJwdruqhpJ+\nFmdGiG9/QclEHVOijKFPxVZ6Wta8CuOcEaXrH90wLT+uQv5xw/LhE6JfiQt1\nHBL4tiTOr5+59Ibx2SnhsKsE0ZJtGlZ1+7MQy5T+UJL9+w83hkvPGn4ov1d+\nLviah+9xVFXMvyqta9+ThcE8UF75UR+p+8G8PevUwLn4ZEXur2U9h3zuEPBx\nSrKeQJKa7IRHmveXOftNMt3L8fegmqdbyWLIrNYEbdK2oV/V0yjWMrOp8sgc\niWTk7NkbB42zzaND1BkvjLDwlQWQmJSENOP+emRFy/lusSghvmK9EMMcGhnp\n1d1KXG04KtmB7E2t3b7Y1KtfHH8AqSuCZTB9fwX9QilsmCkvTk8z16ucwLIV\nAK3Ugm8svcOFLjihomtmfQDIZ1X84wIz6gCMh/EVT9yX8dtsBgRILWBhiDM+\nUSUnIo//Y7feoMsiM7zyMXnsg8kCXngofiixP+7zO4kpa1AEuET6mLYQA0zv\nOvb0Ie/K7ryafvLPU0jhD+UOwHEegLOQTMFJeTeNmb5xp/d3jpv3WHjVfcru\netrGU38O9Jqw+T+UgW8V0WxgRb2jht8hDTtsC+mCeVrkMbW8h3nn22aGbagW\nMXWcoHhTjfjjc3FrsPGN2Y4PDc3waiiICXhiTVjG0PKe0oMpI7Ib9RfuKnds\nHeZh\r\n=hR3d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"bf3575d02547a1f1d21b322c48a20ed42dda38ec","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.10_1628878888482_0.44698069767722615","host":"s3://npm-registry-packages"}},"2.29.4-canary.11":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.11","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.11","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"053adb5d53c46ef4a084c9758521f30701d8cbde","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.11.tgz","fileCount":274,"integrity":"sha512-+Ppfg3cZ3VAfZOkKTM/brZd4wEPxXOby+KXDQt5X2akrFRvS/DAAiW07aPh2D7V6wNw3mg+Z5k8tim2w2CpPEA==","signatures":[{"sig":"MEUCIH/yAK0G8CsFzYgLcYOSzlJp7NiZ2di4syJTXSVP337hAiEA5QT375/qBwJ6If3P1Mwah3drKn700mA4JEN4qDaCycs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFsF9CRA9TVsSAnZWagAAeJ8P/2sqUWpe7oilNHaOvxX8\n3aZOUsyvmvAbn0jMYnBhAxmhQZyP7Vynk/ZqD75lB4A46GWTiNLR+q6tFPh2\nzEsci09FOHK16TBJPTg47acLSW9xEtswDE/jj/ZIhKSpYa77GMJ6gGZUcfKU\nnqRCbbCGUdfCbwB7IogMe2mer66aYXeytUkVG0cuFx/iyjeaZy2pcr0YVnpN\nu7iSZPpzMmV+I28tBL96cRBirFn9rRNINTHVxlcaRjPPM46QOU1czxsckKWH\nmKEHbtujGve3sJ4YWP8XzqeOi49vBDTKhgXmEc0/zTRm0a3SFFoipuvG/gNV\nsQRWl1T4Tei123VkBwg7xC3wII+y03RuNNzNm+cdAFp8p4Nk4qRVAc31gY+w\nMFbsnqZpCSX+qeG9WHSrLPIReCed8D4yA7zBZL9tYmx4JgPEr1/TrlZNhTX1\ndyeJRoawGDQIb2HVLJm6E1Aql8rxMrGR778zHfOZixSdsBNJS2Vwu1gxBCi4\nIB3Fj29/2FCCgh1dPDKU1DVd4+FTx5Q1wVNNj10gDxbrdv5+uJDAz5YrcMeP\nMxbaUQHDVLp8gNbJ5OWSLdt8tQgZv0O5B9KRcT2XiU3RH/e8GalNyh330nuS\nGrfqgoplUrAKl+YEs+mg78UizblzvRhOQZFvafEmouXsSp2zaRFFxE9SBP4d\nuwld\r\n=gTOS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"18bd527260b89802d05fbf4c6ca5d8d9b2892475","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.11_1628881276926_0.9384913333134717","host":"s3://npm-registry-packages"}},"2.29.4-canary.12":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.12","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4823b67f4d970bafedf6c77609e00bfc88cf2c53","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.12.tgz","fileCount":274,"integrity":"sha512-PcK/96vEIMLJKXmLGXwYGKlZeU3wWHDwBZ8Lh3xfE0oo/BMHdxVEnVv8GLHhK0hI3MC8Vgy59bWxhukZdfHllg==","signatures":[{"sig":"MEUCIF7kNOfeti9Ar2qROVYlrY9HENkbA6nftyg46piM5TEdAiEAtVKpeJHmEf5Ym/qWRvsHimqvmyXrWQEp05BnntcGbUQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFsf4CRA9TVsSAnZWagAARTAP+wbSbEJX1OyVcLtiAYkx\nPUIZ6F+WrsOT/8I9kzfu5ULDujOprbDPMciFEuESfb6R0y0LoWGQDvzG01YP\nIZ2jjCznMviowgIE2KzFh3qIu88FaPaA9QjWMhtFRXH8MYpLN1qnVwxKT7kV\nnSh+d7YBZmhvx0KSUqUyKnMBpFByXCF8LSgL5Cl+j6EoW0AlKSBkd66AwXBG\nVYGFCMOLQU7HubSBfFQObDOPDEej83Ybc2f8kQPLwTYZbYSRcgscwDiJGIYT\nMGNPw1T57Q2mSZG9Itz5A1WX60cSgvq4cEopEVaySVRa1IJzjBY4fwhp3a13\ncN0//KQ6MQshSrhSSRI38Mey2u6Qlj7eSN5feL4LmZoYLXAEXgbfMXcXdP3y\n6oVlLi4xQfzmuXrnZra6HhAG61lKosQp3YsgIDnkawmoy7nJKixUJedDe6cU\nOd12lVmAezBqc7I7y2hf0DrojDTM/K4ZssPQGVgqcN3Jm8/xH0tYzIVhB2NY\nucU5x6bG/e1KyfDhxUQp0K3MAftAswc4eDJSAwJHtt8FoAYEIV94hrYtuWo2\n+LGwh8t30e1TnI4Szt52W1yNZDCycdqU8NxzgY1vdcHd1OoqdIAH7a/5eDpC\nsGx7zn+a8YxIIb0z5glx2FtXNbImMthTPFPYtDGsDm8HYS+2ykzz1+vWpO2M\nChxw\r\n=1ljW\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b444569f338945128200b027045edfa6c1c5dc46","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.12_1628882936731_0.06312000718933763","host":"s3://npm-registry-packages"}},"2.29.4-canary.13":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.13","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.13","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"744824d94bb44b16184881bc5f69bf947c1e22b6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.13.tgz","fileCount":274,"integrity":"sha512-QRnHrtjO6JQ2B9JePtYOusSz9w6YRTdZTFOXsVdrOnBEoyK1/7YBkJIXZDMUaUA1FN0RqRm56ZEIBU7ECuQ9CQ==","signatures":[{"sig":"MEQCIA/t1UUIkvGEDysmd6sdc2qAIwNI7NcgjoYOJSJdG7DHAiBgQKwBa2/RqhxuF1AhQqQsXYtiyeVZIwqTq0kyBdSrog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGmSmCRA9TVsSAnZWagAAoawP/AvXiyahbiSVXYw/q2VI\naYetGLRgz5YcqgpHTsmuMHIBhk+5jtJSVczslBM9VuajTuHj4H0JbvIAXnRf\nQ0ZqCw1snhoTbNM3VbUpmHnsMyFq7nUYIC+6hfe36LetaGFrNiSXrJ24+Eil\nybpTvKCO5AAsJ+vUDyV2NY0Dp2QJm++OfFBsma/ED88bu80Z4LZlU8R626cG\n+/aHs9azoqYPYaIaBXDPBOczRIiQf7WWfPakKmhkgqnmG5M9xcB+XnC1DYkK\n7nl82xlzY1Vwo16trOslQEFenH5c0czjHEfqi5ZuPZgeqya3IiihmzvDYDKO\nUqicB50aL8Q31Sz+F5jqBRfeWZeoeiSl4yHvq0h7jBUaOZ+hvj86kxAgd1DZ\nXNNdoouDiRrPWgjLVazicbVFWpyLEEeQh1qoly5Hvbu73lk1o9tgs+3ZRdne\nZlrolRILEzMqkm6xOnfQND7No5fS7NpaG5Gmsw8sgK7FNLWkZwFmXfsLp5Pv\nzdoxUIZRuuQVm9vAMJHSNY+PVZYBGn2h4OnWkf/I0fRlVLKM7LKZ0Yy06P9Q\no1cxK8kMChPhsZJGb8XenW+xA7P85ToBYjpm9ztbnMNXUzg5nXfnu8/E8ns6\na3j0s2gky3o1KvLUw4JhvdOoD3qoYVmskJ50aC7+bhtjk0wOYlpn6zYZZcNS\nM+Jg\r\n=XLeD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4adffc653b1e23a6bcecec19fb8bb6cc181ee2c7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.13_1629119654401_0.37145741691039125","host":"s3://npm-registry-packages"}},"2.29.4-canary.17":{"name":"@apollosproject/data-connector-postgres","version":"2.29.4-canary.17","_id":"@apollosproject/data-connector-postgres@2.29.4-canary.17","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ad8faecf2bde387d0e2dd57d769032f617afc69f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.29.4-canary.17.tgz","fileCount":274,"integrity":"sha512-jXALhMBUD81EPNs6By62f5L34tNZYVvc8N5OExii3FDGyAGmSEQFHtO1/8mJCI1sD4AUMxDfrqRpoCmueL2c9A==","signatures":[{"sig":"MEUCIQD+dAR6oEDmngNsSwIRUPswS/494JOfw2aE33QpI+rSYwIgBFPTtS1lOJTNg401/BrFxGoooZb/QOf4veiXLdQ/MIc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGyUhCRA9TVsSAnZWagAA3pwQAIPfXHG6SOm8M+WEIqI3\nOFA87qOS5ju1Sm4In5UZ5atWNDRS6tYwQqCdNEwsuScr8V/ZiK3ZT/vao0oj\n64aYeTH6jIASN8phGl6VcnpToxznIHAlJqGe499SvwcxV7c+SVxIx79yHisr\n4fxZaDJVi7/LTI8SWyejt6xCBaKjq155JIiKvX6lI84C6WJcjjgZ1Gw7ZwqM\nYlWywMQ/t027bLG9Pdw4WRSV6XlgR3TPXJrtSXjZMmc32aa/rWW3orNfar3j\nyVc9OMaPoBvwbTEuUwF/AzEvFcaXmzPpTNvvehUjNLjsfMnGiysF6MOHwPnP\nbT3k6d21NLTSSXeEURyW5et/IurXk2VXagJ3eRBklNsTwhxKGPkZcJZ7slt+\n0vHlwuG1zL8w51eY4woHPXfytZ4I+o1s7pWwr5psOxC35fLR/15I1Cgb/Qao\nhVrLmGAgwbDnjtV4ftc+7Douppw5N+njJo2S+nlfGekSFVt+atXhD4HeLSDR\nYcOENmUeOC8FywmBm+3OES78QVuZ39bQuOxt5hdSieHYAqvtuQ7UvsexzXDm\nCneWLVurbg4LVjfzacsXHL6qxjBsQXO3uoCpDBd2TGmffy7RmnThS2pfndYL\nfXIClZten7Yjckz550ZKsqO6dFiADEpShA74Q4MC3TzQp6505JrMR2NNfXBO\nDqRr\r\n=0tFY\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"47a9910545c79f4d37477d7716f4a275f7bfe320","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.29.3","@apollosproject/server-core":"^2.29.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.29.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.29.4-canary.17_1629168929357_0.23000669157125841","host":"s3://npm-registry-packages"}},"2.30.0":{"name":"@apollosproject/data-connector-postgres","version":"2.30.0","_id":"@apollosproject/data-connector-postgres@2.30.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4b136fba4d006c59f7fcd9c705ca9117d83f7dc2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.30.0.tgz","fileCount":274,"integrity":"sha512-//DzZKigmrAvbP4IvSKKRYr2Y2a6RVMksI31HqJ8zwgmozn+PlorKnPd8uhHUfTv2S02AN3B/OmyS7LEsnGPXQ==","signatures":[{"sig":"MEQCIETvnk2g9EQHXRD05a5HCZDLrIIfQVSJXvNiakEftfupAiBI1XM7/CQpMDxx+UsfZOdZUCLRWfuzcdR12ki65iJ1Ew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8NDCRA9TVsSAnZWagAAJqUP/Als7ckgPAUSAAD1bl8z\nl35AaGhsJ+HwuG/Q/m39FEi67YWqoxH0MhlxomM4Bgr+AGeTPUofZzSrOPZJ\nlEl9JpeOeT7vCG9HBOsPmkY3o3sfmYXBnT10w1nobhFwcceXPTC+iJHxrpey\nU18G2YFBkMaRHwTVT0BlVzsaHA/adUW5uEkxe/NxK/aEdGglB9GsJbZih6i0\npkNDfxWqKJw0KVjWzDchOKye6vz2tXQH/umv6SXEc9/bSZQE7valBku4ny7q\n2qdTyk0kgBv32uWT/zH57xcE1QeisAJTLKskislUCtr4aAODLYF7FdL/VOtY\nG8hfAp66kTm3thFpqFJ2pHTd+jq6VbyYpmlYclamfVLsAXyXtGghrAPcaXul\naiSsfxUGcxMT2wTllZtc0mHNpiUXpXKhK3tLQ+fGiH0JKydXgGggpa2Rb52v\nIF9jY7jXs8P8cj6tuAENFsVa1RQLvdaqNfr5gRufWJwLCkAMftbITMPA58Ol\nnB8B3UO851STQK2ScjcMZBZ0XA2Gyp1JkARLuqjAKkMP6WRDfHg60eEBviiS\nnDsEO3UajwD4ro5m5AD/c3yPhPdKgg0XaKWXV410+Q032NThJi/bw6dIcx7d\njeilNtDojJpQX/bOJZ54knk0HOsh0dmyNqQXCr4j7oFbLJfGcJ+GnBIC+Rbe\nIWxb\r\n=a5JQ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"c5d25f7817b1cfd686beff43a3c31685432a0f03","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.30.0","@apollosproject/server-core":"^2.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.30.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.30.0_1629209411144_0.3452958537945692","host":"s3://npm-registry-packages"}},"2.30.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.30.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.30.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7651756c54b170dcbbe7ce5ac334ae92a093f35a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.30.1-canary.0.tgz","fileCount":276,"integrity":"sha512-Oz0fAZpmEngnWhkOJQNSr9U4J+Pfd9vIgoOdRLHHtlXixpznUVGw+kIoXR7zKqXGYPrF4Jw7iCBwA+NYx64FpQ==","signatures":[{"sig":"MEUCIQD/M0C8t2C3Xkkyu/GYAeoXJjy2Hkpinx/7twsCmOy2mwIgajyHJW7NKKb0tUlojGNYAAYYoEvsm8od5vb0D998deE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHBaYCRA9TVsSAnZWagAAXmcQAJkeVSe/7R93P8e0EVsA\n9QPZTZnRLMkQtZwERpKebfzl7zmMmvzraCT1rCo7/FdPAvltLmUiD3JBHYjD\nGMC6QKxuYMBpGO/FAhyYzvfMM2YmW29WZZQG01XkiLWJUr31Z7lfTL85Hj5x\nAeKKOsAL4J1pBIesdDO9beAng7cE2H3qqj+Q9Xey21G6HECyBkZBJhcc8G2n\nrdxUeqIJ4DZ8ligZE0YE9elH3hU/5CoRjvtbgzvA2cfJWVjQ2mmjzD7fabl0\nQsXFKkdW8v9S1V2/M3amcUKhP3CD834HWj7jdaze6S7SadeAewXbk5GsSWRo\nlmffD33EhjGUi0w7y1M0jUYPQb1quXDGKDCGcoajl+Ow+li2wBIaOuXjmSC6\namzLoXM8bCw2A5ukIfN4JmIjaDR6u7pNptNDKEvWAEAyTvR+6owAAu0c3ipf\nVbc1tulN8194gByfExEHnfbSALFj22bn5Z1N6nm45D2nGXCuu6A1n7yruoEj\n23377Q4gRcHg4Q1R53Fp9UKLjbZ3f1m0L7ivP+117z3JeeKB9GPbfOzDf0l+\nJjurZfto6mOQSXAIUJZkGzAAxsZZ1IGX4CWw30GtXQb0Mb5ac/I9Ni4mhcsq\nZJKaPl4STyvBjoLt/WE9tNLusPLIQucdiEJIkOUvXyMbhF+kqFFuqOWI4A2B\nHtSW\r\n=scI0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a059b3f77cdb94a4bd1a616be6e99ed240ab5602","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.30.0","@apollosproject/server-core":"^2.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.30.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.30.1-canary.0_1629230744291_0.3796041944039341","host":"s3://npm-registry-packages"}},"2.30.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.30.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.30.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3c4e48b7954172e3bc39147c3be1ac2eeafe2938","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.30.1-canary.1.tgz","fileCount":278,"integrity":"sha512-sNshgMuVF0Q/Tq6H7lzc2c9ySqxXBs5Fk4Cqsk2m8Lp3zsaO+0uoBnk0UvcAZ4diX95UHn5F/05sMkmbYtLNmg==","signatures":[{"sig":"MEYCIQDhttAR3MMzuycbZnuhkmaOJsEZBflGm7/fFQeDq7T1FAIhALnCjK/kJXi3wN9nXXrbq49gill+O/i+c4rUwmgsCrTY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":843096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHFp5CRA9TVsSAnZWagAAL8wQAIxIhnlc3VbQlA0/HLBR\nzhJTHNXAOKFIafQAqpOXUN+mwqfvdrRKsyQREuD5g3HA+Q/V9HHGMgdhoTrn\nt6wP4e1Fd9azfPRkpgVrZrT8sH3XYHSwh0kbACrYNBPFxnnGi97726m4TlUW\nhJWPMKUq3ld/Y/a49bkEySCHvRbCl4dx/2tAsTd2ypqji7rPeLWpaLl6qCIG\nte2NYSYbIskiJGZO6Coxb9m7XJw/gkVs0ENytfZAW6tXNKq2EPUnaLNKII4b\n9JZAi1PT+9HxJRq+egMYgiVOcDVylEsi6e6cvOKJqW1l5/Hn2Wu5h7N7l7Zn\n5M0m5ncyOZe8TRWkRPemSHud1b/F4lS43J/SnSZSgh9XD2LK98CWJrXnysZD\nZ3xU7YugSB+b5jkYZgTMhCdo7jekTu3W+bntGx/QtTvjh9SKWDxO/Qilcnex\nzpSSSdnKCPgZaIU+SpzoxkR238OliYag1clo4nNN/shHGqwrBfkhVbZ07FWM\nA+fJMLColHwh0ZHpm8jItO0Dc9CX1pNkgG7xe2GrQBETqdJPNehTjS90UJJM\nHwss8Ary4gD6btd7c2UPoqrBAsLOVb1YR+LW1zDR5Z+NN7DeDDO9upJ2GpiX\nSSnzmWseM5ubWNa5+2uqSnTmaUyzGewcBIDx1uNVNZDNEi/yDUVc/rVPPAIO\n2VDy\r\n=8S6w\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"faa7578a4024ae17867c8a07ec8b94e99fc20eb4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.30.0","@apollosproject/server-core":"^2.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.30.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.30.1-canary.1_1629248121432_0.17144563284123593","host":"s3://npm-registry-packages"}},"2.30.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.30.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.30.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"869a97f4035de746845d7e0697a319252718bd60","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.30.1-canary.3.tgz","fileCount":278,"integrity":"sha512-jQH5tUVp6HKS3YqB92nO2e1q0GD9b7+rL1WiGa84zg3pyNWl4no4EGzJcOSGjDTbIPAoZLbYVm2zhwOpXdsJyw==","signatures":[{"sig":"MEQCIEA0copBuakxSFEJfNXRqOpz+379TO7wLAV90oEQNmPsAiBIX+/DXc1U1+Tmw3+Ca37TAq37i8ncRSSyH1ucUFUCdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":843145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHR5DCRA9TVsSAnZWagAAWNYP/RjiPS1iiAtjghb6ypMp\n3HwQP4cjgw+ZVRg+NLnpCPQZe7CqnnqD1B8Q1CL4G6BvkbTQnfQibUyaXGjd\n8HMjTpU+BSjQIy5Xmfw8UcrFf25/UZ2Ksd+i3SHWfRwXchGQJusk9xgpJgpN\n72B7HYm2wFmJMDwHvO9PMVtb+NO+r2qGWaAeYlSGLQI+Bd2XfdmLQzg/xWZb\nP0EZzWlN7lRNojHhNHPsszltCZkrucYb6v+MlWUo0y5qyzlg/lmsAMpTEqii\n1+3nK8F1IsDoFNO2b1MxC+pdc0Ddx84Oaln2x0k3Hhu3l40t42owbJBuzdBk\nxHcDAUTRI4o8DYyyC9m5aVjqFuzc/EuekNF1t5JgCaBYciy+lj4Bk4CT9P0v\nmYPS6WJ8yqtt3rItkxRLwD3iO6k3qn1yLx/XF5bykb1S52Zcl+SLg8vDHrXU\nm4inDiC/EVxNo/OHVxa+LRW734wrj2EpBAsjKzlX70gMvj8odYAA055z21oj\npyIBchPSQNRaYVLQUG6MkkE02FsqS743EU5apgx+fhz0/7QJEC9yMEWHuuFH\nlLt3oZxuKGZaj5Q9yNJAZXdixE/O2edLthinc+eG1m/OobsJHhseGpzKa3ZQ\nGu+lkCTTH8fNOtLhVitMMp491yeE7Iz3oNTLvRqGxuEr2hMu9jRru1UnZGf5\nYn38\r\n=TxOk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f762044420421b583b4713db942f4aabc9b849d1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.4","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.30.0","@apollosproject/server-core":"^2.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.30.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.30.1-canary.3_1629298242682_0.9765457509567332","host":"s3://npm-registry-packages"}},"2.30.1-canary.12":{"name":"@apollosproject/data-connector-postgres","version":"2.30.1-canary.12","_id":"@apollosproject/data-connector-postgres@2.30.1-canary.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3fceab3a35e58b5be4c35d5658e9623d570f58ca","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.30.1-canary.12.tgz","fileCount":294,"integrity":"sha512-VexHaW1W/ftYs9yN0CTjN6gdODSljcdvCiKw/nS5xR/7I/MFrG+k2oubsrTfXEjHLMbdCXymDbMV2nyTtgo6Vg==","signatures":[{"sig":"MEQCIDduSMsdbOLsGrzlvbzC6cust1sUHVTcVva2s8vvRq1xAiBFzJM/3+HVYzmELa69gbLYLKDFjKzI0hlQSB/pM4u+Ng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":894837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJmg5CRA9TVsSAnZWagAARDcP/1iOuGD30Qk9FOhVVU+e\nZUfxqzAW3RThM+faIvNU/GHcDur5mUeAV6B9k4jxe5iMM4NEh8fDqtZZp4Sh\npKjjasoivdmJj2CN9434qiSv/m8h1k0agMtaaofPgJxZQmNATcotCEgZ6Vux\nKHCdlLv9nujxi6+t8iFtHbTjup2fmoxNHKMSyhlYgIB5mfaPCjb9CvPt+d8W\nB6jKg99yue/cJuac01gN9bzqz8WCJrk6h8bMoZO3c6QVhpvbmezO4dVw7YuB\nuexQpoqYCopGTRWwZRUkvAavuDY9QnmH5pNxAcAnyS7dgOq/4NCH20OIQFe0\ngBvOz3EznZq9Pfi28afY5wY/gyq8/wlC+7MImRSx5mhEYHUY29dnvD0xUVkT\ncuJJsj83SYWJeBud55TKp3BbXtZ8oIyRZZKHDxBdyMkDuNWYkEX0KBuibfGX\ndvmcjdXfdAmhEEmHB6XGy62Yo52uUsRBoXEXt+EXmePQU6wfw0s7x7VfWi2r\nZ6LMOmSU84mJc8x/ibnMxS29G/lUM9qSpUIi/+5XObOETdFrcA+nAqpz6m0W\ngCjkWWSsxZCqPN+0drts4E0Ja7UFfRfJvMrcsuwN3ynWMFZSeplgYIHZJxa5\nyidAKV4vd3wq3wps19CroEg8rQEt+gFQLplSA3g+nOq3udlVqTjmRZssY8hy\naxuM\r\n=W8tI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"51ca3cfe128c7af859f0933415e4f66f2633783e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.5","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.30.0","@apollosproject/server-core":"^2.30.1-canary.12+51ca3cfe"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.30.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.30.1-canary.12_1629907001086_0.36364453198707536","host":"s3://npm-registry-packages"}},"2.30.1-canary.13":{"name":"@apollosproject/data-connector-postgres","version":"2.30.1-canary.13","_id":"@apollosproject/data-connector-postgres@2.30.1-canary.13","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f1812a9937039d1527e9e9ab0973ac88d6fe146f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.30.1-canary.13.tgz","fileCount":314,"integrity":"sha512-73ef7sDAZVN2vx0t1o/V8dUBO85NWPuT9rmXK/fUAHauPbrtJWl7xyM1IcUf4anzXLZlNESxJmmTsww6oCONTQ==","signatures":[{"sig":"MEUCIAf9dzFN3DGPlzn8z5XKa1v4J+VzDFxuew18vIrpZhcxAiEA99pH2StslP5ANIW+B/PL1oVpqJCNoRK5lBE6EJkJR30=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":939459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJnb8CRA9TVsSAnZWagAAHccP/1gf/Ua8fTkzjJsp5T2r\nkbEV/4l7n052g1bBm9p4N5JT8pClSYCZfE5pSVe6MXNFg7hIRxNeOzfiI8Jd\nM9KUiSgs4Np2hPs9kryxgQ2tkCrulYWcHVjuzFM0PHdcu1tl6TkuMoo+USPL\nP9ROTTVgN9GgHEtG3Ug0XnJyF8NBaue0uaSe5YDQuXp08XL54ewDDUwNDWtY\nQWLTj7NvVSqnMH5h63ntM8z12w4Ka8lKi5TABdMNlrsohg5tYI/ljWOUMC89\n6IANyH2yFNRyy+4TOq7NBygCLw+zMtRTDOaqQge9QJFuZecVieCGlygG6we3\nTLY9b8Ub7ZKvxfDLM3WvRF9E4dAQcHCivSYFK6fnULNUQA/66WAEKsaIyPun\nd7+PPJt8CCUXEQ6VEd5R+RJJ7YdGK+lx4hAv03siBEKfEY7MmJBc92AiuWWY\n5415vTgEOfW5c6RuZYOZCibsXycOIeCv/jv93YwT4vwewIBg9WYkbuDk18f6\nHHgND1WxrRodjSNCX1+6Mgl6mBZ0FTTLDZi6PJIzK/eB6uMLIwuJSq3HJuuF\ng0FGFYbyotigrYK1KRqpzboh3DRD7mHOs0w57gG9hM0MXSoQNmXAFnDhckCM\nNVPIVcpt1SlTH8b8/2LiWiLLV4+xmi9Cyl1avlOAJwQx94YDc6iF4Ik9yNIl\nT5Pe\r\n=bEln\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"96adbecbff44ebd00d9674756c2b5f0e4d79eb1d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.5","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.30.0","@apollosproject/server-core":"^2.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.30.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.30.1-canary.13_1629910780377_0.4264012755712032","host":"s3://npm-registry-packages"}},"2.31.0":{"name":"@apollosproject/data-connector-postgres","version":"2.31.0","_id":"@apollosproject/data-connector-postgres@2.31.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ed5738fc63731650ed2d4d740f8fbece9e7537a6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.31.0.tgz","fileCount":314,"integrity":"sha512-keKwaMWghV9MN8spHwiapqvzhV3uaLBFCZuiQs+ViVSS8t/L8ftbvC6Lq8a8wgsWisUnTV7ywxZ+M05bipSmLQ==","signatures":[{"sig":"MEQCIDDz32s7myAILNt2lxy6IPMGWpulZSey5R1eWS/eTKUSAiA2tmWyRxYqZ3VyN/0TEYKHUt+9QyZoNW/LOxOCIYHPjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":940164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ/TYCRA9TVsSAnZWagAAmOkP/3z5xlDV+wJD4PMm7ZRN\n3j9i1q0Tc19TV29zfjNe7NoHLr4I+USoPa/2cdmy9Wq5UjZL979q+xBin9wi\nXcLH+Ab/pgXgBhQfKsDKlLbtpAsRMfrCS4hFOuQ+co+Qgla0RWlSeqCkxFdY\nZTz/sc7ZrQA5ytvsXkklsDWwrqpk1yOrqLbwh/hyxj4W5q2IezqNsZwcVNIV\nL6zFkkDOFCrh2lUviV4a8q0SepJtPFQIMQ3GZ81Fo3xXlx27XbWijHD1ImF1\n8PtXQdbQ/cI0gxo6B1i3O/V+g5iY6fsfq8Qm2XKYjGYmWACn0WGizMatQlfk\nzbOf1niWJVSIoWUJYDrzNkzZ0EnAByp9E7Z8l29Mq6wZQ4Z+Bwle9qYByXXu\nDAmRq8AJvnCVIvDVr/t7oy4QAaCMuhcfIL8l3ydJdTOzIRkxjPrQD5Xlyhx1\nXWahH8PP1ONfdox4EXdtL2HD9cLB1My4/fUGgCSyxswgHM/ZK2R8/Pr51mjk\nB+L5xipieUYZIG2guqwCAwxo/OrXs8YzYnnZxIV0UZlLoDCeoIiEKnpx5cBp\nWCues4FdWWD0gSpJzg2w8basAPvY+BcSVVBQtjHBXzn4W2RR2FOA1si45WS2\nDBkpT515CXiL8fKpMCFLmnzb4UisGnEXiQLC+CXn0DMEgb19bXiN74eu+6Gg\nKvzb\r\n=NXka\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"a61693d41db8b7e2fd4c99b50ce653b2834f78c7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.5","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.31.0","@apollosproject/server-core":"^2.31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.31.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.31.0_1630008535980_0.5522140161898133","host":"s3://npm-registry-packages"}},"2.31.1-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.31.1-canary.2","_id":"@apollosproject/data-connector-postgres@2.31.1-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b2dc06e0ca3d2bf2ee8db7650a6b8c969387b6c5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.31.1-canary.2.tgz","fileCount":322,"integrity":"sha512-ZdrmdVNSOe3fHvRbm8zfLvT4AQRTrdS36IgU0b/O+9jsgq+CUOKT5xQJ39ipyycQ/HcpMsr7ksUaT14JlUKXJg==","signatures":[{"sig":"MEQCIALaCxpceiLcrCdTNqs4SGjadVsI9lYauv2cwaoCbLqsAiBTZSdvV1etz7lxE+PC9XHRbAGJLKbe6P1rtq+8CkajFg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":972811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLSEHCRA9TVsSAnZWagAAzrgP/0Oh2bM5RI0g1itIBoUE\n0GOHZOLX7fsoTi0myHApH0IREPihpA0un3oSYECw/97s8QkRpWORdgEx45jL\nI6H/C8Z7KP79u9GRCUyW6S0Fd5/oq+xA76JYVz6kZ/bbu3cQckUtVcxQFL81\nPEjy69zYyZF4b7v9gE1ZH6nXsLGMGN0w1i1S25kJJ/RZ7LHruOJfYoPN9OKX\nn8Z/5XQDnory8voMLCANDGgGj2rrlBDbzE6Xw7uENhG9mtAC4dd0A+c7uecC\nu1KPRESYw88gGuxr3V6teMwWyH5ff+llSje3oCsp7zw4/pZuxF48VPvjpLTv\nKozss6A92kZSlv5tUXt3GHk5bwXWX+9OlqRhRrWU0P0iA5wQeijSbLRQprk3\nO1boQWJWpkWGiXGN1A801qlo0gVqjccTo3pGBjbSet1Pzpsy5XhmxAdDt4e5\nT2LhzNLlQvqRhvmuaqC21VLnRcJNo7MTQSHL+pIu+mStwUQAHCGFZon1yH6r\n3wqfzFjonax3upoJ6UQ+D6J/frhNkg4qZkQY+LdOLzbufdqA+2XqLxZ+1P9P\nPeITs054Rqv8AbdnVpqcz7IAeTvFYNl8DfT+k5pgzUtTmGTkZhGgoZEZHQ0Y\nnMxmXqP6NXcNxubQI1pIueH/PHoZ0I/h0GvlxlV5QqW6k5IbiI8L9Uyq67n9\nPwQ4\r\n=rUY3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"5626b966164318306ff228e532323f0e78f44a5e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.5","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.31.0","@apollosproject/server-core":"^2.31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.31.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.31.1-canary.2_1630347526900_0.6446808106547555","host":"s3://npm-registry-packages"}},"2.31.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.31.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.31.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dda10b3267129afcf5f7a959cdb24f908bf3f95b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.31.1-canary.5.tgz","fileCount":322,"integrity":"sha512-xPOEvBhwdmNn8Gn23X6IhYuBgrv412fvO1pJ1S0AmuOarnVJKbarctrwmZenaNmGWxQySXz7ad/X003HfX+beQ==","signatures":[{"sig":"MEYCIQDNjCULoQlGIPOpAx0BIbZJx1qPGawxu5layPMnAO8yXgIhAIPawH8F8Dll0TOolZRO+W3taN1t2kFAU991kA+dETDS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":972919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLnEaCRA9TVsSAnZWagAAXHwP+gPWZrupmaagaKwvX7OA\n+4bb2VLwuuWQhT+HUwcpd0EC9luFnSC2INJGBucd9pq6/g3UE6F+JcejiPUY\nKxuIb7vjfxlZbP2m2MiVr8/q96ydrtHbQ7kfTyw/V5yIfBe5HbD8R8ejpREs\nlPimwns8626M+3merW2EZSOCLyULJDUO79ONf9+V2KFZRIhnJKk/ujsmavv2\nJ+aXocKKKc2JFknB2frHG3refkI86Z2QEPgeICFuFPXCSpjzwQw0jalcLtgE\nDKgQ3Ow8WbY10tl5cWTGSOWnVC5kX24BWyXJHJSS6GBJohY2eEQ7e/50U1mx\nzmqf+91chwolFO8kF0dJs6bhNccfXZk5pAvZrqI9ZAuaOzTpCFKFj7YoSW38\nuEAAOmgNPwElhKfgsqBHqqbkmW3ikoQF8Qgagu+ArZtwbpPgk8qInEiRAkS4\nEu5WCJScPHOv+3JYwfK3TSWF44A+Hi+NdBNVJSUj/vUqKsrfdL8EF3GU283a\nzGccbw/ysZGirZJIFWfdjAYNSvkEyuwAS4cCfFUWWvAK5wJ4yRRU37p4dtcV\nt6yBVU2mWYEuSxmkkB5d/RfZJLHcaaBmoDmjb1gVdpZUVzVqZzuAJrDG6vCk\nylgtEi8xVebCpVExWgEv1LBQX64/HMtlvMsyjfs47WpFLqXvgS/MZMj5B2I6\n3r+v\r\n=7hNZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"83d256858a5a2caf73e674a3e07c3afe9784259d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.5","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.31.0","@apollosproject/server-core":"^2.31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.31.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.31.1-canary.5_1630433562201_0.27945270851602966","host":"s3://npm-registry-packages"}},"2.31.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.31.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.31.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7a5cbd07eaf6035f171ca6c6825178fb41f9f410","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.31.1-canary.6.tgz","fileCount":322,"integrity":"sha512-2Y7dNWg4xW89oXkRvabfBBuZfaDuM4ETWyjpc3HCtJkKQF6e8g+YQiucmcgpstguQhVZjC+dgcKtrgbMS43bbQ==","signatures":[{"sig":"MEUCIAWb6b4mh8iqQg/BjC7YEWhZi+JNLGNeFGDZTs76zYSyAiEAmSZarILFZTU/R9Q82ApR91UB65ORRfOwZdxMRs3ZonQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":996438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLorACRA9TVsSAnZWagAAp9MQAJ2MuwAdMjusUbvwkgtp\nIF4mZ3h1H9X7XyR+WDuar9LrhdY5YT7QaOxeLsCbsOP1ML2293g6Xdz+AN8n\nZtOlsVN3z4dMw6TTkcg+aVNT/r3XEv2oODXXQtOxnMqyBQaoiYeEkQOAyQTI\n16LBb5ioRHtuJb7la3qLmW9YkoSn19it744C9YPgq1s2rGQFJqUpYXam6xnf\n6Jz7IUF+ro6JMtMq/9lT067oXboSprboVfQd549sILq/cqNzgESLf/tvePCL\nWGrBgandwwT7NZJ69eqjRE207a3ERsMz/2iYtE7hCEp0PcPZqa5TD2phBrW8\nvYFf2llqTlScE0IHPbJSvAFoY9XnCYPFpOwF0dwJaqpcc3w3h7d5hoije/1z\nY1JsxPl42wWQyMo1BuVG3M/CQAKfX9hS8myGk5gkpWJLpT7I59gcDT2Ju/lb\n6EPkMd6vb7mCdlFeQBrcHRnid2fKjp2Ptxn1sBSw0rX6b+TJln2w/E0fOb4Z\n3dympSUEG6ZsPs+8ojYmgDvQmhGCtXWoOrgjcSQEYY7RlLROpiMV3e2zAr+K\n2kSqI7QrBmf7JUsb4y7YTHbbtl9f63LdDFVz7jPvLN58PbSavABI7zgv4EEJ\nBb9rf87GQS7BDk7v0QNmcRMlw4Ez0MgZfOwSmppDhqiM8xrxRcs+sz9zmWeg\nzxS4\r\n=14mg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"807d001b44ca599126b809cc5c98c1e3b7b6aa4b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.5","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.31.0","@apollosproject/server-core":"^2.31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.31.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.31.1-canary.6_1630440128691_0.7588567785003504","host":"s3://npm-registry-packages"}},"2.31.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.31.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.31.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7ecd82dba4dca6e087221955821093202eb620a0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.31.1-canary.7.tgz","fileCount":322,"integrity":"sha512-q7PJgE2X37Kza7szD3ABH6kQkZVu32Q48mp+PghmAHVNmRJ3Z+Z6wWvJV9xcAJ6r4C/Y2ja2zXwFwskWp8/i5A==","signatures":[{"sig":"MEUCIQDWBSO9Gw/NewkAggp1myRWZ1aeb2BCzQQKI7x51vfxyQIgP86hTrnPt7pBre+ToDb/e/A+aKzHvG8SrP5dTAQXasI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":998281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMO9TCRA9TVsSAnZWagAArcMP/iboFOFBoo8x8ME30daF\nuacysZuBLcR7PEwphRRymb1OJvsS8at6bNwj0B9Iq4y9tELu6Sc77wAIx16S\n8ikrGGpAf9e/CjsVOnpFIzJtx6atrO4cK8R3bHi2Izu+515WqSEugGWXylMA\nhT2DdGq0hiLGCqAuosTNQNLPVcug30ahZyN23QqhNYP7S51ShSL/ni7yosZW\nlUSvoRHqqNT9FwU/UhO5z7Jx5Dpn4G9Nmcd0jlmIVqfZh4908cMkRXRRLpVQ\ngXOQdzjmtoJmryKlMV6FRy8d11MqjIjxVhe+JrqB2FyuhUxJPBJK9nXNhz//\n4YCzRe1BlAqauIqTBLtba5/YjCWTrZEIOBz2FcIFiQUvQkrYF/S2CGT4+c9m\nlhXKIjWpzRwulFx6qINCJLpL7oV9Lf7U/DxRpxWssAUjinrdBqRjKcDjW8t1\nYBs8KX5ZPh2N7NZ25mbITLApXEXqkcmU57cpeS4nts/w/tGBV4ihLVymogX1\n0RaqbT/ujmKgnMCpKQ7QBvGAbHXUWQjYhZq8f74FFibllfzdGmr5sGmxSMKu\nCv7daP9YpPKGM4fDipfw9SrrinhuOHUXIjpEdTXMV0yYeGNVRZiHflTAnYa7\nGZTrCKoHBaXuP5xroqXXLL1o62LwhxqkyohllBokK3zgZWFS5kwRAWKsZ/Vb\nqhsE\r\n=fLcL\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2398bfb8fb95bb501c25b0351f0d92708b8867d9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.31.1-canary.7+2398bfb8","@apollosproject/server-core":"^2.31.1-canary.7+2398bfb8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.31.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.31.1-canary.7_1630596947524_0.8264623313099544","host":"s3://npm-registry-packages"}},"2.31.1-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.31.1-canary.9","_id":"@apollosproject/data-connector-postgres@2.31.1-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c7b72ab470a6d47289ca80747413bd9421dd2165","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.31.1-canary.9.tgz","fileCount":328,"integrity":"sha512-hASHt0vvGi2bfNoWKXA7o1HW7aiywKD7pbNxtlhpQsPjD56UKQc8W11hKEAPOO+2FAhDIBkR8PBn2G3zr29WdA==","signatures":[{"sig":"MEUCIGbsXiTiweMYnfh6rI2TipKAjbMsHRI144n9MEMHQzE9AiEAmSP4+EWI0p8qkuejjva0xPzhoKyc7af+lPl449GFbHE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1032561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMnPYCRA9TVsSAnZWagAA+FAP/i+pa7xk6lLgIhu9CY33\ni8363vyOBw1lsMPldhkiasROp7+zPacwLniAWX5LFVJ6veYV8YfNDEDty9Kw\n2e24X5/A48xYkCVf+TafajiIjhyIq/l0I5yVzGaI8/gKhE2eCaRQC4SO3etA\nVEgv9jDJK3zlzcCQvfN2SJhwV5ATV8WuBNyAtWy/YN79KyVVg9AQWk2Z8YL8\nVUJ8BF6gUhiOqV0Nx9clHr5vfJk0rlWI/ORlQnmGMz8CHT47tEassOBu3RTj\nGcsZ/SJmh76v/KHgs4DKhS+9eMgoKahbjSBYsWrapxjkZ1hgJl+mGv6x9lHm\nfknUtN+4oXRKxXok9Y+Hxckn3QIhKViseLOD2SagHaiBxWRSllgNNc1SB4L+\nhVrfCzKIczcHVBcTJf/vzQ5Pr6L5CVyU/6L7KAhOzYMl4I/e/PHtmt4tBHG5\nboei1Xpry/BPi+lx/p7R41083OvrvBcN9/tgcBGvcY4zUGeYnyHRQPKm6Sqo\nilx63FhCfSEvAauptxzJb//ubesXHC9syMel5r/eeeBMwojnWg4By9ukPQ9M\ncMB5J8hd/9oKv747Ib8qz4Pd+jpD7bWc7yvYEF7RfQI5/K+kE+Caa9PQxS3M\ncxur3lLK2FLiRhTOC9aGwusJf8MqlL1a2VnNm9xF4rhDmuvmV6ZPPP9nl4nq\nBsOw\r\n=h98s\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"40584acda3839973f69c0f6131b86324cf59fbca","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.31.0","@apollosproject/server-core":"^2.31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.31.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.31.1-canary.9_1630696408724_0.3166566539804172","host":"s3://npm-registry-packages"}},"2.32.0":{"name":"@apollosproject/data-connector-postgres","version":"2.32.0","_id":"@apollosproject/data-connector-postgres@2.32.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e5f5174d1d4d269a399067cf68ebeca537cd53e1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.0.tgz","fileCount":328,"integrity":"sha512-ScdZp0i2nAgKLxFv2ufwCUhz+eZr3aDeld8f9kvhlai4cnR0Tjz+g9IY6onKkmtsFUuhCWx6yaES2fBbuHmIQQ==","signatures":[{"sig":"MEUCIQCY84GBKLKVBSNgioTHo3DTvowJezk3lbEo2Q3WkUPKgQIgMB8oLTbl3veZRiiadtO7OzbPJZpXo0V+zR/Trx3CcJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1033489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMndQCRA9TVsSAnZWagAAdVUP/03Wle4ePIwTC7ie77ep\nnUfcGUxulZcAxnOzPPc0ki8gHcMiFIh2rFCiRLSYx/kVt+iw3YvgkX+nVMVy\ndLhyu6AVT0+rfmlzKlzkUipJjwsP1ejkBwJkb27cm+k6AjvnMZIk12vY3hVQ\nhgqJ6au+kIakEBYO7f11xIrJDIHMmbIuPcvzh4SmwEXCNevd/23h418mqLxl\nNe3oGv2hmb6G/lvJf6HIc1g5VHzkJqRfiQ8xDH2Ub27vfgqZefvJ9rFbA76t\nN+jZednyc/9Nc1/ZOA0hxKJOUjShleGH7LsxB+YOMHprTTlQbOIHPJeVEzLK\n9K0M+ROxziAoJ+DbY+XfymuKRf+5CS5M3PuaW2iI+MCS0lL2te3LkA7Lc3fX\nAlJCZtvicxGIKXxmYxqKyrt9QauH41GmU2M7rT5nrGBoYSS17TbHeCWPIEub\nQGKHLpXTuyyQ/I27Zw4vsAygveiAKDECRYXd3BKgg2dfsbW9nXQ3JCGxidbY\nymUCLHTt1bXQA3nK1XDRf2wl10rNU5Kk2KJFUMxFYKxK84B4cZHEBQnMxELn\nFBppr9phAWi8GSBXKxzgNRxnSo4bq+9IICzYnk1yGH25nhTGlrLzwky5ZiX1\nsT/IICs1RN1KNVXDpTqjinWNy2/o1T7aHQoxMqfmw7vcUg/CIwLcGHzTNYyz\nut7J\r\n=E2Tk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"5efaf22d5397c87381383a6f1fb784ad7bab72ae","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.0","@apollosproject/server-core":"^2.32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.0_1630697296065_0.6380001224115488","host":"s3://npm-registry-packages"}},"2.32.1":{"name":"@apollosproject/data-connector-postgres","version":"2.32.1","_id":"@apollosproject/data-connector-postgres@2.32.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f00a71a15ffb092be91ed58999e1baabea3480d1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.1.tgz","fileCount":328,"integrity":"sha512-MduoleVCbnqy831wDqGgH9ZLg0gwoopY4fdpGHl2HEQ/nX8Kss2+Cy00U2CATXcJA4xO9b/VbYUDmNKOvjKQdg==","signatures":[{"sig":"MEYCIQD5tezuvLMqDGENg9hBYdpsWvhCgWjB+ISgAGiYgmV/IQIhAODR7fhx26+EjGuvOL2BYUGiSaTNXJ4gpzrmKDArb3BN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1033675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN4oQCRA9TVsSAnZWagAAoggP/AtyPueUl6HlndXhikp9\n+UlbeXn4QZi62lTheDJ6qZ4Nt9Ljk6weRZWgj8WwVKoy6ttciVd8sZq4xKgB\nkMi+au19Gw8sjG7fLpNVfBGiRDjCnQjAtHImbCwjtW2kPzNgLLbEQCni7snV\n7AsmdLb3le6PISd4UXpIUn/xo99n14c8nGKfn454io2CfyTecCdGPSfEwsXW\n9/fHu7UqfQPnp4THTROhLyBRx3n6DbKUlYxPLQ0V6j/ii9eV16/q1YBShVI5\nzh402bOyHZ9YAQv/g3Bf2gM7gupVTM8R68K6qwNql0nsWG3N2rHMlKDsa2QU\n77B2ZQnfXJ+bVI9JRGaQPFkLJ8t6BIk24R42ZcFLl8AL1MNPGk9EO6tmEtFa\nUwQcsYKqCaREHlIMf0ybl0UhWZcnjHSxqzATnRjeY3CXQkgnRWmoZJ0uNFGq\nCbaRBuAAnphhKipfIKKbZ0wAP4m0xoTkPPp2cRFPszZqd3BfiDQdYJueLydE\nt9ncfnJSE2x89olJr5x5tVLB8OihL84O2HNmmC54D63XB2Rahss9TJy8UhdX\nylS5md3gcEIuPYp3kSjEJpWVYcVQ94MA5EA2IF4uI0yoMN/RrlhuDMzmjkE8\nni2hhsBGRNvkvuJx8c+6lK7FZ1emX+2kLjFZ2ilX0tS/kG+8lRb/DKkdAMm0\njV6K\r\n=zJIr\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"e857f74c46ca80b0f89960c7f1eb2e7d5bae10ce","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.1","@apollosproject/server-core":"^2.32.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.1_1631029776226_0.0053803434826991126","host":"s3://npm-registry-packages"}},"2.32.2-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.32.2-canary.0","_id":"@apollosproject/data-connector-postgres@2.32.2-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fada3e5599ceae74bf35fb22cb7f4bbac2462b97","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.2-canary.0.tgz","fileCount":330,"integrity":"sha512-BB0gJotD7ARtbd4TQ90C0OI8IDx4r3X7Tk01rDbY9fB3mFchAqSCRrc0spDGjdyUqHDN0juR+iOAVQm5T4mjZQ==","signatures":[{"sig":"MEQCID7iNtxQZ6kGGAHZRgnT1rE1esx4v+1QReR/IJU/U7hgAiAH9wLKvzcRe7rCIbBvQj2p9blH2E8bSq1B7IVk8fb/Fg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1036035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOMNVCRA9TVsSAnZWagAA4f0P/2q2qpWVqp65kg1kIZKB\ndPkfXhVrGHJuoUuWwHYWlGt9o9yibalxbbbsx6iwxRARuKEY32EpYjS+oz8g\nZjoijg2W8J4St6KvmtaXRlS7hoYTRZSJeoHWh7BZ+idB/n+sFHptMCFgRlCo\nUciX3WLtQ9rowJlCaWPPRWGkekK5Lor3IPBiHM0oeRge3QHNki1FEfIF2LqY\nMT0kCPuj/QINS35kd8Z0CcPHXXvNu2be4UNgSW8RZouDGQGmm+UwwoFmQMQl\nH+rufBovji93TMMoe0r2izeWCrS2LwWk4HkWujOESz8UMZkR2qRnmTcRi/fQ\nSgybyuviqMByZhUQ5xotPhEJLAevbVe+tnOF81p2p70N9UIlQbhRwPuvAvkh\nonabvLuahfhBKPv8sWL8bth8cLCCEg5xAlLSBeJJGIc5hc2PuUp5sqf04WR/\naCpkuJS8u9n/Czun0zjKwqAhT+eQcFYTJZsinrtbRP9jtUeaPfpLXrnAb/I+\nzKtnMfFcyudJY1CbSF2ZEbFOPCFae/2QGWiCWMS1Q8I60u/c6tn/xSz+isOC\n5ufAXhgyf4EzJqjth65CYSbj2tVSzsRg8x9zVXcRZxRY544/k04+6K9m13Kq\nQ7qdqn9G6lYCBVHsEKWp3++fVdO4g5gmbQoLRyWsRYrqmByG+QipPMsTMxJi\nksLT\r\n=VSHX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d909114cecc8c821ed2a4f27a290a1e09233f81c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.1","@apollosproject/server-core":"^2.32.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.2-canary.0_1631109973657_0.40783454678493536","host":"s3://npm-registry-packages"}},"2.32.2":{"name":"@apollosproject/data-connector-postgres","version":"2.32.2","_id":"@apollosproject/data-connector-postgres@2.32.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"feb167a06798284d876f5a6ec5fc53f2b31c9b39","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.2.tgz","fileCount":330,"integrity":"sha512-FPE8nrdIEhBSKL4v3C50gmT8BIG6GqpbiGYaqYpt4ZWE9q46RcXZnphIwrPx9S+icAFwiBhJ6UYmuDZY4r0Fvg==","signatures":[{"sig":"MEUCIQCslpShOMsvs9+JsY9i1SovEx3WwZBkz+6gK95URCaUmAIgX+Ui8GeqqkxqbOTB9fOjugPv2ijfZCOOXrQ7Psx6cpE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1036203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOkeZCRA9TVsSAnZWagAASZwP/iBwIq00h0CB7QVrUUrV\n1B47hOUh/wluLVOAB0Oq8q83Udg65LEXekXAn/aAGNKCxEEKvheG6iVnh0cl\n8l2iXa+cb4k1gDM8Os5/MyYVOQdcRzF5sml66uzGCrMLIvbru1IHnawDZM3J\nB+Qk6zqPpT8dXzyc/NmJbTOuo2ZVm0Fg2g3e1cH/2YiTayof+bJVEPEiojVs\ngSwqlZzcjn+SXOaud765HS37o7VB9aFb68WIrAlZKHHg6J8q3NASgiEyTeTv\ntlsX6vnZB65hcs2Vo82Liqm+n907MohTyB5J+XcK+EOajjsDWI65moiokRsC\nFeqFzK2vfi3flG1fHTOxgBggfJIza4P/O7lltz/xlDyZQyrLm6ghS6BetmyI\nSRXz62sRbGTO41Nk1TLM2iZnPfxk9Z639QuQnotmPhl8URh5BTQ2gqWwJ3/6\nIwVV567+MzUDTY2YEOsOMfoViCyRfUZFKZf7HnPJ12FAntwOZzR1GuIHRR6q\nlcCUdSywGyYbC5YD8HjpwiY8X0ZC1IdK0nlbd7j2JIRnPHBNNVlyFzMb3+in\nqOUjlqnuE5WeQW67WL2MSNaZA9kT9rIVYik/eUli81fzIt1hLfn0aUDd+t+t\n/Yb68gqxWa2nbiJQ5GX3VQqD9SC72km0650snr/UvXT7HXFKrqrPJOgbcq0T\nf17e\r\n=2Pp3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"d4d982e8c7eb6214ff272af679eaa96e6752ba3c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.2","@apollosproject/server-core":"^2.32.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.2_1631209369258_0.9270580308798264","host":"s3://npm-registry-packages"}},"2.32.3-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.32.3-canary.1","_id":"@apollosproject/data-connector-postgres@2.32.3-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6b947697074f5db37e9bdc559e65d979d36820ed","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.3-canary.1.tgz","fileCount":330,"integrity":"sha512-+EUfgaT2QhAGnip/jvl+/8TYl7uB0PnaBy/VfJPdoYofDanBWEk7RC6PAnSZViNP9PXQQhatT/jEVJolbXkiuA==","signatures":[{"sig":"MEUCIQCqSBlsn/PyOSivqo1HHYZejaQ3AH1lSqtvvOett6yGVgIgRuCcX9dnGih1NK1Q/Whd7zZHUgLthXZFiHJrVYpr+M0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1036080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhPBaOCRA9TVsSAnZWagAApMIQAKSsaDbMccYCgBwqTG3F\n/7BDxRoI3rvulyS9kCSuy0U3JbW3r2as8+6FfyJa960m4w7U0nD/B5OHvtL0\nyhgwuSdZW/mGAKpPt/WE9rKj1TXkRNSEZ77+o0JW39sp2lT6hHnFsYmtZP5x\niDfOry7Z4JfzJpd9kYxHKMnTrFDzqPgYLFIt8hr8zoEhEmdoHWhXyr7dggju\nJQCcuUoamSrXwqytZYgvvE13k29KjgHj+wf5HwMBd2GekOLhGtqlqHuNIHN0\nQ335mWP3nsyXiK8giD67NQ69fVQN51doAENIWnwzrdhBmHfyiZzbpvTWMrTH\nExtdK9Ay6h/a43avYMBsWgOUOddqo9XmpCb5VJpo0ABufxCBddm5NRAzeG+b\n7w03asA5dWDcfFO8SWec8Pyq8ybkm8Z/MHkLC75dJ9sXx0zK1ZLl8IOQKuNo\nj4ob3MphoC7cnhX+PmXzZsb2VDrk7nwTTu8XFToYXeoGPxhQ85f4WvpCF6Ql\nxtzELZCX7CpjY3J+LcLpJCpDfOy8vGsZJZD577hLAni7M7vVphyesxx7TCL4\nGGJ4yIMwa2IwLccnyWToh4ixR/GvJhU1E3uFr6uUkcCTIo3Buu+Pb5WerDUH\ns5qjHAQwtfzQGtpvLQBGwfEVy4Vxh3HdvPxfEpzxblZI+IDnklBOwSDp1GYz\nDXjs\r\n=T6LC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3af8be70df0931a66378982a766da18de31c8176","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.3-canary.1+3af8be70","@apollosproject/server-core":"^2.32.3-canary.1+3af8be70"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.3-canary.1_1631327886276_0.02249089934661086","host":"s3://npm-registry-packages"}},"2.32.3-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.32.3-canary.2","_id":"@apollosproject/data-connector-postgres@2.32.3-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6a2585a236c4298bfcf48af551f91a737ed2acba","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.3-canary.2.tgz","fileCount":330,"integrity":"sha512-Eu0GUpOMYqRwc1IX+yKASAbAP1hRbqs9sygH/bh6tVGRWlOntQ1Sb0sf3WEiUm+1nXofnF6xyDv9MfVNEn2Edg==","signatures":[{"sig":"MEQCIAvuHSYeZry/W/DX2HL3nzCTJ6a59CI6ivEmSyCwOTszAiAjNotqV4+zAwwefXFINA5T12bVHXhWAgyt7OSn7IE63A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1036142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP6ApCRA9TVsSAnZWagAAHv0P/i8yKMdHCQOKiPIoRyIM\nf4bnPkgvS8RoX4NClXy0HJW9dZ+Efvkdc+tM+XriRsnlszPv6GZHba5Un4Vo\nuAeAB2J1D9gyB5b+I0oN+3MaLGvHBZDI/n6R5TlQKiOKfUrXdOEyjksRGMO1\nLnNFoIt5DO3qZ/n2HTGsi4h15c9WllSt6AbFBrJW+2q202OQHAML6mzUmuWt\nvkg5DBW7dR14lcDKivHYXLTopt0Ix2aiuf3gQKhYZHSzWGMapLEhfQLPgWuh\nlJZf3jYM5lutCFZgrzxUEjivPbElfo5UcXMlcVzvkOwVQdu7TxYYO3Z1ULWJ\nbh4snU7/290pkNK10iKIASHleEjZ6tNQ7muI7kkxr7ieXBcEN2TwlzhK+Hh3\nWBHZUsvFggE7fnTNm0GP7ig0d0d2RIh738ymOZq9Ed73GGbdgf3dO2rWGuow\nsBS9mZvqzjynnLvcczUR9Io04WpwgrIerNs8iQa4ylXg+zqcNShfOir4beQZ\n4Ta3/qlzRwVLML9zz5kpzNpmBB9hMFQeHNA3FVUocIMXbJ7fHlF0KhVmuqBq\nxg9PfMgZeUI8loLUb8jfVxOdDe+FzXDCdEf6G2KmBG4AoC7GtKJa1wRz8XZZ\nxpprADRva4FWfMoCaOlJGNdNeiRQGHRlKgMQ6sPuLhtwvZoALXpvGrXxJ+Ji\nc5/f\r\n=UmA/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"03e0e7ff500187daf185406b48b81702d0e88cbe","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.2","@apollosproject/server-core":"^2.32.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.3-canary.2_1631559721540_0.2656089762479059","host":"s3://npm-registry-packages"}},"2.32.3-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.32.3-canary.3","_id":"@apollosproject/data-connector-postgres@2.32.3-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"60b830746ba3540c519d5165e4498d4b439ac5bf","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.3-canary.3.tgz","fileCount":330,"integrity":"sha512-54AsQ0iddX9CEY6G5GCAlYdPNYaP/TFS58ZiIdWNYOnGA7JMzi7YkkPR2zXvoLlI1j6/ipO/MAtzKZUeAb4Zrw==","signatures":[{"sig":"MEUCIQCD1O+EebpCvoQoezY3GkIj2RWIlwjxQL8Y1bgzQEU0WQIgbI14TUmJDnTs0y8leDpvN9SCA0wUlPlqlPDleqDzG0g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQLTgCRA9TVsSAnZWagAA9qQQAJPB2kIa93ku9Iumg1Fn\n4mXv35T3YUlbzcKdTYDOf1ZZsqeSamR1fqt623ZeSKrGFwHzMh1cNMrwlvaj\nY8Dx0VMQpiWV5QOnXSfcaEBj2o1rLqlI8YgnA51dbWBA0TT15IWvKVHtfhng\nvJAC5VggKT6AZBZGN/BssMufllr7bWqzy7kN7dryE7Q9S5N5oPKG0J+rbPSF\nA5my8T91fgmS1oDF501Yb8aX4XDy5ErCOO0mkg77stty8t+Z3Vbwpj5XztMP\nLN1EnMSUBHltQFYpuTqzETuVyOBaemRp30q6UQsdFVEFKMZd6v4jya1Q/2C1\nSuIZ6rN5Zd0DRYe2a0OHxp/AWYfhg2kGPa4wnJSASEU74LK6mmztFwfxzC4r\nWilY02uxrBT4UGbNtL8FXLci7UtOylH0KwVa97d3ehhNF9K6LHYdDFJUHlhr\n5JuRWnn10kwfC7iYIeLSLHFQMLHt59+1TXMAJN3i5x79TKfhEbDfEpnBYUOS\nOAu8fyboyyTa3gmLy8phqdru21YV3Oz2WPUs2SXom/M45mhKSEFwYhl1Q1BF\nYwqE0NuMntznDPEOc8lIn0HyzvNz83yGI3UQGZAIfpSzsyKJfdRwRP+KlgJL\nfz1wIp60PD8JHum6ogwlMLTF/rRLdbXFleIPXNb/89Mj/gInxFJ6/j2IpEoY\nY/zd\r\n=o7dn\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"09cd369847742093d7eb5eb88714363d91b1bb17","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.2","@apollosproject/server-core":"^2.32.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.3-canary.3_1631630560324_0.058198856962513146","host":"s3://npm-registry-packages"}},"2.32.3-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.32.3-canary.4","_id":"@apollosproject/data-connector-postgres@2.32.3-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1e0431d66aa4fa264d5454924eda68079f0a1917","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.32.3-canary.4.tgz","fileCount":330,"integrity":"sha512-D3btZqTO/qvM4lMjF+gacioTRrral7NvHvNP2HnKSiwCP0iHAdsyzb4YLpxP0mSZHQ/7zELYs7rOVjasczNgJQ==","signatures":[{"sig":"MEUCIA5HmCd74OgWg9JuwIcgxHoUOp00OjamcZJeRHbSUBCUAiEAzfgL9T8UfrG8CKtz59iD6xY8lCjpqb/clmJq5YDzIJ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQez2CRA9TVsSAnZWagAAJxMP/1PzofLM+TdIDdLNd/39\npFxGvh8uZSle3dxwlEdMESUKd0iGNifpVKEe8Z9A7o7rwr3O215mQRvF1As/\nkrGlOJ2v0UkZagn3TwAuz5GhX2OdYGXrEQNH/rcnsbvlrM4XQEy3Lp5d4Axt\nccdfg0SC3xMEH2YFj2GOixEyTZQOJdHxmWTdxS1JvDbDsc2flaeLMRY3dSsT\nDoEOm1hYqju/ZCyfPeT0G2DhuO7V55b0rDBHa26t8wljoX4UWhhkgnZBZt8D\nvBDSAYl8Bhq1jvsmZFTbdcAdFIAMKdHdEtvAAm3E2TaUZ7Sl9RY4JY9v4DYY\nr+L7eoAMxb1vMsUgI+bRw7ur6/fKVJhNq1ecFlLTHddjZ6Tr8PLmhBdNIMDg\nnUVxU3aOQc7oIR9lqzl6ZqNBc20xWQVIoCkOAreAPh0aI36XTgy18RaQ7hYO\nBg5bPED0q+9sQs4Lz1C8heYx2jnJvD8IAi+5IpDyJlDkQY64ekBzWc0Yknwj\nDgWRdsmouhGBO5O5ep0DU+ipslv12jzUQXpaY1UzKx6/L9vpevjfVGhnZOC2\nxzfGYg86L2A2GGF0UwSGOPqpQEkpeJDW6ewUuMfmWaZn66gQZkgIkqZffFqk\nBVk6tm/6KM6rA7C6Ds5lmzV0eh0CiEb3i5KSXy5MagRt/65ZAgvgIt/hngS4\niP6+\r\n=gNlZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6228bc2b739d2fc2219dfe066436c9b4500cdef3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.32.3-canary.4+6228bc2b","@apollosproject/server-core":"^2.32.3-canary.4+6228bc2b"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.32.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.32.3-canary.4_1631710453818_0.02797040679026508","host":"s3://npm-registry-packages"}},"2.33.0":{"name":"@apollosproject/data-connector-postgres","version":"2.33.0","_id":"@apollosproject/data-connector-postgres@2.33.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"230413728da2a12e4d6426711721e23e4f9c1017","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.0.tgz","fileCount":330,"integrity":"sha512-3ytN9ncfmFAnJArnJ54Mvow2EPbrUwuE20ilmxQ0n24lf1rv8VvpflH5Z3sd23wbJutVm71AEXQa3X8eelZphQ==","signatures":[{"sig":"MEUCIATwA250m88eCKjxN1kB/4jZZQ0WAYUmLO/2j1i8RtsWAiEA0Nh6No5Es/M7X1yK+VL6GQC/3ZFnqSmuq7ju8Dgn11U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQhIHCRA9TVsSAnZWagAAFhcP/Rsud/KHUyrNUPRKyvXA\nAZs8Xcsu6Giswnh+LcH05x3qC/aRcQPwe/zhyH8LK0I/GflgQM8NmM/U9H+X\n7CmwNU9A/vQ6liOt9EjFSiDXYVC4tmdPlt21Zc7lJ2xSu/OSXzZ+C/l0xwCg\nEASOOitqZZUqhbxT4T2D9EOMDWBcd7rlU3kyG8je3PHTOQK703tguZX+bEiu\nPQ2LXPEabePZLA6O5G0yfNlkuyJ2zEwAKdtRPsoWwtc7rU5zA6vrbUtN+5io\nuedZNkhxOGDZC98ae2QAd69z51aIP7ivm/BwXbEaJY6kU7kKTPLiK/06aMyN\n75cUsQ4BorqJgtiJpfdy5S0mbeg9IjRvRpnNVjAZQXDlxPD2lc5u8d2lG+CT\noZ66iAMyioXq8usBoRQsfqG4SlcVizRHl9oGPMoU6NfVKM1jzLQchqsbjHYw\niONQdXrjsX6JOjTcGb7P8Dx033bF7FcUx5JKj2heY7KS8hrnisg8QGolF2Rz\nPY0cyxFtrh2ygMucT5qkSyyWYDY2a569kRVe/Z6dKURGtf1wTkkyTCqVSX8e\n++5HvWBbcwPV6HK77cPp3QEJt9JTim7psXK94XCi/rXKA9kBclLdkDNsd5Zx\nWD5WGulQyHciUfMMSYPcnyumvw1oq5qdmjrRfuyvr2XmpPMeQIv15q2ITyL4\nCJr3\r\n=Jlvs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"629a36db75775233509a93734fef8f85ed23701c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.0","@apollosproject/server-core":"^2.33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.0_1631719943158_0.26457530094414006","host":"s3://npm-registry-packages"}},"2.33.1":{"name":"@apollosproject/data-connector-postgres","version":"2.33.1","_id":"@apollosproject/data-connector-postgres@2.33.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"09ceb54e21b4012cf93209f411185ad075a209bf","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.1.tgz","fileCount":330,"integrity":"sha512-OvT9KiBqnBRQl0H9lzTDP6mS32fIqoDanZihXsau6+DsJKSEIdCAxynMQ4mkSuJUGHIe9GLXIurE797AsbXDwg==","signatures":[{"sig":"MEUCIQDV8aM/sl+wRD15FG9sEq1EcydplOFvJmtd+aheUC+O1gIgMylB5t82eypDhwDuo5QM6NAdRa6Nnd4BpAm3dzTaF8A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQmTVCRA9TVsSAnZWagAAE+YP/A76aC3CZuU3++XD0o9Q\n+W+NG6ZPjIOX2Ywo89+LRftVIyc6qXEV5xcJ9w+a5QdOkU4gwFeWpcHGVMid\nRjQF1AMn52GSp9cCMfJKaOKnBS5TnIfbyRTmSRDS8x72WfYIsUZrhKwPZSqu\nVJcG40ZN4LmaoBcL6JbNZSg4h/4jU8cqKfuJzva5S+Yy6le05LVQ+5OZNJ94\n9F8Gzdyos9su+yEilSth7W8mg4Bys7c/Z+KIEfrqOKDC9kYqm5fk7RPuNwN7\n2hZ6UKViePH31UGahOyElu2VSHXq2WSvpn+on5LF5WOBTvCyxKKypkJ9ERrr\nZxdc6YH5+a2k1d1yrWjUjAwMOi6Qs7AT+km42UxKiZzHallIAsfLGCkaw3B7\ns4ImRnMP0p6tGuRvcglRZR5aJtsG97j82jRKOh8U73Ec7Ri6sPO7p6zLI0zE\nBTYFwnjYa99exkxRraesd2nqyVZCcjn7kPaaAXvUCDiWkJmy07pXd0+MiqfJ\nEei4oxep39Bao8TK7cmva+2rfZXqKEuw/if/Wuu7ITXlNGBDum/DgEHoRJUI\nFoFbhVVchlF59TERzaJiH74OthVBtvvQ4XuVMkLdL9lea+z39hzraPBO6SK8\nea0p7S1yLyWrcEH/m2iA+mz567YX3o1fumRSwDIFDw5yJqAdlUjUrgV36vdD\nn3pr\r\n=WUzI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"3ec8a8cabefdc7e2b1bcea784bad9c7161699b08","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.1","@apollosproject/server-core":"^2.33.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.1_1631741141593_0.6561087356161417","host":"s3://npm-registry-packages"}},"2.33.2-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.33.2-canary.0","_id":"@apollosproject/data-connector-postgres@2.33.2-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"524a01415989a2baac35d47d7ff1683b6357fb5a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.2-canary.0.tgz","fileCount":330,"integrity":"sha512-RdkLXbDIxuVVqDo9V1D1JUvNs2SR0XlTaGvRbLViDRrVpx3BfDog1K7DcpF8VUn7/1WU9VkvMShbOSABgYp7Og==","signatures":[{"sig":"MEUCIEjG24O9mSf7iOM4OeLLANABGl5NKEkFEZlEhEzF4tDlAiEA6dGpVMb60qXRCPwR89gslWvSwijKUM1ZS2t2g0oeGBk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ5pzCRA9TVsSAnZWagAA5mgP/3hbSkZK1l3q1DOe/e/k\nPE25RKahpD3DQH2MuRfZUNa4WBJbC9K1naIQSW0GGQIEfBIwds9AgmM9pmH8\nRnxj+Id+lULyBOGgQlXq0Fgyz9AhXuucPVvNiH7W1UyP/jsBPYEHxjqyP8b1\nu4HeFSMZpMCS0x4vTHNGJuX58e+tUWI60bCagoE5jnc8dlAoY1sPa9EPebY7\nDAEOEi+YaXzf2gOAxRiyRG10m7U67TXrdYLMkg03lLPCPBPj9MF5crcuY8rr\nHHw/S+SFr7wtpovbSQr6+5afw8Q8gpg+TlnML0SKaCVSaK1W8f2xNg6TVwrb\nGPryt66sv1EwaQvCHffkYcTYQulDgYagVnUlffkaIbhdO3NpgnLvQhb8q/pP\n9I6+eviq0+ZqQzAjHh+yPQuF/gSuCdd1svDynhG15xXG7qUX+6aezP6T9ZJx\nCzh7lLgzmwvP8psmotRlqMqbWjELmqUS4W443NyzK6pQwRetKXW87UxitOAl\nhWIjLHyyfsh93qXuIoNyugZxRX2MjaMauUmxMBoBYkGvrMcMom3rGBetKAXp\nbjsMrXvjOjR7cbzCLdYpj/9J7F1FjD4cfQ8WioUCADc8lAxghfJ5iCwgkUt5\nrU0tpzpNdwo/UPDBet/RNXrtMLGqzydUJkGjZtixUNkMA6xtzbXnjMbyjcHv\njsRU\r\n=itA9\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2adcc5ec59dae738146c98fbba9e71f0ba1cb5d6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.1","@apollosproject/server-core":"^2.33.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.2-canary.0_1631820403183_0.7023574035195443","host":"s3://npm-registry-packages"}},"2.33.2":{"name":"@apollosproject/data-connector-postgres","version":"2.33.2","_id":"@apollosproject/data-connector-postgres@2.33.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"14711c8cbe52be56442ef606411da104d8c5d887","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.2.tgz","fileCount":330,"integrity":"sha512-IggV7N5dp+zzfp6HOs0ych+d6HmDn/QvzpZZ1DCM3tOWvNQaN3kIoJvFPQ7JTkOCrWAMJ0WY6A7tz5xTTD8G4A==","signatures":[{"sig":"MEUCIBqt3nLw6gPKDZX2GCXS+dlKJeIWG2zBYoMpu+inbEg+AiEA/7XgMdAQvGV+pbZNjrLKXgTP8INt0j8E+Vtq9BnD5to=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037441},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"20f3dfd8c65dda50c1e1901fc7df9011a5193845","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.2","@apollosproject/server-core":"^2.33.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.2_1631900573572_0.18074422228815057","host":"s3://npm-registry-packages"}},"2.33.3-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.33.3-canary.0","_id":"@apollosproject/data-connector-postgres@2.33.3-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ffdd046bcbf7be80b794572617a06974f6c23c5f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.3-canary.0.tgz","fileCount":330,"integrity":"sha512-wq6+QgWfEatqzINqIOZBnrxbprCm+uRqVCy6tr9ZF4T5PGI1VXjC+/Twu77Oqk92uqmL94/pCyVLFMRKmou0/A==","signatures":[{"sig":"MEQCICu4wFqAZu5ZK6uFMq83TMme57EEtaddwPzQxG79Ir2ZAiBxo7LX2QQIlEQ7EKcoirya6yxPWr5CBw/FNmGtpadRtA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1037741},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"76084254eee59fb9a1a0bcb54f2f3b0b79fac75b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.2","@apollosproject/server-core":"^2.33.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.3-canary.0_1631902616970_0.6491707350956406","host":"s3://npm-registry-packages"}},"2.33.3-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.33.3-canary.1","_id":"@apollosproject/data-connector-postgres@2.33.3-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"00cdd84816fcc070753b6ccb9474f89c0c6f1060","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.3-canary.1.tgz","fileCount":332,"integrity":"sha512-pSrcJjssxOcmB/SkVnCoAMW1T3EeQoCEc41WGOFrHrRJo5P/1UKeMPiliw0iA9ICQ+Ap7gjURnX2sRfgOYpLvg==","signatures":[{"sig":"MEUCIBMGTL0CbAsTZA8Ai3/tEMGOtnM5pobKUM3Y8fAPGiPkAiEA+NH8DZ6GGy9rXLJrbRTPAbhvJm7smTtZ72tlZTqpYlY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1040827},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"072ac643667ae9b575924712a4c242de732b66da","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.2","@apollosproject/server-core":"^2.33.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.3-canary.1_1632163734128_0.8519773618016693","host":"s3://npm-registry-packages"}},"2.33.3":{"name":"@apollosproject/data-connector-postgres","version":"2.33.3","_id":"@apollosproject/data-connector-postgres@2.33.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"eb81f76e66a192d9e1a398d2ac39289ddaf27de4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.3.tgz","fileCount":332,"integrity":"sha512-cvg/C0CT0S2WjJYF1LNQmbfQFt6KhDtoNrAkdOUARjAkfZcxIBgcyXgsiCx8Es2HtAUR9fAHwou3hBiXu7G3Fg==","signatures":[{"sig":"MEUCIQDzwWQr39HiOOCrgV0iZ8rtO4J+7mbtg45CcDW5MM2QBQIgKJqDsTR/5fYQRGyUiGNQzpY/YMP4LqXUpESHEpZTS4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1040995},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"335fe272894f011dfa695e6c3d233b7c8f0139e9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.3","@apollosproject/server-core":"^2.33.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.3_1632321113051_0.34820380938164774","host":"s3://npm-registry-packages"}},"2.33.4-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.33.4-canary.0","_id":"@apollosproject/data-connector-postgres@2.33.4-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"df723eaa7a984f2a144e622c1380859143a6262d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.4-canary.0.tgz","fileCount":332,"integrity":"sha512-tEMefBnwdvXrYCrFxK7laLS0GMxOzdjJDoHNEA+NSS2kG/NTh6USEZo9I69/J7qNw+wFWB5QWxTAxMU/eHf8WQ==","signatures":[{"sig":"MEUCIDKMU9DAsZTqWmIGflFF5Yzfn2NmghO0aRxcttjXsU9jAiEArDqlyNe5BDd/Cd43RAbA6WVzO/C9vAcuhPmgMP5IeCc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1041217},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b1ade53b2e29a13d3aa2b5456564cb3dca7f5eee","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.3","@apollosproject/server-core":"^2.33.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.4-canary.0_1632333503712_0.20361950663791029","host":"s3://npm-registry-packages"}},"2.33.4-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.33.4-canary.4","_id":"@apollosproject/data-connector-postgres@2.33.4-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"328e76a7070282681c5408cf028cde0e35792c98","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.4-canary.4.tgz","fileCount":332,"integrity":"sha512-iyuQjhhB9rVCfXM5RZf7YN+DG13jbFRDm9xSrlnwxjc0/NBHg74g16VtvdAVzvo89z7fAsgKLWGlAFfzOz2jhQ==","signatures":[{"sig":"MEUCIQCmzugWfxgtkr9LEgbbn/+mCmYaf0GyPlrqQQstUug8PAIgcxgSTMSecZjWUzoZ4A7wAZ+i7fLZIbBzvfomvWdBjo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1040257},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9dcf5f5fbd1596d9d9ae93154f6b52ec4d012cf5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.4-canary.4+9dcf5f5f","@apollosproject/server-core":"^2.33.4-canary.4+9dcf5f5f"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.4-canary.4_1632423955399_0.9740551308384662","host":"s3://npm-registry-packages"}},"2.33.4-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.33.4-canary.7","_id":"@apollosproject/data-connector-postgres@2.33.4-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"712ee0998cf9e6b7eb8153966cded182c2822385","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.4-canary.7.tgz","fileCount":334,"integrity":"sha512-UQEWC4ZmLC+Fly89R+/Pxb9Yj7BG9pfvhMSRcV+rLBjKtb8MrqGG3224lIxR0CcEhVG94gke4bjzPvOSMvTqJw==","signatures":[{"sig":"MEUCICqyBTl5SLXI7XEiVl7qCYPRsOw1ib3AM9ZPnLqp+Cr2AiEAn9x/j3SEATRFtj09X+EbacVGf6AOjtOWcg3zq75Eo9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1043998},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9108145640229ec74f7628efb5fc7b3b7b5c8fca","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.3","@apollosproject/server-core":"^2.33.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.4-canary.7_1632502071971_0.9189521108673453","host":"s3://npm-registry-packages"}},"2.33.4":{"name":"@apollosproject/data-connector-postgres","version":"2.33.4","_id":"@apollosproject/data-connector-postgres@2.33.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"770d99f40707156162592cf4ce7217f65625f209","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.4.tgz","fileCount":334,"integrity":"sha512-JMW+yOnyvs2aglNDktDgfUF7AtJAkbLIxpWAEsJ29e+VUj9No3CrmygpuFBvI5oMaS6VPW8iEMmirNxFYU6TTg==","signatures":[{"sig":"MEUCIB8zoLVc9tHl23cQkEWd0RL+sLgcNBhRcqy1sSd5FHymAiEAzrV/aX8yp/PC0Xn84PpN4wqBvOCm+JnLNTPHoKLn5nw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1044317},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"4834d95a80bc78986593c593c707ad45213e6c1a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.17.6","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.4","@apollosproject/server-core":"^2.33.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.4"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.4_1632749885376_0.9602447536796508","host":"s3://npm-registry-packages"}},"2.33.5-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.33.5-canary.7","_id":"@apollosproject/data-connector-postgres@2.33.5-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b618d5c7836af34f06511191a31b9c940e5f3a52","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.33.5-canary.7.tgz","fileCount":334,"integrity":"sha512-q4n738ihKR0oOdiKklYLgCklsDqfnTvDl4iyc8MTMRy7iLFjFOD05YfekpksDX243w1dcJDhwaXrSGY/RJZrqQ==","signatures":[{"sig":"MEYCIQDUVF+tSLBoD3c2VIuJvqGZf5f0OMGJbWtN4RvfhwL0gwIhAN0ZGCxnFNTmCKiPICvv6kJJF0qyuNIQGp7HSKvjz3Sb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1044588},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9f2fda16f77dfbdcf80834029020a774d9e7a8d2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.33.4","@apollosproject/server-core":"^2.33.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.33.4"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.33.5-canary.7_1633030346407_0.06277909738409893","host":"s3://npm-registry-packages"}},"2.34.0":{"name":"@apollosproject/data-connector-postgres","version":"2.34.0","_id":"@apollosproject/data-connector-postgres@2.34.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"aba55f68e5872ad873494a09b14a8951f6db5290","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.34.0.tgz","fileCount":334,"integrity":"sha512-M24mzDiWZt9G4CTjFV998ADoe/WThYeA4OEwPKYlDGV3KpsNqGpe9wJTmyfZsGbwnXxKcFhZWQNI2OhnXv2RuQ==","signatures":[{"sig":"MEQCIE0LIUCdvMhxGehq3s2t4QA1hUNqeoUjx3v9RUcV4IPxAiAWZM49B16UaTzQdHa3AtPF/D56gYOdVCu2huiZohbrhg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1044905},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"d9cb459ca58e1443bd1a609cc9900cec1ed738fb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.34.0","@apollosproject/server-core":"^2.34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.34.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.34.0_1633113396175_0.9209078345059258","host":"s3://npm-registry-packages"}},"2.34.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.34.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.34.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e8cb9ba5ecea2be1032e1166bdb8af2aac2839f0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.34.1-canary.0.tgz","fileCount":334,"integrity":"sha512-6KfqIryczTRdd+k0F2psKJ6R9iO8gMahY37AI9vneD8C6lMeE67T0KEDA6kwj7jNuWcLa5DG5SL517r3423wMg==","signatures":[{"sig":"MEYCIQDuT9sCBRrbPmlIhWtpokPU47ucuEl3EK2goMUU6g89jQIhAPUFQLrescxyQx+CsEYvSgHAy+9w/CBei0ypRX5RJIPJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1044959},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7d1d5f4eebb8cdf5a1c14d28181ea5fa06839ab6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.34.1-canary.0+7d1d5f4e","@apollosproject/server-core":"^2.34.1-canary.0+7d1d5f4e"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.34.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.34.1-canary.0_1633372257242_0.3641577752273317","host":"s3://npm-registry-packages"}},"2.35.0":{"name":"@apollosproject/data-connector-postgres","version":"2.35.0","_id":"@apollosproject/data-connector-postgres@2.35.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"48a9ce2a7a5eac964a906686aae7e5d0e9196e87","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.35.0.tgz","fileCount":334,"integrity":"sha512-7Jto8Zpg+dd+pFmjLZbSY+wfKWboeh7mLpII5OGrnLgjO4Jl7WwdhCnwb1SfZ+DGASdrDgoCiTkjgxc1Y06mog==","signatures":[{"sig":"MEUCIADl1qZZI9NFmTpAR/J30kiQrUAGf3WKJ5PvxJkG9m9FAiEAwE86HmSur5d5gv7CCM5urQlrccv0xQRQYAfiSjMgZVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045090},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"83a56a48dd28ff2a518947d293d3b763616cb4ad","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.35.0","@apollosproject/server-core":"^2.35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.35.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.35.0_1634046057028_0.4447505708238644","host":"s3://npm-registry-packages"}},"2.35.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.35.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.35.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ad406c83de5ee0da8167852539490b1a2d93c8e3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.35.1-canary.6.tgz","fileCount":334,"integrity":"sha512-856VIdVvFMEr6F+VFh3j83pprZy16GNp0Op1k/8w4uKqPuiaStajStYcTPRyrPvA7oKMiefun3gETdPdhfXGxw==","signatures":[{"sig":"MEUCIFKG1s+rmAmISqnLcgTG3iie9iIlvL9nFuY29ECiPPPuAiEA4u/kJtRHULHflxIIVQ8nqiTCKeD7h7zleGiRM2uXoaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045415},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"55cd1aeddea515b7688bd4d210133f4f668664fb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.35.0","@apollosproject/server-core":"^2.35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.35.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.35.1-canary.6_1634843427920_0.31776774091781057","host":"s3://npm-registry-packages"}},"2.36.0":{"name":"@apollosproject/data-connector-postgres","version":"2.36.0","_id":"@apollosproject/data-connector-postgres@2.36.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"eac98e74f237a3181dc2d8f392443abce41402b9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.0.tgz","fileCount":334,"integrity":"sha512-S6Eopb6ukunAnSjoTZPgDbLbvg3hhn/Q3zSOtKOMA4A/1FY08tqhyTXWTGIs9BpsoXH5nt26fCtTZFaijeDLLw==","signatures":[{"sig":"MEQCIHvaXH1DgzvZoNbM2qyQWcOXhSvKfc1nZasfJJsGt0GHAiBxwcKT63NaINhZA0hYFe3decf6n20zz9qnzOoJBEEfjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045737},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"df9ec6d30485eb3849f63a52cbb3a378722257e7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.0","@apollosproject/server-core":"^2.36.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.0_1634848320997_0.004847559846314242","host":"s3://npm-registry-packages"}},"2.36.1":{"name":"@apollosproject/data-connector-postgres","version":"2.36.1","_id":"@apollosproject/data-connector-postgres@2.36.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fc4b2ff3a4e75a7a1b1e286b93f45cdd1b124005","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.1.tgz","fileCount":334,"integrity":"sha512-oghoAVChYPVAoyWi4b9AGoMSpe+5WkmnXGIOiRCspajt73isC5bRrDeQ4+W/Xpmu405oK5S2q4rQtWVpKp6FOQ==","signatures":[{"sig":"MEYCIQCdE8m+hL5gua1zwycVClUbDz3IXQNj0oeP4r2iPaWRzQIhAIf8v4LstqxhpG1EU+q9iQd8xUwZGVDM5FRMskSzMY1b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045923},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"b7658365c67e3ad42f4aa53497bbe3e4b5fc07f5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.1","@apollosproject/server-core":"^2.36.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.1_1634936578313_0.41005141648341326","host":"s3://npm-registry-packages"}},"2.36.2-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.36.2-canary.2","_id":"@apollosproject/data-connector-postgres@2.36.2-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2d1fa463d4c418f6a4df7c9c463d24647e57b737","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.2-canary.2.tgz","fileCount":334,"integrity":"sha512-aPzdrwdh7LBz3q0Agv8lpCEMHRYrc492aEb7Xy/y+3yX3ub9V9H2CyWu46RmiBHI7uVd9Wa7M2pHBu0fmuNgGA==","signatures":[{"sig":"MEUCIB0hw6YWUl0e/xqZhBA9f3YWGJcpiBbq3iCyaeObCY/wAiEA2w+2B9iZzIPdPB7S8hJfyOpx3RjlKLTpJB41xys4KjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045514},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b87b764bd5dec616cc77b6469b72a2c0846795d0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.2-canary.2+b87b764b","@apollosproject/server-core":"^2.36.2-canary.2+b87b764b"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.2-canary.2_1635261450113_0.3230774809315413","host":"s3://npm-registry-packages"}},"2.36.2-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.36.2-canary.4","_id":"@apollosproject/data-connector-postgres@2.36.2-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6fe6f384b3bc7aaf643ddff51000282242ee9a1d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.2-canary.4.tgz","fileCount":334,"integrity":"sha512-z1pN3Xxtj7LsTfKEN45dPgT1wziPUtHM9CLFd3dE8yMOEKw2WEbJmEhwtxAqBWhJrqtTGVYcJBEkULw5j58sAw==","signatures":[{"sig":"MEUCICBsEGL6vAkXU/PZkTCuNeG/1D40fGZ/FqJ0PB4obI0PAiEAuj/rIO1tBETpz7cfMUayef2uPHpaDHGSf5XLo2l64DU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045622},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"223fc6e94fd55213a116e986743125ae8b72a61e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.1","@apollosproject/server-core":"^2.36.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.1"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.2-canary.4_1635349998569_0.6578586839847944","host":"s3://npm-registry-packages"}},"2.36.2":{"name":"@apollosproject/data-connector-postgres","version":"2.36.2","_id":"@apollosproject/data-connector-postgres@2.36.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c3c793354e7397566aef0ec7432781abbb93fb27","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.2.tgz","fileCount":334,"integrity":"sha512-Q9iCx2TEsf5C+hB8qh8nD3FQc4187B313jPkmwknHI9dNaMDEQCnWGX8Sz5Rw7IRYONSGuf636AEoSqYPrtgWg==","signatures":[{"sig":"MEUCIQDrH123NI35RKurOjt80MmW36oIGuzzWU0Yr3zFXy0JHQIgZHYhZtRzyLlsV9u8rAKGg7AzmCvX/A4/q3WIoNuIo5E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1045919},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"a35329246cfb0b03a5704d5cb0f743048e23cecc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.2","@apollosproject/server-core":"^2.36.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.2_1635382158406_0.00822901320798164","host":"s3://npm-registry-packages"}},"2.36.3-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.36.3-canary.0","_id":"@apollosproject/data-connector-postgres@2.36.3-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8b5c5e9e61f27c4644f19e370c9f5cd4082fa109","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.3-canary.0.tgz","fileCount":334,"integrity":"sha512-lr0emYLNgbiDdwUL0qxSlJKONps+qGVD/b3qJLrmfNGlQvNLm+mUXiQZ7sAONEcN5uMRwEFJHceUC2oQTU/aTA==","signatures":[{"sig":"MEUCIEtvfkNxdcp2YJECHW+YBHi5zVUvYgaOMpsuqflp4eRVAiEA/gx7moJgi8GZXqM5DbdCWHuaoGh7VkU99t35q5tuAeM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1046815},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"abc51a988e988053d8757a0808ca9a51d6d22724","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.3-canary.0+abc51a98","@apollosproject/server-core":"^2.36.3-canary.0+abc51a98"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.2"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.3-canary.0_1635514521156_0.8777696232096519","host":"s3://npm-registry-packages"}},"2.36.3":{"name":"@apollosproject/data-connector-postgres","version":"2.36.3","_id":"@apollosproject/data-connector-postgres@2.36.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"16b19cf2beb50ef712091b0f74b0330045185f9e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.3.tgz","fileCount":334,"integrity":"sha512-FmAGK4OhGFp1uHhq5MYXAT4HJ7m0Eba3z20KKd44oQ9KVLRd18ve40AmUXINaNyHf3B+c66OqJetz1TrnE4Tbg==","signatures":[{"sig":"MEQCIGlOqbw7PpoUHLI//H+N/EX33c6NNoWkPAdLpkVNcgUWAiAch2vRxsTKVemxBZKCykjvLH1vkyLRXxkpt4CvthPGiw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1047089},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"a8e2c47c65cd1aec8ce859720fa29c1e31cf4d5f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.3","@apollosproject/server-core":"^2.36.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.3_1635514595382_0.8713491672087377","host":"s3://npm-registry-packages"}},"2.36.4-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.36.4-canary.0","_id":"@apollosproject/data-connector-postgres@2.36.4-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"727ad0cb550e8b1a5e11683cddbfe5ea9a3c1ce1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.4-canary.0.tgz","fileCount":334,"integrity":"sha512-x+UGkY35whMITh77zbcdthbUzqIhwu0ZKzI+mmWh4LMl+YfjW3nS1RExEx7fjdEDXz1JudhlRmfWBEikT3hUeg==","signatures":[{"sig":"MEUCIQDHT+FoitACCw+CeEDQFER33H3gQs3h482dObtKAgrDrgIgSOkOkviOOG6d5kTVSNUVjzrihie2Vcj0MV28qGm6GWQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1049318},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cb9d94f8c89a46eda023d6ec3fe6d48ba695a618","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.4-canary.0+cb9d94f8","@apollosproject/server-core":"^2.36.4-canary.0+cb9d94f8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.4-canary.0_1636149401066_0.6358415651265843","host":"s3://npm-registry-packages"}},"2.36.4-canary.2":{"name":"@apollosproject/data-connector-postgres","version":"2.36.4-canary.2","_id":"@apollosproject/data-connector-postgres@2.36.4-canary.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9eddc55fbdcf779fb85a46b308b385ee268d92e0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.36.4-canary.2.tgz","fileCount":334,"integrity":"sha512-do7lL10N40lJuPcHp50Bg/xo9tFRjLW83bo1MBXPqg/OsFCCOo+zBqFkieNAQlZRWb/vhYAOxFdhvxogux1AxQ==","signatures":[{"sig":"MEQCIHXBlQyoRjEDR4Cp0bQQooCCXpQTlipeDO88He/dk3mLAiASbZ/Z740yRwUMkh8FUIiZ/dn9eguBVe0O8KEbUBcEIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1049418},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4259aa57e701708c83b3e9ae71e1641c0e6cc2fa","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.36.3","@apollosproject/server-core":"^2.36.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.36.3"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.36.4-canary.2_1636475196679_0.3820144937160215","host":"s3://npm-registry-packages"}},"2.37.0":{"name":"@apollosproject/data-connector-postgres","version":"2.37.0","_id":"@apollosproject/data-connector-postgres@2.37.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"157fa755ac3fbce6c8dc7f6dbc5506ba2600fd97","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.37.0.tgz","fileCount":334,"integrity":"sha512-kHnjmuallSgOjLFmgcHRApF6J2ORQCFFQ5+iOkcNQin+oJ8KSwytRvePCTCpvPDACYeOKCtvODeKGrgcHmXPAA==","signatures":[{"sig":"MEUCICE8rLsGmz7xpGO23B/4Lvn7WvDI52GOxMv0IV7Y7xOTAiEAhUyqYa96qjb6aPGwYyvHixZT0dBZISh+hjwtFRJ/1SA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1049968},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"19824a4935ded21c9623390e91ca308f2ce4c18a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.37.0","@apollosproject/server-core":"^2.37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.37.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.37.0_1636737641717_0.522415382266036","host":"s3://npm-registry-packages"}},"2.37.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.37.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.37.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"37f255a66e8ab121d2787146dcfa0fdbffeef3c7","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.37.1-canary.1.tgz","fileCount":334,"integrity":"sha512-xbmEgTvQc1PVYZt8zz0e2nRTjJAVhwyDWGivrHnsgAE1PxM/Bml/qcCt5ksfVWoAsxNXJ0T20VpW74sJtdWsAA==","signatures":[{"sig":"MEUCIAeLm0GzzhwumvWCWpFSQHhGkNkxeGWWrLn50bIaebdpAiEA0p/w/EObBTmVe7pv2QUZq+aZzl+27YyviJ3tyCN8VI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1050218},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e2abdcc28f8a156b9f803d623c167da721c97009","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.37.0","@apollosproject/server-core":"^2.37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.37.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.37.1-canary.1_1636985019558_0.4106808766136083","host":"s3://npm-registry-packages"}},"2.38.0":{"name":"@apollosproject/data-connector-postgres","version":"2.38.0","_id":"@apollosproject/data-connector-postgres@2.38.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bc97c818596291a7c017d27bcb8dd1a41862390f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.38.0.tgz","fileCount":334,"integrity":"sha512-wrDKUn+O5pfS0I39j5gsI/043Gb1R5UTkC80MjRYgGl1TwYpSdllyHLAg45Shli+MdfGbk9W0r9RBi2rQPpLgA==","signatures":[{"sig":"MEUCIHB4a0iLd0c6ZtGCExtHPCMJO+q5ufO8SJqoh4hMva/ZAiEAjy/3NfwS/CV8Au0Ecq814RlYYmi7x1U4gGGqfwP0smU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1050527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkpBtCRA9TVsSAnZWagAAMMsP/22BQKi4cZ2iDyt88Q/x\nVKlMUBZdR7R98Nd2VmhLhsOEYvPojgKmQsZ+zyCzvOIfRTVlJ6mQ9mzLdBK+\nvhkvCleACidXQ3pjpteBA9UwSItWL4GvOz+XEktDcBsaK9sFZl4cZgCJo1NR\nEfhI9lgAxJ/1C/GxsqB+TqnaUNjKtb02JpO+RZXeF3+g3lEbK7XV+mZuif5I\na2LUf9mWPi7Gx9/PN5CH/TyZm4WTCThasoI13qs0a2KjOTnc3LagppzNtag+\nSKURq72ErBAtuZgcEVeEJVU627dubEQKCV+rXzAlSWlCZF4cCXHStqGo/UYS\njR7O5fKeK8yMCDqkCBlCFL31ZD0ZjiqgZnLN7cmHZyXHHA911bncqZat9Fg8\n1BgKbrFKJVaw1szGR8QvtbAfRNnfOTrZSigBaDA4GdZTEVb6Mj1qM8cwRRAw\nkZ+/6waSIe7LunZ4ONrdf2HZLdSb+o/8UEh0YhF3LeFThvToCXhH3upDYIfB\nj400UXfz8ejHUqD4bvxxHHTRM9Q/AC0lB0FnGP+e5dhQKiaF/KBdEUufo69L\nsqAJkSjTY8dG0V42cpmMscvoMJs2DYbvCpG4ilQ9dp3kcc+lw3LrE1WFT/Uj\nAFv0fmxjYtpjbZ4AxE6UCstT04E8UJ7iJAh5BH5rJb/GsRmOh6x3oD7OCnl+\nU7JN\r\n=QhsA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"e7821501be31b2501bafcc66f9910a43afb6f941","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.38.0","@apollosproject/server-core":"^2.38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.38.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.38.0_1636995181198_0.6184426126692173","host":"s3://npm-registry-packages"}},"2.38.1-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"2.38.1-canary.4","_id":"@apollosproject/data-connector-postgres@2.38.1-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"685b1fcd46299158dc07ed07e77d8f80717824bf","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.38.1-canary.4.tgz","fileCount":334,"integrity":"sha512-ofm1Cxx1keDYJk6DvRxIk6Y7WfJWg6K3LdqabyBA5FI/R4WdxOAeSv4YXfWcAoxgLQRFzyUvQ/w3ulEc45o5RQ==","signatures":[{"sig":"MEUCIEoS0f2h5VhTYAuL0Tjav7g96QgEMyEBfjXNjoRlJ3z8AiEA63EM+xL3ubtepN/vIMYq5AKsMFAEg6tK/T0U5thDO+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1054583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlB4kCRA9TVsSAnZWagAAmFMP+wW29AfOeOcQxB8AZgJT\n37Rfqpj8RZvDyu5m2ye/Afu/u9HDS0cTlQK1FkUx9Ruvt62eYG3bYIpZwglg\nPBKRAp1s9MOKuQP78Hnf5nZsa+5JgNAgEMzQOcfFxIlmeJIEsNvxYa91viQz\ne2da/mXbtiMzSWxuCbBYjMkvhsCVGy+ZX+6DmgbrAG9lh8daJEmG4hQKC4K9\nMbhdsFAj3PMgh9AY+yrZB6Psbo6WWKx8tMJmDSozjWKkMjoL6hEfQm39hXCz\ndt2oVvbuPAYQz6plD3CODqzh5R/C3eUbudRMHtxerlrSXm0ZyzKPerTsiCnD\n23NKzL3a+Ob1ns2Sk3892O0fqIknl3qtXirNVjQyeCpn636A6MI8DWsJnbbh\nWG6nSI/cHjLBOiLm377SepRrNpBX4HOf76lz772hiAoq04HbwYh/r6aR/QM6\n2RO5NFdBjRrDtvCvG45z4o9rtYcrJIt4HQpAzNRM6jeiP7MFnE6j5fYJwNE8\nQPtmkhorXjrsMC2rP916fP5G3QpReGDEJIBXsGwBQwDylatfKBWITRwYMClk\nSM5NpuYAr+iXySX6neheBVbGJtjMn34uedwYcPJzoKAhnx8esqZC2EIccFlk\nBqf31+v3w0+tflVC2iAZU16YtHRwHfvGNHr1P751//OM0E9hss+bTxObHcKd\nf2fq\r\n=zJR1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3c6a875d745105af027901623bed2e483e565da1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.38.1-canary.4+3c6a875d","@apollosproject/server-core":"^2.38.1-canary.4+3c6a875d"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.38.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.38.1-canary.4_1637096996666_0.860226379890253","host":"s3://npm-registry-packages"}},"2.38.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.38.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.38.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"eea455719af99e0d009e4391828dc14b86b68c11","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.38.1-canary.5.tgz","fileCount":334,"integrity":"sha512-IcnNLPOPa3+9EJ/2DueAFuoJvUB6dYNDIvC8N0AOSNyI2CCzuLnqQUy0s/3wmAIJ49oWwDDvDbiLjYxZpdXJuQ==","signatures":[{"sig":"MEYCIQD+6LklXqq/zL+NGata3y578CNyQUjoxX7JNGDNGCioXAIhAMwX4cyQqcRLnKDnmpD+efWsU41F9HqPWllKQ/MCJP1P","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1054583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlF6gCRA9TVsSAnZWagAA3zAP/Rvkbz2oazrniQmB9FwV\nfnAyRLB9RfSvQIN+hFQjfNhh8ZdAtEsgvMQqD8QX1rVJUwtkLv6j033ObXih\nUdpxdlTUL8Ljbfoi9KTYsXLoz0uUzB+4ii7V829/9xSEi1qlhAlvFe3b1rrI\nQW3E4RfOfDyAahgIjUA5+Lm8tI2iC2kwwdBK9bEYuY73EsXvlDR/ZN8xEczi\nITqLsHEUW2adHH4Wba5uupJsUUWzPsFSvyJhgCyYIvnZDMB/P7M5PZxkcgzF\na2WAegARp43kjcfdFP7Y6mdT/06fDXG37jL2ptRd0aWYH9kr7/ahSIezTCV/\n2aUHYpJKEP+NtZWnIvY8JqDR5QeY3jjS5oXDunvTTgDvBGzrfBYQmCc4s2tJ\nh1h+Ihjf2VYiN3loA6qvp66KUW+qbggNbUtymXqJSisFe6mwqY99S38L3jzi\nLLZ9BHgNdnepYG1WNjNwpadrsXaXtPLngQxSCgf0+JvUHqr3Kw94Fsp8NgXt\noUorJQyc9hqagwd8pzLAXxmBuUoNxvgevCnY3d+ZzzOplqKe41BtCCYdPbj1\n8soorLQb8l/A2gP5L47kFdoVqRwYoh0IfgVNs9TUZt/B9Tl3UYHxSaC1QBwu\n7ZTybmgl0NGmU00vSzd6vg+2kR4mlz8yChWboI6Sm6S8XJ4PID5MzXiJZu66\nMill\r\n=390/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"61dc1aed4eb986a76b4e1ab5282ab9953f6ec2ed","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.38.1-canary.5+61dc1aed","@apollosproject/server-core":"^2.38.1-canary.5+61dc1aed"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.38.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.38.1-canary.5_1637113504604_0.37259958191811626","host":"s3://npm-registry-packages"}},"2.38.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.38.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.38.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3db30a9c1f037a27b63b84675d93b666856c4b21","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.38.1-canary.8.tgz","fileCount":334,"integrity":"sha512-ondNkYq6osYlF7HPTfbjgmpQ97GWJJuWPeZNeRpCNprjxytltbH59xO6ahzZY3EDLQJwVQ3+saDHiI8g8QTjUw==","signatures":[{"sig":"MEUCIAYSJ6nNbcwFVJVh4MQ6OFSQyRxsj7nlQRGp0K1B+uZiAiEA2wue3zZSG3deIW1y5hMHk4v7Vy/voHvUh8+FcSxWE9U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1054615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm9tJCRA9TVsSAnZWagAAqEEP/3vgxnL9yMygiEM7yFM+\n+0ON8kGw3RZ5sXwEQ3hKlZRZMMpZ7IHr3eStUNx+LRzLakO9uREik81D7xm8\nU5JcH0FAUUYeg215+INWtDy2F5EtInx/7xdce3XIBumz2S2GK1wGlk5qqFCI\nB3N1RjWZkXxMhmRvZj2IcxTs6y4zK9E51lNGR96oVlfg6jE9aSH5u4zcpj13\n3Ub2YNdv9MJ0Yq22nw4v6x3ae5RMkL4zUeeM1GXyGUhIbujeDrETO74gYx20\nXPX9xF+sXH461d0wnbc+zMX6pCK4L91BKH3gCW+2TvCqvo7DnZwyZGhxACNz\nko5GfuEHyUQKmN9YkBU7ZxG2kBEJ2IePWxZUnVkvzcVCafBEiC9P7shJEntN\nmMZMQYXq9oWG7trUF/MRf+lKC4F3F9ihFRJqBLtFdFeIr0lnCQtkEBDB1+hN\n1+twxZW/ydmDLpvjsr3mArtgods6WgZJTi1kBonycUOpB6FIHObe0cc7P/6E\nKcud0QGJQu1b4iB43A4t9bo120XK0A2QIfCrVNQWJX1vsfVNQIEdUMgLr1zW\nUZQUd1fxVMt9lP9J0Wrknj3uwuWmo6WwSDst2EhYCKkPVELhFvOOu4NVKz/M\nxUTHJRCYgjAd+vkNaYykTjl62k+bvYOC3l1bKDuPwNS0lVSRd7YNIgR3EhaE\nziRZ\r\n=6jer\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f0fece8c6a963152fa53e4d419b6bd2e7dd2f77e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.38.0","@apollosproject/server-core":"^2.38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.38.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.38.1-canary.8_1637604169156_0.15023634569179678","host":"s3://npm-registry-packages"}},"2.39.0":{"name":"@apollosproject/data-connector-postgres","version":"2.39.0","_id":"@apollosproject/data-connector-postgres@2.39.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"39398ca85220f0d9ed339d4b05c6740e14aaf825","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.0.tgz","fileCount":334,"integrity":"sha512-T2f1ipO22WBajy/y2u0LFpiipLnR8AaTAL6EwIkSoKcfSmk/XDLPaIFFbOeSyGHXrGyIUklGcRjCoCTJ12+Ntg==","signatures":[{"sig":"MEQCIAJ8CgZPJDAYCCeHYxKbs2ksYGLishQ4t2EynVAEf0HhAiA8TFDXyoTGqCCLG51V5db5IWVdXlp7tdqDG2f7X9PvHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1054919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm/J7CRA9TVsSAnZWagAAMA0P/jU0FodTX56CoRiqB3bO\nsd+Szwq/bxxVB4iJfFn94uhPR3q4MqKgWQ+M8DnPmwYeZxteTAcSgylb9ZLV\ndl41l0Pz6h4uoYpaeGUttp+E0ofLeY+gjRe3j9MMqfuaFFwJtI+bndDIHEg9\nSY5XAdm3Cq+7qVuospJQhkn1nbMl3ki9Ah3yeA+pex+YfFE/W4li2UtD0Izl\nuqWl5tsztfj+H9Oq1VmUikzmMPgtrDiQ4sSChWlGQxmwUSPxIrfp6xX1PrYj\nxvjiHjkrMJyi3T6ybLRpywoE21aWiMEfrkiFhTByH5gpyy8gPJ+os4jhBQa6\nwpi1X+5mONcgL6CULtZG8OsxmqNJ9t4i//V2/jvwY5P0j6APn/KGjsKDg27J\ne4JrUQrJ16AJyVeHSgHt7DM0c7ZUiPGLyOmcH7Sew3dMLWfvoEkrwQ4XnyH8\nRXxOjuH+4PYeoQyhk0SXdRvmBTWP/hW5suDUlrSs9W1jKv9u0OY6xRYt86QH\nsGKm9Lu1vVOBlOXzt5mpP9Ie3d7HSpLXL62pw4yzlwctAVRCTglpol2gCXH1\n8vZhClK/nJV/TNquX+zYlKYZGaLLeRy4DJAxZL1D4pzfIGxIUojiwYLcakqW\nvaT06RNH1Ae7COi7C+wl5DQyTwMvJeTfv/JZeRpj/6cRUiXMSGh9AT1jrc1U\nBtnk\r\n=kszc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"7ddc8796e4e8b0161ef7eb44762021b57d01c592","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.0_1637610107651_0.39307081825593104","host":"s3://npm-registry-packages"}},"2.39.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6f01840c6db9d4746346c780dcf9872835007456","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.1.tgz","fileCount":334,"integrity":"sha512-ZZhoUPyNyCE4Z2ta+moiLxu8UBiQs7HXLn0UbNXGTuD8X6RNFArdc6pCxss4skEyA2qOkTWC7ZKUcNHjOZMdrA==","signatures":[{"sig":"MEUCIAnKmxEa3PaawwurTNUYuPKpsKwmNmRGhL/MFgYjAOwWAiEAnKJRXd6Y/qGC66Xs3We7ylNvjrJ4tkIRoXpDgr4wwBA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1054973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpUhXCRA9TVsSAnZWagAAqbcP/j5i3EYrSBjtkECE6/A7\noCLeUCCr9CQ7fDnjkt1fUd53I5Qx38V0Yl50S/+krJDNR+0+PCZaJyu4CaXJ\nLp40uWyHnStXNt2HdnAXGypoq4EUsuxU/0HK9Ke0tBHnVW4aPEYyPhV5CPoI\n0tgueTmBeoh2pdjuMEtf8GXZH5MlNmhu6PAIVVykRuH4KRsGy/6cQtPXEyB+\n5zrG3EEk9np+hKT6S9UPmZc1LCCdLH8PSWznwd3varfQjVH+ky+XSgjzoV65\nJO5QZH9wdwX1VDqCY2J25P3rWF7aqkx0fYYJ7SH8TzsW14UTUu8csj6aGBv7\nIbEZEjcHJj6NaIttkfzm1BCj+V3qJSpsbvAtMtNB5oneF/HbTdn7sF/eCwn0\ncEXzYVnlUGtSfTLuES4QgCHTGUxRh8/w+dnAeM/M3ShlMbS8/5wf8ExX0Ko2\nw3/at8KbEjQRWTQZ3LOrnvEZgfiCFxoSZWNPgusM66VOXStk+xHcWux6w9XJ\nxaHS8HBKF9ua9t2rGufxO4OeKuyFhkAptRYdwC5yfl/htl/yULXqywVBthVe\nRIOLXqTrNGcpjF4czREKZhCIn4PJmtBq9pD3ONgkU+BUZnS4ISJE00eBrwBL\nXudB2xH6BMZf4fQR9LYHf9csschs3QcX7JwO44EwalwIMfjaxA5d3334Uyrq\nOBE2\r\n=A0R0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d36d29a92b717eb4c6502604be9c44f60cbbbda6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.1-canary.1+d36d29a9","@apollosproject/server-core":"^2.39.1-canary.1+d36d29a9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.1_1638221910735_0.26440352088709473","host":"s3://npm-registry-packages"}},"2.39.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b26e8cad24d10713329060013925d3c2b9b2a837","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.3.tgz","fileCount":334,"integrity":"sha512-64GOR3WanA0ctouZpIz4PQ5RRRE7i2YTMJATFKF5O85IogscpLg/7m0e/qKB1xPE/VnXWbh/b0GCQRzeRSfL3g==","signatures":[{"sig":"MEYCIQD4PbEuzlXmP6NKLMXAUddCFmQgtAys8lkVMo5STwehSQIhAP8e5Gel+bokY7YD2AZ6dVlYtPikmlbpGztSCF/SLcBF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1055938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpivhCRA9TVsSAnZWagAA/PQP/j2edmRJe5/vXTyz8joc\nB5zu9WjHN8yLssnTZ7dw56czad8zzf/OyxKfEBxW6K4CLbIlqYcl6Ydhw3o6\nqAZs8W4FZiM8RqEnK6Ml6if4QJFFnlA2bsqbaWwZb1UXNnO0pJpZlk5b+9XF\ngzaAHBF14PVxfzPdiqTCPCafV7QjzJ+Spl+hupUN1CDZArdj3s/vVyaIqZNI\nXax9eYweffPmDt4WdQogey94U8NLTM3S4XutkQvDyfgCbmjr8niUjAyd3Jwh\nVtOd0Ag3bGxy90/scC8Irs7dpozeiSA6hYLIaymXVmFXMRZM8Um7J6kX2lWh\nU9SLfqiITShHZKt+R1suh0Y8RrpBN9l9a2+LM8ZIK9eQM/fZeprhSQmjz9Gy\n4KXBTsQJd6bbwvqKdw+eLX2VA5fSo2BzzNwkYQytZBcfug1Hxmd6DUYkOfwV\nEZL8ugjP3UuWoomUXEFY9e+qTeHMfBE+SvIEMSwIDckpFjcdOzQJwvoJalnc\nwfBHuzX1czFrUJohu3ylXFz0eK7kkbqkyb9eFV2ecB4z2SBcmr8rGkH0Ku7X\nrUXdn96xDRuGk92KDB33pEaLsYjFchAk8SyyeObNaVbvjOAweCz1JvSbgUfH\nUpT7Wxwzoxdcx4C9Ajk8eEhufW9did0S4GEIhcAtTh9/E7/yWY1d5Gs4G9U9\nfQB1\r\n=GOhZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"fb2b024362538c7dba2ff9eed009e34eb6aab3c1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.3_1638280161733_0.8925856628262765","host":"s3://npm-registry-packages"}},"2.39.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"21186c1241beeda5b4cf77804076e6712c8ec83a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.5.tgz","fileCount":346,"integrity":"sha512-BMcqV9/XDfSbHKCox2vd4aQEoACFBCnA6PaBtR0mEsjDSC3frF5vYZyihUADEr1VC7ZuWMiSjLe2hS/fvJSpcg==","signatures":[{"sig":"MEUCIQC4Y/NqYBcJ6LZytaltQRXGLCZAqCmAG0BldFyoRonsVAIgQgLhkae87qNHhlqlk3V6zWdqmD7YyDht0vnEYNFLTc8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1076956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpoJ0CRA9TVsSAnZWagAA4JMQAKCQESDwFO8xoVtLrUZE\n5G4eKqjY1pf0ouk3SWl46kU9jZsoTc+LLeX5ZErkK1LBsKyO7BqiZlAzEj2S\nKS9MrkLD33TPnqoe2kE2SjY+Tx2GWl2/nJgdBKFEPznvKqUC4mK1HCkePUNy\n9GkdKwzjflndB8VKPqlx1ZjfDgXU4yjFmW9A64Z1anrUgQN8TMrRXq/eETST\nVUBwt7y89C9lQn+pPssWNwKD+gNm2giiKmkCJiMAdmmiKqCABJt3V41PdAQZ\n7OzsxnYwoOReNd05iTNhbpY6kJtTlAa0N6Yd41ER+7u6Ylu4/1p6IGEWZCTy\nHkp09Gne8CucaX4/FO3BCQDSr2DO9DU1Si+d5LitdVAy6133/noeW0pGEcV+\nFdLYAhPPX3/uDp6OIs0w33RAuEVc0QUYjqrvj/5n0wWSRzr9ve9WjaEljosw\nR2NegTRU4sFFAlVjgoJ+yTxb4wF2RBfXSZGYowwpXbk1LCKdFTTLY1ufY5nm\nspN+gxdRXx6zf0zNnddaBnUN/3MpTP0NGBZ1n7wsyW8lSZ/mrbbhFvwkAeZa\nI2vnzan+ZaEmkuQdiPLqlFeC40DfA/86h+AAD98wN6PafFIEiv+77upBxtz2\n8LoiC0gc6RiRKoazpvIHJTbLj1uK11R7ZV+uEp1kUCSXOXDbNfb9Fg2cF+gb\nQodx\r\n=4Ra+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6e76162578804cf792eb73f926ef2b62ddf0665b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.5_1638302324222_0.825407017461244","host":"s3://npm-registry-packages"}},"2.39.1-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.6","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"91c0c3de7fa51c0df78394d3d9d6426a8ffdb9ac","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.6.tgz","fileCount":346,"integrity":"sha512-JJcMqWPpH/0W68tSCYClBq8bOEv7OjFJxK1Y3ei6nAVsW1WKO5/7CIWtSr3GEKrjQ3odS0dyXboUAKhHw1BO4Q==","signatures":[{"sig":"MEUCIG73RWwYpB3Y5M/pEi3m/S4di/5UcZCp+r1RjEIKqP4xAiEArZzLjnDiWdtC2ri1jye5/3svRh6OM8OO3C4MzXjMjX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1083815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpokJCRA9TVsSAnZWagAAxKUP/3MrOc1XGhKvUuJv+7GQ\nUV8HmU6TKLqTosTUdcn6tRJ1OqaHL1tRlMgPg7lIbcnsAWfaHyIPA9hkx8Qz\nf0kojY3QjWog+kVD9meT/sVgijHnsJYzaJLkSPrnBetq4oKDRXcTuuJ1zDm1\nGx8eBZlHNY5BRyQXDyG70OwvsBQi2mf+ys6mnjeMn7LHiihmpDukvkc1ke4B\nTiU6OnapIgZInBDgbE8FA3gzr+7D111iVz8z5Y0DOJPV1LXB+jSrY0/7pBkE\nlyoUt0Smzq+gHVdceEOJDYxXRzIWrrfxgRf9giCkb6yt5ghROzS39A+sXcvJ\nqoxulHguj3PQXExBlXH8GgQa9bAi7zUlWWU1OSbr6LubJZ+94GOO8yGDZDrN\nfz9z1XTqewBQGbiVsriLc7f8WUl+hcjkYRPOvGrDWhiSoSnP3qD+STYjkTEF\nWUjKNVyFrh4kUXfTfYVhg2bJUdM2zwE+XRjSYwi32xLmG5k0gMx75EVZ2zX6\nwXj2y3myEK92Hjw7dGUZc0+m8hvFYpHc/JUriBWBmjQkSRhm8tE0rcFTMp/t\nuVgn8ojmIvFo5Z0EvPqkaTzDkl+HWKCc2uSqvWIdxsPuq9Q23dXxNMIbfuqF\nlh29lsG1TNrbICwzzvDU7lLVN10+v+FxyRIulO/c1L8XQr8VM6/qn7IDuJI8\nEpkd\r\n=JQcc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"aabea76e03909a242d2d56dc267ec9bc080e18dd","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.6_1638304008926_0.7159275990049112","host":"s3://npm-registry-packages"}},"2.39.1-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.7","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7c8b1cd39df1b4bf2a36819296dc817051878e81","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.7.tgz","fileCount":346,"integrity":"sha512-Lpp9x9DvosmL+gHhi8GvjidCWE6KoiWRpvl8djU+IaRMkw0+wOo+Vhdn7o8XDs8YB/kM5xV2LJcqCpuoEwoUCA==","signatures":[{"sig":"MEQCIGqZcObBfH55GdZGpE35DVDr9NBvEHvxFNx4agPR6/8ZAiAMd3x1PlJWdwnivlqpAYOdzHQMGIjUETKFM0MQ1P2xdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1083815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpo1ZCRA9TVsSAnZWagAA/NcP/0+uLKIFdy1dZW2LEqwV\ngWiXkWyltTzClRTU4jXhauHvNEHxfaonTNXv7rGzHoSFraHeL5RgxYob+CV8\nWMFhxMVOx3/zx4WUhf/JcXQh11GUbilhhJxsYDaB/kPwllETI5hdCnExVELl\n3NWjqFwO+CRJd1tKSmjR/xjSxRfQq3O6ekcU1UvcwoZpaE0rBAfSgxj8W1dn\ni9IbDJxQO7fr/FiPOK5v9y0vKoGm164EXlZrO7Ov45Ppmy9Vkj6zHSq8laeo\n7teeABBNcysPq56rEB1to6awjpOmYoz2i7g+dwmYAjVHrv47DlndVm/d0EoK\nbDaKhHohzLyKFsm5/dj7Ar6NV/EKEWYi5+GsSJlMiC1GmWmSfCjweSZF4wiJ\n49NR2jPOV058axyDscswqZ9ETIXlWkH204B080qcA9SRsJ+TQsokIWmKC3n/\nR+XlPpNxH7Iw1eox/YcXN8vaqSrEb6pzppRtSK50W9BsYvUYohJ3kwq9X/io\n7vZHL+cIbjBBA9dALtpTZwte8javaDAgoVWBwuHEtxCtNoAZSrRbTZYlsbuM\n3jDmGa520kkhFwXI63++f0ru/5Zzt7IRDzmR5drbeFODzrrcr4n9Zkee/4V5\nGkrvnVD9NT5g2sZoW1sKgwBCR1e4V6JXCKVl4pfmoyIMS/ox3IK+GFwOJ5iB\ndU+c\r\n=jQnK\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c0c620bb56f28d31d79b61b81b6c56f08ab0d13d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.7_1638305113604_0.557693435303459","host":"s3://npm-registry-packages"}},"2.39.1-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.9","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d0b88a3b8fa089dcd6959773d36214dd5cf4f4ed","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.9.tgz","fileCount":346,"integrity":"sha512-c4UgNRo+AJN10DBYuaagup0ApBD08frSgMPNMd5oGRO/9R7tqXfLi/GeS3KWvepMxEOTYfA0Hz54Gh0QgFvzcQ==","signatures":[{"sig":"MEUCIHNO0wxg7LZ6xlhP0fNgsb/dY+ivmxaK/tPhxtYVMgZ0AiEAhhXuEOxK2p1tUlOstnQ7OPi2AjzfXxB9YkUVppo5xyg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1083825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqnKSCRA9TVsSAnZWagAAQo0P/18rKpaznY92z0EKRvgF\nGvIABYMfya2Tgi6OeYxsA+kUT7VzefSgdXixStuBTrfzEGM3cdptXJwoc3gb\n6HyJEqBQf+q2Xr0XA+92GwFcJ6NJrMrYvI1zMKcPFDKUct6DjZDxplelu8D2\n7r4YJA8cHQXP8SJFsTeg9VqiwPC9pupjcHPIPwe+NOr/cWg1c5gce7yFuVa8\nuvtWFcpbMU0Uu0B6pWoX9AI2oOMj3ejWyMfcGeCI+iqw4DUPvcVihEs5cQIg\ne/wlF8JVYhTG/Ksp9ZUnT7L73vJH77ftJluDPRYRRUeDvgC6ffSRmbhVxb8x\ne46N74wp8oQopYv32CaNuMfMcewRgoQqe49B8XLmNcldr9P8yHcRkejCmVY/\nmOnHHbjE1pOzIzmiP35+ZdodQBKEu6M22Rt+Uo+g/N51oU98fvYcpawXUasn\nmGFZIb7yYiiGhUcUKFnOSGUXi6+M4H3jx3/ZRTc5IOqIS0GuEok+FtEQAd75\nC1M50nyHhuuSOVhE6oRF4lz3oFDxDZtqe4gFII+hBxmuR4sCEfxKZ/z3Nt3H\nHkplAXBCE3RnKihIPZQ6jhm+y7WLSRK01tqVX9KwKNAZy8Wb7MCQAWyiXos4\ntfvnKRJJT2SqZ5oEoI8NN30y1jv1zcfCmgp/O8w9yuwYUX3Spw3dnv3DSWd9\njzMP\r\n=OuhG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"47da84a3d9cd3681c6702a1f9aa8516532d5773d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.9_1638560402141_0.29729076011998656","host":"s3://npm-registry-packages"}},"2.39.1-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.10","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4414b9cf8adad7e8e7d05ee1cf4aad4d6d4cc729","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.10.tgz","fileCount":346,"integrity":"sha512-OromCoiNCaaA+GMQkxTKhqeDxQNzTD15vwzSsrZv1aQIvNF06q2aNjFDjz8TnXQJh0+GEm1KUsbcMMqd38aTQQ==","signatures":[{"sig":"MEYCIQDVLWP3xJ7t15AgJw/nvg/pZflyqdImsZ7jSq160jusawIhAPLrYJBBHSKDxZdFC34VhfoJXKhXB/lQKIj3R3jZl13t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1081969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqnafCRA9TVsSAnZWagAAnjoP/Rq1eV1ctUat0qFXrZOQ\n8g/Nicezu1W95IfYIiKPDW2DpKgGCCPVwgJ7UGXJbHnMA71DCxd2pvwy5Ikv\nCOgnDEetElApZl+1mb+rM5y47MgNETnypu5suY5JIXXymEZlZ3WU12WqghlZ\noIdAmTiwwN+Uh2ndJNzuRVy12qQHrPSunzcPYMlZXzWjxFq3RcI9t7wtF3CF\nqULM5BAV8HeAcnd614dHFh9YEB5UwWCQMViOotxET38D9+KAqPKyim2/jzfo\nb2vnaW2d4VITN8xkYWjAf6KeP0AzZA4b9TiTE+ZrbCp/8UDpbbjGubcZYYPc\n6fDvbO153HGfZlvi/9xcyJbvV7GpoeYGFbeLGo7XnANIaARtMrDdJCYTjSWN\n//q0Krvzy5ReeEMNFNvplH7iNTkttyAFu45jn6QfNoT7he00xaOkd3HnHsE7\nYhpG1/ukVNz1gCzRoDSyS+rWT3MfrqRe6NmOJf6BrzFxQztOzndg9e7Rupt+\njMjIIZN2UR/4ZUwJSJ8yPpaqgNaRwlw1gRcHAZ4zr/AsLvAAL/wtrK71Oou/\nN8hnpqNDvOW4xiXg+qwefIpA3CBY4dhqDvOiN/X39gLXo1sv+YCGj9dXSQDh\nZe3qxKruo2a2Xqt+xZCjAC/TmBdsnWPYkursXROgkRbM44b80wOvKIMPq4Q5\n8ibR\r\n=wees\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"19efb1231c3f851b0bc309a419c932481bf83d46","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.10_1638561439104_0.7460953365820611","host":"s3://npm-registry-packages"}},"2.39.1-canary.17":{"name":"@apollosproject/data-connector-postgres","version":"2.39.1-canary.17","_id":"@apollosproject/data-connector-postgres@2.39.1-canary.17","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"62e4f269035c85529e328e9f9813ea5e628ee9b3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.39.1-canary.17.tgz","fileCount":346,"integrity":"sha512-TLjHwvbl2dHQbr+GucW6YnYBA082w2xh4ZVa1WCfWsi/ZjBMjDuuSV2s6m3g5yVY5nA3C4YFTQJlOBOYOTAbaQ==","signatures":[{"sig":"MEUCIBdn5OJYr9d0PGCgdNhUcppOroAtjbeVZr2wcF69TZr7AiEAgZyzEj32u3KB4U0cKUIX/VBedvNfcvbYK0vD7dK3blM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1083258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrllhCRA9TVsSAnZWagAA1boQAIkyJAtt0l4zg0B5YmO0\nmFPiLmmGtIz4ekHsvgkew1V5Uko15ggUOPP7zqHV1hrgjEDwMCRI6MITzwYu\nOIxNdj5MxWUvwUF6VJexjdYHweSg6ZxYmLSwumOwzL29duWUToZMzrZ14q3x\ngF9J3j2PXa1/RgTythoUhitPETwocm93M/eSKjSVlISF4L4x6E7BN4dHRBIZ\ntzODh2cskARzgVNJ7+7gOjiouwpHHWDrcebuvzsWNBXW8i7fvUlchzT0MFh3\ntIwd4Ma7PLoep2876vea0NHOS8Gzs8GMuLLpgHttD1x8FF0fS/5RNVt3XYh0\nMTKQQyAxlY7L7mOUQJH2pQcU7lVij/pMXQC2VDNI3jUykHuuKSX0+5C1SPcN\ncRwuh1+ag8SAFaGSfWCLmrvIdcHJnnURnR/JhRQo1vhAHO01FpT4f8bErv/Q\nu2g6P5bw9MyA4tFviD9FdHTIesxbtXQO/KYuU9qo9OGECihWCTDFmYB+6aNm\nmJb0cA32JCQcWKzqm6NWbnw9+QP8Y8j8x96sGS6YTUUwzCoz02aFkRx15bX8\n0e/hzpQgdLd1Rf5LfOV7i1qxOomGXKrT5CLFM+uRGBBHb+KJ5wRDmFYPAXRs\nRlJQKUj1/Sb7699Cramrul4LUcjsztY/kySxEMHIdgAwi8X1uOiSiTHv4L5/\nc7jX\r\n=Az5o\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c5079ce9e599c12683c3e636e187763cd69da866","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.39.0","@apollosproject/server-core":"^2.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.39.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.39.1-canary.17_1638816096865_0.8385192051698436","host":"s3://npm-registry-packages"}},"2.40.0":{"name":"@apollosproject/data-connector-postgres","version":"2.40.0","_id":"@apollosproject/data-connector-postgres@2.40.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cfb2ec01a3676d47cb8ca6b4197668d9f34dbee3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.40.0.tgz","fileCount":346,"integrity":"sha512-r3PwMb0X05eZ6zlmpWaixLZq2C7Nbeh7QORCZw/iDm5LOt2DVqYDGGGI4UOMzv3REvhoXtI8+MvqcWOVqY82JA==","signatures":[{"sig":"MEUCIDm/GZt1Js+dyETuqjH0SZNBEw5/bEQw0QBDQ6/JiUWaAiEA/5tvlYHN58aoalKqgQ+tW4BBTIe1MXgGIuEiGpNzaM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1084236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrr8vCRA9TVsSAnZWagAArEoP+gLQ0iujOXFkpJ15OrKB\nVSJMwLGGuuD91o83xVx8wH6xGvJK0Ut72wsEnQOQ1NAVbA0cpOjStdKpjzsA\nS0T/dzDGai68fFcAox8szLx3vt85d7aIvzrWBaL4NblC9JAeSKRFhbvuTXTz\nOLc3TUUJ2rBewFU3bdDpBzxW68QEU1EttIO7hNnxiP2eKwfEmr9IRRgZVjC7\np1thk121fXVrLzDWB1K4e6Z2I531HZoBIEpDDa2JtGNz8bfaQVC/eudcfxMd\ngLhwv06fdKDGDxh2JAd8YqhcE8qWlDkRWrKUeAjod0vhxsUtBaK2GhrEVjkx\ntiaKvktOLoa3/kOv2vtyxKnTqfz0yQouGrpw8Gk5ozY2fqrFPXV0AW6GSDcU\nOgfUmAlhjUpD9dhZFisra3LMonazgA7aP5UNfkYgjkZi3O7ksQFcV+jgqoSd\n/kJyTA0Z3F+cBmuKNvkKPyRgJPX6OMZeqBw+/8Zyo1cwEm3Ps59ZxUuVvfnM\nrX5eSTwuDGTO/C14bo5VOTQL3X+fnwanpkxSxnTY0HbH22lrzuAhSUVxn3LJ\nmMgAS8Fmr7jEDHCpVQo17xcN0SSXaakgSlM4ZeBPtAfGS6yQaBp6gYpa9JXx\nvGNlhE2/uFPVqYvJEbLOXtSB8ruVBmjvHj/Gcj8QjL4MBQZv8jJ5cdfMj8WS\nLx5i\r\n=xXWs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"68762ec2d0da91490b88b0ab8d11a6d97ef7f81c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.40.0","@apollosproject/server-core":"^2.40.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.40.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.40.0_1638842159259_0.7187067645485041","host":"s3://npm-registry-packages"}},"2.40.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.40.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.40.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4216eff7a95eb992ad870ef86a9e63896e71ef51","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.40.1-canary.3.tgz","fileCount":346,"integrity":"sha512-EcCqfipC36f6C0TZy2fZzyzTufdpC6/msJGt3mBfhBXJiR0RDcmpriRie+GVlm3iz8BQ7ebSpjPtihbtg9aQnw==","signatures":[{"sig":"MEQCIG91qxUf3xMQFtU4ybypPtV1GaBL55w7Cia/yO8IF5O1AiATLGdVtF/zZ2FJ1M2RK+oYtsqfEsRgbujVK+8aa69LPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1084800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsQp6CRA9TVsSAnZWagAAisYQAJTQl05IVJDZBYdRq8vg\niF4h93Luju1HzIcLHryQm9ySRc1vIbD7LQ+tsCHmoSUjXxXmPyzxkdWUz3PR\nHvEXeWpVjeFn0sey0r+s8iUUS1mn3uNdeI9SNYMeUp351wRMkVNtsa7GAdsJ\ntdI5QgTx7cpGkvDwJIvjn4BgsOYtgeDbmTqUVM9CyWXMBzhiOj7GwXQvtoVp\nSxfbctWW/MjbVbpdV05xuYuwQzuvdsqelE8VCT1BuSpVO5sNDZQPS+nVVYcd\nhZYo0eU8iKxHw7AT4P+nHfHrsSNjJ02QH6PkaEVNjvxjM2ft+Umr1bG2gjuK\ncTA4eGGLutjv3Qv/qRWz2X5Mz591u8RzMwC2ZUja5/pLn+LxUmupdwTK+9Wv\nwKlrfU0UwvvxkIS6iDvP2k5Q6pLx3PJvVSjIb/RGU2YbY6lP8PkO/GuRe1W/\nybzDdpSKs4PWWGSaVyH459mHmhE7cDyqiWoBdH4EGXjAXfvMbaHkEFV4w0cD\n742/hRBSr7rWHjvfI97EOBty6UO5uxp41nMypDChN4jVQwLdF1qvUhngc4Hw\n8UbnZbub9T2c/9HkHNw/2B5vJRtskDxasUHtMFLitRy2p7mSHK6DLfVDxMEU\ngU57bihEC4JxLCUf2S3tGGC1yEpKpJt+7N4Dhkrz6tCaoJZVqV7aB8GohMjC\nJqA7\r\n=Pj3d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"449e87020cb28277a3fe95568d4f6964b4b835f0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.40.0","@apollosproject/server-core":"^2.40.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.40.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.40.1-canary.3_1638992505985_0.26634004731611527","host":"s3://npm-registry-packages"}},"2.41.0":{"name":"@apollosproject/data-connector-postgres","version":"2.41.0","_id":"@apollosproject/data-connector-postgres@2.41.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3d620695a1b94b9a1a8584bd0de5260d715155da","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.0.tgz","fileCount":346,"integrity":"sha512-nMWyvqLyDIO36KUy2JqW8gJfApywNYyLAgXAv8mS6nRJhc4u2gK0jHhgP68PLqGeGMNptM6sJQDRjmha4voheg==","signatures":[{"sig":"MEUCIQCMw/zTiReb5hX1mavysrWlJqyJ2v+zgMo9WZUwYcj4cgIgD3PP5hmE/Q2oir5JpOmjRvjf40+dkZuEM8/KADYSRnw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1085104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs4hwCRA9TVsSAnZWagAAc/UP/RvjcC6T+UeQr3EHRDVx\nN6T+sDR3/hgIjIkvVfmZ3ath4Fot8GeFI3Ehu+kqILIt0pAuTEd2Z34wc5UO\nvtc4+fjERUX6brFi5AkD3pC9dClPOTA+4Si5OvxOgDwBRYHwitgxK/OLLbhh\nLf6CdPQGWtAXyR0NLq/7SR2yZX3c53e5RBqBQcQ1sXRc9YtMfecAptEluRDN\nWGDERWtDQapsWTT7S3AH0bq86k9zSs6WxnylMh2XC7ucVe3ZQlsNXt03o86y\nYTmoGtBT6CkmKWOThTTahdhrM6iFaFfksEKA3P/i1cV2WacfhSxbRdtScJm0\nELIuT20i7UTp9k/V4c3EqN6CXEiI9zypFIO0bv3T3dFI+0bvwA+5/cKRrqZx\ng/vUyRfhH7M8kIawdjGP2zG3/Hd4a+zJ9/3qCdAaoj1Rb2I5MK6jb1m9YzlD\nl55DjqhKnsV/F/7c+JzqnUeqEGOlx5CwjPWEFFi0yWg4CjLtJSPXR5qaqWWz\ntc3bDBRKdYLRVXyqV/iQLutAId9D15FCWSrxwWqWXG4JqppW5K2yVvuGrXz/\njoBTXLBrNbjg2C0oYdOFTwQBJKrNADo12LxxHuCh4nbpDH8THHnzd+IZ4pnD\nW2wwk4RtUYyeFACTyhgJMvXZ95EZRXsSGW2tLY7abv01asvOnctHuv5Hvbzd\ncOgI\r\n=S3xN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"9392677975a0aaa8f8af6d391a52ed0198c892af","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.0","@apollosproject/server-core":"^2.41.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.0_1639155824300_0.6634108537018342","host":"s3://npm-registry-packages"}},"2.41.1-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.3","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3575637eef55e73047ead1017176be07ad731cdb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.3.tgz","fileCount":348,"integrity":"sha512-5eZlC1+Wtb60RQuQup4EXSjcZEcs92qQazaS0ZeLhE3hs1AK14FEVxIGBp6t6VPDqxauH/lZqZ8592AmscYiUw==","signatures":[{"sig":"MEUCIDrxHei1AZRTVqLJIxPrRkPaKt9H4p1p5hfVooJISdqoAiEAiaow40fSvn/FiujjJgP0l+a+HSQke7TvXuRSay6uyXE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwLCcCRA9TVsSAnZWagAAHygP/3f5GGGEtuPj4uLqyc2s\nfKOCC+F7DjIVbqCXa+PCncWvr00GxDquDRn6fB2oSwn5NFHfamIhrxvjeZ9b\nO6UXcT8O+IKveEhqXhklWn8V2fFpYO5DCAbLvQVqXKE8SGgurOl0H65ML+JX\njkPS9apFkEbT90Vh7cNP2hRIhyyjEg2EUqI3eDW1wN1d6ov44m8WFBOz1XYo\n7TuDgSg4F95swWFRfFYlfArV9uQdYgM99HpQ3GsYf+3soW65xJ6U1BmS8Thc\nNX4qIQ2zAiVPYGxE3xs/0L4u/LxMpxAM6xcAKKJ1583gpl9xyKvmjG6x/gY5\nDmjSJXWJ7OC0ffGDY9YSEU28FWC0keBRS1tR7/3QVAojzyOBpmSaQ4qC5HR7\nMvOxHtz8qv+AJ5XOFZwON4cb8KQCZuPamTd/NmvFlBpEbAOT5anpMfX1ooKk\njsWCpiqHyUddQBF6S/wFmzxrsXARcs0AdeQjeCjNub6hXH4++laNYtnNn20g\na2jnFS3DeiAzYYKkezr5pZQsEVWvHBHYZ2g8hqqO4VxRvenVcU9lukCzIqbI\nrdPnrp0hhmq07k40N65+h3G9i/X0YUdchP7VvoWthbwFAieRjcx4EiqVTIjw\n++HvDq8p/1GFg1stCeTrjzSakZLv4W6wZn21opk1PeMIxp10TqxX1p5KTqDY\nzYGt\r\n=M44D\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f225756d4359df00abac5e724708199e9caf7540","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.1-canary.3+f225756d","@apollosproject/server-core":"^2.41.1-canary.3+f225756d"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.3_1640018075871_0.6676190371269861","host":"s3://npm-registry-packages"}},"2.41.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9a06df795db5243154d8e3d487e59257dc32a2e6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.5.tgz","fileCount":348,"integrity":"sha512-iEbjkGtWkmf1xOSIuk8TvpguJilqRnSrtyC1xVH/kH7SLfmr1QwmnSCIMEJa2ZXBe0aSwt5QBCVl0UAR0GdVQA==","signatures":[{"sig":"MEUCIGMj12oasEhYcz2ApbryEsWV8ZQyHsyFO8gAjauRqsQrAiEA4FTF8z4NGV/HNmAF32yY0IxvGAu2IcDzHKc3gNt6I4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhw3maCRA9TVsSAnZWagAAmZ4P/0GCJ+N/RKggoI1bxyAw\n1ej6KfGh3eR+LgGrHdJ2ylEnKPBj7yk4jovMYtbHU4fLStZpKyGr5HcRfwVl\n8dpkSH1bqhGEk435TDBSmyv80A6nVOvh+RW5xexF2qz1XQQyRB3v2sh2Avls\nYKiZuCNDI4XfNyed6Z5sCV9jp8IcRgmiQ16pR1YZjmRc6XfyAj0Uj/u5KRd2\ncEM7wBUkFloYu8XuR1paSKTlb9SeQxaLOFRjZ72VZlpjkBOx12ncVjn4F6lo\nxqE2y5j/Ava1JOb1fwz+Yi1jovtuzG5YxA/0FKEt5JrMZRJspHg1+NCGPreD\nnvbcsEsxIEZojR4vc+AW+WHGRwFdONIMIf1qVY1+lTDCz4Bh+n7mK/C0tgYD\nT0m8oPmm7sWw3PZwT7GxPoEW4RPYyJarCM/qCT8MRR7j8WxbDJrXfY60AldC\nlzJyUBl8n4bXtrgfJW2GDazE5ZrPRd4NJzP3b8JmFRbP78tgI5tiWrl9eHCT\nVuB7jOI+JwdVm/aZBod6fn7enav6okA5XW+kvrxnXPWEw1f+QvtPAvgZIod+\nwYLTt00YWjjgiAxchk8fl9QfPCRbyYwcUgi3ApNCHPUrAwU86/wlgNuTMsk+\nlelG2OokW6akLs3pnNrUNVhJ+/xBhmTmMjV+AbRRBUQIX1CA9o9GVYg/QnIe\nXcPt\r\n=k9Io\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e090c9261b3cfc4430f8068836b4648812acef91","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.1-canary.5+e090c926","@apollosproject/server-core":"^2.41.1-canary.5+e090c926"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.5_1640200602040_0.9891373042044567","host":"s3://npm-registry-packages"}},"2.41.1-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.8","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7063551ffce0a0880cc2d46fc8ad63bee721f9e7","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.8.tgz","fileCount":348,"integrity":"sha512-aR5XVpKrgX970ft6QOuYTVO9JWRvLDByb/5Zuh/gsuv5r3dcMtL/WZI48BmQYOosQTYzP7m4u3glz55qk2YTPw==","signatures":[{"sig":"MEQCIF2EPDIfL+NrqaPzY/7ObmnigQgeeqrjaKmMgd9RgQobAiBT9k9gM1Mv/ZCFtCnjT5Dx3JOR/l624NHQOYWF/1ucrQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh00FLCRA9TVsSAnZWagAAPGkP+QCEpouLuC4QnoWMoQmW\nLnDZSaKIDI3X6lw0eIj7jbIhZGukeANbyOu7aSiYOvkjxlbIUXIjjenWMZB1\n54DCCNhWvC85oMMTKBsGmIDoGAGBLLiCam7GDgC4P1l+3LyGEUr3ye4Fkj5N\nUWWAOrAVsAZu4N5M6l6qQ8RwUovc5M96wdmS6MhRfFU7AQPgEn1Qsk1dJBY6\nHhXSJbhPVW3kl4+vFj3hBIizwOOqnxeA6/ctz0tSAdG6Wby80kVMKoWC9Cuq\naysCorageaEwe1QGSw6rKXh0orjQ8CrivbPDEB5b6SFjJPe34TbKrghcK3ts\nQAvvGS9qvcNWaq0llDA1ue4DGuSTTWfCcioS0Xwx4EOwjGO6fBIVqcy1a/E+\ngpHpme3SNWIUvhS2uQwVTVlNAMayrS9swGhhlohmZJvt/F4BlqcRoZroNEwh\nGaySW1pXKYkvbaC0SNkNPPPPp2E7SwY4Jn+Bjyu5S7AH1AMWuy54bgx8OwiV\nDui19H/N7iKaniF2i0OWQCajeqSFjzbXcGhXdg4MH7/2l1NEo6AzJCAzHF4X\nX2IdkdkIzQ2tMsx/xWMeOUDxW3b9LGg/3g/kgMP4pWqTHqbqoKLTA7Aex4aj\nkBrCuC+YS5x38ro4y1aCEqDSS4MBElB4x0g+Hxx0eLwZAP+876qLBq5YBYqw\nSHUv\r\n=3VRt\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c0260a3f306948787d311d0e67c0fce12a3f30a1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.0","@apollosproject/server-core":"^2.41.1-canary.8+c0260a3f"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.8_1641234763824_0.9515498873770514","host":"s3://npm-registry-packages"}},"2.41.1-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.9","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cf912cfd6f8f55a5f159fc4de9269018165789db","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.9.tgz","fileCount":348,"integrity":"sha512-5iKU1Qp9NyOeWADI3KxiyeCyEQMalXGGVqM1GrZe9ak5hVHrzX1Jt+Oh/d8vExojICJYsdS+261LynflPVCqOg==","signatures":[{"sig":"MEUCIGbHaoWCYuisiWpdRC1tKoEybldicB7+/2PpcMDYBrb3AiEAwdlA5YwS7AqOaohzZ+6LB6y4UXQdtdcgAt4ymymwY1g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh01ciCRA9TVsSAnZWagAAAggP/2wlGr7NWVRvKQ22YKAt\nRrndij+NGX5+swbQJ6lrMU4lJ57Yoo8+bTK1o61qhHc5kbAOehOL/K0QSR05\nJUXccXsm8PyYPH9gmJ2c7tackNGRp7ubIedVp/Bv8MFcNAZCslppWZAsA0ir\ng6sA8SrL2NGi8OLn4YzgsSEgmvADXrmVpJvbgZMrQEES37UXnVmohtjRdRr4\n65byeEf6RsYqzKsA8+P5zpwlZ4qGOgl+kFhqVP83IKElarboOnureQa19YL5\n0DoCepRJ9uiyQJymn90IhnTo2kvhlRFfUEFz4eMzrKx0uPdPgXsAzqKDFvKb\nOA2ZkoyhLSXXk2r4UIA03DexkLBuq3xBRt4J52ZSPKSxYrEQz+d9XmS8kHcJ\nWeD2W9gg960703QkxMjScLAinscMKPvtiB4lHfCPNqEq5Azr3T9DjexqTzqq\naj4NZZc3VyV1uzG2/4GHFw4c0EF+7YxANqpwfD7QcSuK14cl5M/g9nrchph5\nLh/ysjxbgg5bAo2JOax9cxySPDs7RwjsWL82I4luVjj6zIKtT5p4XW4a6ZOB\nogJEVQ6VZwkuwkQJzM3CeZoKh+NhKgoXK0DNBYv6Iv5fjJIIJTV8m+RSCzW5\n7IamJn7vZA9z70X8NYeGPau/k4W7NCbuINtfP7fqKOYsnRH96FDVTyfUK6BV\n9aG3\r\n=SUof\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2539cf76a241351dc8a87de8b643c5cb3649ad6d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.0","@apollosproject/server-core":"^2.41.1-canary.9+2539cf76"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.9_1641240354366_0.17249411408880255","host":"s3://npm-registry-packages"}},"2.41.1-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.10","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9c04b2fb690b9fe51192ca4317c85230dced3ce9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.10.tgz","fileCount":348,"integrity":"sha512-HNmnI/u8UtXTvFRqJ3mhqrqK/2ra5tRdDNUMsSrBJ08PL7skU++0T6LjjSKCcEMeLApjOtHPlfv/i4CnNgooow==","signatures":[{"sig":"MEQCIC0/aIHrxxWb+y05+nysPXnqmwKlrsBdegcubEmr1dkSAiAnBq7/aV8qhzNUX1umtD3EVuZARXrSRpFQNPPL5RqWHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh02ovCRA9TVsSAnZWagAAtGsQAJWe1DjmrfdHTN1OKFGt\nyXOeDZSdPBf3Ixz4g7ykdqa8OpVm1aZbeCqOM5j1ACnAoTdH+3ZafRPxC1k3\nk4s0p+HPU8serjJzioGXXp8X+N5LJfSIWSK/vpYAWAdcCF58Cpl8ZEC/4y6v\n5vYWvptWg1PKgeeT3ingghbMDojGv9Ndlxu4xLo2RNApygX7m5vzCm3ltoZW\n5jGI2yxDqq7mhMmcaodXFVEu50pkWEb2R3IFLz41y8cXUvwNum8yw3dBGVxc\nC4Q7QK2qo+CMPzD40z7hC7DOdZqcMkA6P4F1Lh12rc0Tb/oDb22JXSIkz63Q\nzLVrZ/2T4590a9cSfqkm2wlHVV7vHjqITND6CLcBEfQb6LBQCXhqHQDxE/fl\nzDi7mWv7ZGVzR6d52cYeCBuL27yYer2qxkKaEP1H8p3x0IMeVu85Nl+Fu5jc\nwr0wO75kcn5LjbQsLfBF/Uzh/KlvnmfEav6AfdowS74J/NsukZif4VGbIbeq\n3Zs6pBhI9ukH8aIHJs76rVA6CQyXyuPKxci7pKjA/ZFErMw3H4EDuiPwB9Fl\nC+G9xbhFOWyVg3ZmDZike37oclEwgrTqy/0UtI3OcO1YLjo1iX5gPmsveoGK\nyEs4NLcmaqF/RUDoybdEXj6FmSzCvf8wz8BOLZM79IH/CS+SvNdMDOxQnyvl\nTw3t\r\n=1+M4\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"73228c81de825a9c93af9860a815e762005087cd","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.0","@apollosproject/server-core":"^2.41.1-canary.10+73228c81"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.10_1641245230805_0.09845382177380624","host":"s3://npm-registry-packages"}},"2.41.1-canary.11":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.11","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.11","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b876264f73ac32a20dde98de043dc7563beb793a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.11.tgz","fileCount":348,"integrity":"sha512-IrA2P8zY1vUwWMG3MQuLlBEct+9daYmA8897/fiMp1W8OJBphG+W8boevWsgbiM3w0s+6ugs60wNOqa4iJQkwA==","signatures":[{"sig":"MEQCIDehqqGVartApMEcN1uRORjzUliDNWi/1UJeaWsc0lhvAiA7l9cCMFBguYBQKPaa0OWiJk5CcY+Npb9imgC+MK9NDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh03ItCRA9TVsSAnZWagAAPZIP/it2k5wOvZUBkB6D3br3\n4UecZ1DQHH6imnmb5mTzNOhoSflKI1F3NwOGlayn3SZsV3WZqpCVQTYXEICQ\nbgNxMqvS2tvqVVxW0OqkbQq/Y0r7dat+0w7F500oRMUbCLMYIqe+0lBL9EjB\neWyfefRewmOAOzH4RRgWDp9MtLPiOD4z1DK4b1Hti2FeGqCVVrGCKjBV59dw\nz+XHM6lCd1kFiy2IG0LzKL4FXj5mrrtBScYZVxmqQLTetOxMGu9+zJ8zSu+R\nmZoJqMX0vv92wuOnxh8CK+KPo+f6dGc9KJfzg/IDvM09nc+LqONz+4l16iVA\nPuR5gX1dG0krWH1RjODR0lddxjFeS1yJu665BrusYxWGY8yEbEx+T4gTqZnp\nwzMYbbCLWHneRLlpIDLQPerEsXmb1EAzIr/bAZj4ZANXBigl6XV+D7S5/zuw\nF2AzhCiSUfmVcXLKXDsZWqHAdLnqsOPKb+Sd8dY5SIllpL0/lVFnjK99lMKg\nrx9qsCkLzCXFqA9IhT68eE5CwiVttL83R956DKZOEFuO+67Qk38IKgc5gLZ8\ndDFmkEKvQTFw/HdFMlxIFAmlWK6rANvbHgVM/4PoK1FQe4PNjoS629PbpjWV\n924Src9UN+IS604tJenwMj0wGpP2xBGlHJYTX0W33UUrQXKbWd4f434ys16T\n3cwC\r\n=3dem\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cf122326da59f017cb4055571b1a2fc333bc8f60","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1","@apollosproject/data-schema":"^2.41.0","@apollosproject/server-core":"^2.41.1-canary.11+cf122326"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.11_1641247277649_0.9748951987722996","host":"s3://npm-registry-packages"}},"2.41.1-canary.14":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.14","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.14","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"895fd3dda4bfc4d3e5c3bb8af1ca562c51130dea","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.14.tgz","fileCount":348,"integrity":"sha512-7lgrkQDHMzHK2gh4hwoTJKrCUbXL4slT5NN0UO2g+cofVFpJCctf+kLz5eENOgdj+e4XXRC/HgPPkywyCH/Eqg==","signatures":[{"sig":"MEYCIQCkT5j2aPRJ36I6fh85t6bljFSBb0bYvREo+CYJeKRc1gIhAMPDxtnW7RgxKJIOWFDcm73EFSKgVW2NYCedJn+deoUT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1yYYCRA9TVsSAnZWagAAIlQP/R7k0zfer0mF9S8pmFDr\npZ+5j55LNrJBuiTfT2BS5C0vX5dnhuIHTAEg4pMSKcvH80FlfEhpvOyq8JBM\nLvB4v/p/eYWfnzNeBLluneZRgmdH4ndmTpFZH9z03fSdtKuG38fQbqWIbk+E\nURySG5NJpR3G4ps34C+cD+ZY1fQgP/L26BFOZgfioqCZLRHdBEwETJ7KBpAR\n9/n83Pi+Mk9FERRbV4J4pfLtEGo8K1c51/WzDJEYvbAi5EpbyHHRBdLmdfM/\nBu7ryZ+SOGjlf/I+EY8GGyc1Sg2wb6Xv9EF+2xJ7g+NR7uybq8VC16WxXYDj\nj3bubBkOvaqDnGBocQh9vGOY01epdDA4OsRmo/fH4QDRmvy0wF3uPUTywL+c\n7YFWEurMgD8M7Rk1lYSAW6nbH5uN8qaKl1lCtRPflX+cFtQh73Jjoqr1bi2i\n92RN31aqsgmyXXoIIDJ/xTlD/aHkoPeN58i9LPPxxOGDnKNWjdLgQE4+Rpd8\nnBt/bb5j7qNgbGvs/Bum5Td0jjH7sye8SYHFdLSuY4Bt73VGDEmjOlFtc0vF\nWN9SM+rd6c1IGzdArFnbIQ+CjlNR2vc+m0C+OwOXFKsceMFKJc9K6la0s+Hg\nElf9aZVcD0jACBqy0DrfDVvL5lSZtyXQ4EOm/TyjGnM0FlL2WWl/MFBEwCum\nawwY\r\n=Ro3X\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4d107f0e072cf29b7d2c7a78e4f40fb97713ccce","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.14_1641489943862_0.13772088118712333","host":"s3://npm-registry-packages"}},"2.41.1-canary.18":{"name":"@apollosproject/data-connector-postgres","version":"2.41.1-canary.18","_id":"@apollosproject/data-connector-postgres@2.41.1-canary.18","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ebee8cf7ffeba8f3496c8637d6acb54f38523627","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.41.1-canary.18.tgz","fileCount":348,"integrity":"sha512-kSJf8aph809xopZUzprWZGWGtrge8YQ9TqoeLbaIMNppByE4CyIVRlM6WjhdvhcAfNMOe2g2VNCFyZP0Zwhk+w==","signatures":[{"sig":"MEUCIQDZdS6f+IXgoVpV9ZWksfgHBRXQpp2Uz3prprxUH6tmgAIgI95oedV+zE7QjmPleRCVDVc1D65k5Gf0LpuAzUKUylI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3aiXCRA9TVsSAnZWagAAksAP/1g1pvJmsEqcVAHdzynT\nKjNAIVcdjHiNf7BnxlV+dPW3q5Yu7tp3xi/bjfU20mKXGQPBFV88GNE1EQQq\nzeLHtx/wfHDLVkwBM7wKpz8kLrsltQavK6/lmXLpet5bU0SFxUN5I366NPWp\nrnoLQQIQhqQqs1ORUEvtYWa2CuoyvtZ+sW1GW0TiblaWB6ykryIvGT7Jl4pV\nkaZJWRSen9BgLmEfpK1FQdaN4DSxaHQwlbQoAAvn08rnWk2rB8Rb96Neg9Ua\nxKcAXD5cfXW9UL4gs6Yj1AHzXN117O89XCytJqJjpw2+htkzd0EXvM2Qsa7X\nMCckkJjm2wrX964oB4XqYGoCAb8dojPSG0qDmbv8OyzqGZ8g4901D3LWCcoI\nnI49VihkpL3uyz44Pd7KhODJ9uZJsVOZJpJXDj8ftYoTWHXaXfRyJyFumMJV\nYEI8MM1V6LuFFOUidwjhvLlibjtKbCAXspm0HK9Kmx+M8EqMRD100Lg0AuWY\nEyCEGFdY1KOq5X8PLiAZXPKQw0iU1dhDnbm6zPyBS6/F3545kGswTDPswryx\nosw4Kp6rkS4Nmrm/4Xdv9zBryu9njrcaNshiejmCUzlL6hscH45VIoqqsoBF\n5VkHGRbNRsM4fdxP63pOKkAulq8UaqKvNjlsylqToMmdH4I+OBc2bzJWLe9+\ncM8e\r\n=++9z\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d4a81f34f9dea3d0b76ad23ae9c677ba6e177c99","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.41.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.41.1-canary.18_1641916567671_0.9311697068200253","host":"s3://npm-registry-packages"}},"2.42.0":{"name":"@apollosproject/data-connector-postgres","version":"2.42.0","_id":"@apollosproject/data-connector-postgres@2.42.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f77ebbe85a74e6bd4e6a762b2a86921ea8fab725","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.42.0.tgz","fileCount":348,"integrity":"sha512-POyYToY5tNAnZlbBhoKBX9TS3m4xc9nYOSRfq1pzSouvgAz1xrZKU9NGaI44+q8MDaW2EyIwPs05AGLG3+fpOg==","signatures":[{"sig":"MEUCIQDRbmXO+WZA8BxgknR3kYWHH71ar7agpH9w7Z0FpbW7MQIgKW/YwONWf/UnokYtFJRAO0maOGWP2o7V3d2ogALPasw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1089736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3bEqCRA9TVsSAnZWagAAbgUP/jhaYwFilZc9dUnELBNB\nDQKO9EoTEg0MdDtf+mwWah0S7nJTNKPYiml1doIkY4lGCeLgu+hPW1QMsG2s\n+wsLHCskJ+Hp1oDTrSLQ7+HqdxiH1/J+sS/usf7rrN2eqKRQJ4oIFvzpshXB\npDKz6IatrcyqSFvPJ/I5aZrPqXVUNSDeLBl5eImE2ZS0iktKcSXLrhpMisP/\nPF4riY9soR39e4jU/CuJ3rAdvr8wxIoMfC1TF5wwq6VTe4wIACUQ88mlvvBw\nq95KvWglEgDKXAK3oLaNmDkxZLDCe1IYPRALNCGQF0+3zaRQcqv8Rr2oitN7\nXIMXhOuDZmbe/HqbHDMrkZmJkqNCbgjXtHcVwUP0YKpHcjhqbdzr+hhgRxVc\nHgrMYwzNOv6H/JltV8zhFl4XqS7RVxI+pv7bl0so5ZnFa62n8jhp2Hl1bpRM\n9ymV4wmQMC9e7nRTBlS0XGrEZahtQS/DZKO/s81udmTEAH9YSww4hvC0xwx6\npusFCeCG3xI0sB/fu9SKk+ch9eU3OK7ofpBc0hBdHmxZAbnFc0mDovKi6Zhy\nUGbl0XD2yPI0DBxsEdA9kU+3ll5XLruzqt2eyiXMacMO0uqs7bB0ic0ui3yu\nSKTlT7hCuzRtUKlTXiROJ3hhhDMts7cnHqWG8SIp46exsCk5uWIZ2rbAW0v8\nnwnw\r\n=xFWa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"f5af5e7e8ac4a517ca6be7ca6793a82433cbcbf1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.42.0_1641918762614_0.09551139940684217","host":"s3://npm-registry-packages"}},"2.42.1-canary.0":{"name":"@apollosproject/data-connector-postgres","version":"2.42.1-canary.0","_id":"@apollosproject/data-connector-postgres@2.42.1-canary.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3afdf69e41f2c105a83c8609ee769548a37f186d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.42.1-canary.0.tgz","fileCount":348,"integrity":"sha512-w/7y9KFFZ9xs9SnR6lfpK8AosyjIZb1rEHwD5dD/7FP9OhPUocxlLYP4Rnut2RvGs5WwueHlvGqIAhG79YY30g==","signatures":[{"sig":"MEYCIQDWxWeg79WZQ7O1nDM9VZzZkD+6OhwOkU4GW2yUbbGlrgIhAI7XLu9B68kDN3SjtkM/cCF8hKb5zVVNXSeodyapm52W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1090006,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3wroCRA9TVsSAnZWagAASNgP/j5qP22LZJ1lJE2MtPpC\niBh5walNv5LR5UZ0e6BmB4O2QULgvHMTsaR8uO6CGKi2IsLGV6w4F01lxnd1\n6sHJBotzYHmc3nwjpQVNF0XnSiuaKm6zQudmgwobnpR1drtlUwUyuc/16zKR\nTiORMauibY9Gf4GgNCNR336ciOeXXV4nzR9U5RNvvbwvxUYtcPnrlheQyh9m\n3KUCuotRq/FjD4Nlu7uPLTM03/m5UGy4+3OOLjL6Y9ystSrLwO07NSyzCgT/\n68IEBfRbAbuheKqfTsUnmN4KX3ccpn/COzs3eZYeFusnTJkjghS0X1GyzLnp\nWQE1DcCDtRqXjpz1bxYszBGt83SP+p8ACNNx08/h0RB1aK6CrOmtYfLOubq4\nQF/oZzCiGU5BotArGVqxoFIIjJ0463Q1E8NTRZ8BEswPCaEEtPsAs+AFcu/s\nCM8q5/rm3ojY8An+eOMx/oiwXXuB1L1EnsaggqmxLZZj9358HY1xCKVi2McZ\n5xSkQ9GYZubdwTmq7J2HtwQMnMcvazd51aKU/nLq6ZfU9xD4+dw5vSTx7//g\nUnUKY8w30PdHoGvB9AkMEUA03ZlTYPGqXd9O0T+6Dmd/kmwmogKqkCJvpmex\ne/2a6THwAcBNBxDlFspLMSA0LQPBDvyZrLzcpdTe4SYboV5VxwDKa/od1iGN\n8mR+\r\n=NMwN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"43e8d506e94948372d3643ba97ca533cb7ae6f28","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.2","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.42.1-canary.0_1642007272551_0.6766790369447573","host":"s3://npm-registry-packages"}},"3.0.0-canary.3":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.3","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"608786b4b644c183f91d1e78678931b82ac38ba4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.3.tgz","fileCount":440,"integrity":"sha512-IQjw6AYn+InfRQMhEEW6X1NFtEn4vjF1D2oCGVR20VpJqkdbAFzlj348qYP1/GROcWvQqi1sRoQVt7siLaQ9fw==","signatures":[{"sig":"MEUCIDF4d38Ybp+oYZE9QAWvUHsplbfTrgFWVt8v8F/O/iGVAiEAuHL7jw5vl//KHQL7EzMpeoNQHlO2n50EKX7TOyC0IF8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1353895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh30KHCRA9TVsSAnZWagAA+psQAIVqaJsMiqIRJI+l1UuB\nYFzH12yFuWLnkcG0L3Yy8l1dTjWDoQCp7RM7Bk8sGUWxgniYyWvhholhHDTB\nt7hLzdK7gcGIP+Rz6r3f2ihllW6xlG/FMyfBK3SMMfuNKF8ZzhS2zIUI4cuu\nsYJw2r1fy3EZewGOZG21LxK4S/5giRA9WZog9EZ9o2zwOF80oCiaLSl26bpz\nVPoHeqZL2nS1AA1F73mS8i/eEAgzFUaGJGxWp+7RgIt2S9q+8VfZ+r8NOClU\nk5poURG9bvgDyq0Z5Qn6Cn3e4kSv2LcbXpz0Cf+TzqXh3RccjhrUNkxsdONU\n/aDv9ZBlCZJLBU9MKzI2SYvu3BO9/h5zlR3Agr02xE7O8s4QyMTLxqxw94iF\n/+QP8JFzpA32uJWTXXucuVhMI23Ix2wBLWOn6pGk+m/EQUQx+P0yAposll7w\nXv5WxltiySXM4XfV9+2h3XFCo2GuWuiZp1JDSyj3oc1lokg6C1bg/hg2qxCZ\nRmDiFDWxA2Keeu8IdpqlPfka1bD5eOsqJOjRvj6k7IhA0i8zbQCiCVFpFbFK\n5J+O+9WI9x7DUXRRIzp4x749F2NsNTReW4S0+vmeVnGrPEAPp/IxAbbv34Lr\nBr7A86g1H0HME7W3+ZzwCMx8YqiKmI/VVr1t3pRG/ZFPu9SP7+1+g6w9eTgB\nYNOo\r\n=zj/w\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"33c76d75eff3b6883783566a6239a6adbecf5429","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.3_1642021511288_0.4485600998795902","host":"s3://npm-registry-packages"}},"3.0.0-canary.4":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.4","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8030b6457f46be89297ead96dc92d47510704a8a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.4.tgz","fileCount":440,"integrity":"sha512-3J9zkWJsVz25n4leUyvQ22EyA/q7kjCGsBKGc3f8CXjJG6d9EKE9oGlGXGmg+saNMxFc+itvifwN0EnOsx/TVQ==","signatures":[{"sig":"MEUCIBCL2HjAa76qo4NorxR+sGMdf+tEwMewVsYRCJJ4jTWJAiEAph1AE1XEpQ8Nh/QXbGnzy6dfuTLU9F8+qAVCh1PK+bg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1354886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4FRxCRA9TVsSAnZWagAAee4P/2vZht8fhaTqwTR4nl1C\nLbnD4iXysb1g7wUGlRmfW9dpuY4IRFntfbT2mIrdAsnozI9YvbpyH6jMqERd\nyg4gncxbsz/m1iheSySRGGv7HYxXDFdYKHtSajUmW9ThdACsDTE4CR8L2pvP\nbsA5XgkDNu+g129X/GR5nZwWWwbvx15YGCBdlja/NyPBkeUiBEjyGVW+o87G\nY2qGjKDHYt4hAMqccDua90kB4iC/icv5wbtdiShgolvKzDDxiIPV48hWaI2S\na2J0kCfGpZjmP8SY8ncyIfL4qNN3oZrpXqNbCy9LUjI+sRODhQnpT5fFOxMs\nHPa46X33gsW0RJLxhnR6mEtU+8utFCnJQRC34iG8DzQjd6QNuntK++XIL4Ey\nwKN89M8m1i+yGp1KzsP/NIHuEuZufVl9meUJuorD5i0ch9QinqwD1K6Hjaw4\nTZLDbfrtk8sOjih6mHrtpHtiIKOd2rrr2DnGvod0YHn6hKCi89pPUm8gPpfO\nvNNoYIln7RqNKOeE6vKJuC8l9hK2UGyjZLilTIUJaItRyzwYKzwomLCKoIaC\n5aYYJn3jfJRf0kcQEqnwBsw4RH6kbmShzNC+Rrf8d6yYYIpWkVeSuy9JqEa5\nfhExHa+I9ndiD0iuCyGEM4K/8LWVB8StsGo9n2345Q5W3k6TUoIUUivEdNXP\nLezc\r\n=jKHU\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"46876777db94b59a0169df81193137529c34002f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.4_1642091633526_0.8857934229453233","host":"s3://npm-registry-packages"}},"3.0.0-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.5","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5a1a315d72df93bdc3306aea0c83d2a4bb11ac8a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.5.tgz","fileCount":442,"integrity":"sha512-CxlP5IqMx7uj6vhCNI6wbLMvQwFmNjoelKNbs9iBjv50tC18J3ojL48zFHbMco3o+IdkfegDnwecGIflpbb4hw==","signatures":[{"sig":"MEYCIQDz/eQgLiL1TxLab7mdaSkJHrWaHWrCBkxt1SYdM8+NnAIhAN6wWck1RxiYkFwcdwur6HBxi0KNwoNHVSE9+vhOEWB6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1359239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4IOPCRA9TVsSAnZWagAAPPQQAKG/rnKYIav4oax3QJu2\npETQIoEO6niZc5ReblhYcNAcBrU1vqYvEeJUNt3s1BilyGiUrtFrwRboEK6y\nvRbVe9WCd3VEEMEOC3lVryaehcWYXJ65wFvZjvmves7w9JMv4HORIpM7bvas\nNGsX4aZK1Amv1shB9IkugQtuoRJ0V44zC3djVWhMA0UgS/tV+cw7KyHwJhU1\nZvQOIHSP4p0LSacUHeyoK4nqO85LNUwyC8XM0ggPvaUNwT3iPNmkBWLRLq/q\nUye65HUe34F9etnYDRAC7jlTDNwXZeqYaIpJsLW746dBB7AVZFpCMUPLwe62\nZmw14XHYzfmHazlEg+FEZD8xDKeHaWkh8qx3rt7zQdGaVOOotMLoj5Hb/syk\njQXenNbhQOP1i7I3jEuZRZdUJ1xsXv/iKq2SE2DZU3XHpqy0u//QUmB2QVlZ\nwFue9a9gU6GPWVemQThc8uYEtdLY7j8Ws9kkqF/hqJhcKph6gYRl3XUzhK4v\nDPq78NXVdmWzmVqwHDzeuQPTRygZVb7MGU4r0udPoh3nDIfzioVXwdM71Dsq\nam6yHnF4UXGI9FD2UTrasMWQ0nazhA4w0NS5OlCmNe0eiEG9VxkX1kTVMmQi\njpE8zjp3ZcSlGY7z6d3ab8v/zc15/q2VhXHPrggs+SXyPo8ppXTzEFP5kEuJ\nLILc\r\n=3gUD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"21aefa6e24f8837e9078e3f262b2b867b1911c81","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.5_1642103694793_0.2690769702707523","host":"s3://npm-registry-packages"}},"3.0.0-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.6","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0903e7125ffd225f2770a5c4500e506c0e67d5aa","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.6.tgz","fileCount":442,"integrity":"sha512-sA/jtNizqk7vZcQCj0/rRsCN6zGCjeL+qfX2PH+WyYTloazuvr0ZcO3CkFEjojPXGVz10k1XK7j+G92I4T+MLQ==","signatures":[{"sig":"MEUCIQDvFC37roQJQlEd+ts1RumuZo1cbsWvtIHB4L+G4hmYiAIgC688c429tW5krZY5AhhS8NDm1Lh225dXpzJHPaCRQB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1360807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4JXeCRA9TVsSAnZWagAAruoP+wQEk7krt14Rw6B+gd0l\nozy4yF7dtzMTv5mVb4lmGVVPcm+Xs14t0OkizTIfR4NWPLYvGESgfdqaiSw/\niprg5GSIiPYsJAElMA43T0sv565tnZxgPwvRrpY14pZwRfYceeL4T8IR3cRd\nwjN/t4JwBeYNW57DnYO2+8x/Zqo2leGK7z2uKCDzS6871AFp8hoctBla6qMu\nfK46udKoypGWPRc26k4Q/FGO4uDmK+ukpfW3nucHJh4wvBT7iEfmOt/i+69K\nvm/Y2SgjZr1fkF+ifAq7OecPiCRX4cuLjJuyp6Sf+7P3G47fvvK5hl6wxZsm\nGm4UZbonTLtBZ2DR1la58fzqnfr44hSX1YK5BozC0/A2ZWpq8T5qd4C9x9/w\nk3ZYa9SbGBOTYCQ3vDma2ieRLQ+mmc8xQx2xqI/ZdaRyinlwvmJAK9StvGB0\n8eG8WLEvZHBcpLioL9CMtc9r+TjZ9wEoe4qj8FuRlLUbdVpGZe+hJbQzO/Uz\ns7psyLW2qpoovzVJz787J2IZlGvF0sAyeGdtC/yeoTVpzeZrjNbCUxghTmKC\nRtZWs3vrH4E/5gzsYcCcWzxreDwNO+9nS8g1nJLgwaKDeB7m2Q5RKYHncBu9\nHlR2ZUBx2sLVQ9WTzL9Z12bSYeTsjfGipAS+TmbnVlALMUGJFw0cl/SxuQwG\n9R1d\r\n=GDs3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b5072b6d208de457fe80287ee619368fb24ecd42","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.6_1642108382484_0.01601531934179734","host":"s3://npm-registry-packages"}},"3.0.0-canary.7":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.7","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"69328a6a8c8b1b2e94a0c0c1b9a44e061e3b72c0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.7.tgz","fileCount":442,"integrity":"sha512-PdI4Ja3Bww59DWtYTaLqAMk8LNj+wsYUeZyNXT2cJJkPlBYgbidloPUCHqd/NMJ+PUOFJgnJMOl8lsFXjHWGbw==","signatures":[{"sig":"MEYCIQCBWDNqZ6ZwPaKeOdGJbRQAdKLHnqVKh1QuQxiQtnzPigIhAMgcUjAbJyHcl8SAFjNpfLoUU70eJ4Cd5017agDB+Ol3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1360810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4NNNCRA9TVsSAnZWagAAjCsP/jpaE6FdojH5QPVgW17Z\nd742NgtQ3auBx9j8OUOGY+zxkoJZ0wYHOOQzGdT9LSIxJaFEU3zpvedpoaxD\n+CsJyKIAFS0DX+CWdyZo64lBahn2lYxzcilJb3snPPJj6PMbVnD2TwPnzQbS\nNpJPvNcF28C48cHSD9n+UHPyMVNHTMy8WZYu8vLsDRDsOGx3bEZauGCLsmDF\nm8aOtJBbX8jW10Bh4Z8DIBOv/FkdfxNE2g4fi1+9vipossthRkeg5nJYpp3R\n5j3Hj6pjlu46g8ddoy2gOc4bW/JPPZvROa/m8d7KvXENk0i7HgjbPUd48Ql0\nRszlmHeJETbLLvd+1Xk28yDYYLumhe+hKmoheTrqUYPfoLhn8P2ucFOP0lMN\nhHrZC/EPaAFG12l7Gd0uUHvN8zsSFXoQGvQtmLV01lqcWgyA6ZTyM5t6z68p\nTNGScyhmZvumH/cMGjZCkClqkbIU9E24J42C5R9fR08LmZwNkS/RP0zXNIBu\nd4S8wOL9ZvK0xkRlSrJKF8kKFz9Zpykd958JxR88kkJMnmTeRfyNuXAQ5RQi\nb5HlqJDCMx3DBoJDb4UH1Kn8QfEkicXwSB8UJ09XzsoZt0Hi4JMKdXRb3yL1\nRCOhLKQMORJDHxgMn6PMreH1FmWiYB23VBhC3jAwTU7DL4e07ZCRXLkKxH9u\nVV6t\r\n=jzwZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"43b0e69050e93a37837a55b639df87d013b539f0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.7_1642124109564_0.32813423992353385","host":"s3://npm-registry-packages"}},"3.0.0-canary.8":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.8","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b2947d230c9de53f1357ef195b1b75f562b14bd3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.8.tgz","fileCount":442,"integrity":"sha512-eJ+0UfEu6xb90G4wLAw/NJU97R22ImNJqafKyGv40LAVeglwl7OTprxhD2elXwLdAkVi9MiKzy/bkpUF+zeeEA==","signatures":[{"sig":"MEYCIQD3C0GeUUnkd5fS7XWHkYeI8tCdiJmLRHLso6RxaD6g8wIhAPp+vzknYG3PNwuGBZjwLUvGzaEXi1YO8odgH6R4BaLR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1361407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4YZ2CRA9TVsSAnZWagAA3RkP/0uongMVfhjOCNK1qm9J\nosH+XnRbaLpNvCJw8PMJV1PkQCSBijvNzU0zAXDAc4WCm2CWjeSvmlHhpuWt\n1z1JbdBY37vIYVxUzJHt0Y5ErJqSh76UglWO9AH/vOYgZWZnTSeF8eXv2oEx\ntZXvltMa/1mxZAh3wnFwOZkrZcRyGKY25Z63ucVUEsNVP2tHyLkR/cmUe1Br\nAwmdcpBsJ2gfvYak+tb8Hgu+qs7qccVZznW05mf1j2+QjGJViBDUaQjo5kxH\nNm84XIIj27df04tEZI0MRWh0ImgYNUhpUicI935SlWd8kqvWEQRh6hvrBDi8\nKub5W9+LNGK6t675+3PxGpXyUyjMPy9cZ/X8sMusQgbpYPTAt+n3L1tApOTG\nlSaoch7RY8DWs+ShcrCFybvvNz6QL6Mm9MnRtVVNEn1QEVG5o6Ibqo9C95Ih\nGMhS6eyflbEOcDnb99uqhMuqOIk3JwP4yJm3Pa3IPhnQgcJDLEp3L/UYcIRK\nxc+Tm+uVBfijMypTA2+0atr3UQdOBrhMz1PlXCJp0X3wdURWE21C/Pvuh0hn\nnxFSDTzrVpP4YtxPT8BEnhYsKEhWIn2TGJGWNMlfdLm4virgmqjk+VTz4Utj\npPW3fGtxZeBoXD0jB9Tjg0i3azxiNMcaXjupMYL4lKtdBRr3JLAahWjh4vGI\nCy2f\r\n=Qyeo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"499149cafee941677647ce12144de2f704236ee5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.8_1642169973832_0.6992024540297088","host":"s3://npm-registry-packages"}},"2.42.1-canary.1":{"name":"@apollosproject/data-connector-postgres","version":"2.42.1-canary.1","_id":"@apollosproject/data-connector-postgres@2.42.1-canary.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"10a8b205c5ece3802458cab6e216dfe10dc991ac","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.42.1-canary.1.tgz","fileCount":348,"integrity":"sha512-pyuuhVM43n8gEkkkcL/3lGn3Wdecfmh/Ege051GY3mYArZ+iATkW1Zgo+uTMJKEeDoYmYIZyejO9oEWoimjQBA==","signatures":[{"sig":"MEQCIA9aCkTWaaUVr11579WrA9V0Jhi5TzYHQ6DJgd5tMoIwAiAQ4yafhszXM4IaC4DOeu1F2ABAtw4VpG7NUZHCOmPtkA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1090898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZpTCRA9TVsSAnZWagAAWE8P/1mfq7iXpG87BLvOpjf9\n0TnCcMbXt9c02RvZ9RVhNxuCOVJvW5c/YciJ7VWyEBQD3oDSjtIjxWhFFU5J\nw1+3wd+awQGyJrN7bgUyn5gQ6l2gIxVLLyYDM/TZS4ZH14Le5O7TPOK/XuoX\nO4DGd6OviMJ26ET/eyZKu5vU6Xgmjt+Zq4Vk1k/r+eugi+ULMtfa+aReyKq0\n9UmCYRdfI4lBZdPeV0vO0bxESG+ThCNT/QeanbCfvewD5rWCLAP9GBMY0ubO\nNacFvAeFblpjr0GH2BPIxlH7POT/ec5dLsFb4NLQZmXWBV29YznlTqjPr7k+\nueR9OPWAIr4tavguVu4yo/rDuPRh/Oh901gVCvut9OyKb4lHrtFXqYjX/ANh\noL3zivHzmGo28934jJBUT8BpB4upSwMhkE8vS20QWja9cacs/v7ZKKNnCs3O\nqRdyeqUpYlmm521vPTlWmHZllui3HYVqfrhji9XF5HME3KBsKnTrM+CdaaCb\nLJ43IC4AJ24pWtPCv5/GTCpD372NFNKcVj+2ChUnPEw5Hg/rJknc7Sld0tsQ\nWff8VGMnzWyJtic8+ykuh53ul6IdaWL1/iRpn0lGscvNPlABXSAajUMM/psQ\naLqRn22zQUiPe7nVAfHrsHchpfc6jKy5V+H5RvyM2TOtvlkVk4nX370Qtgzh\nPi1g\r\n=orp0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e46872f9a5bafdac25b7e891eeea237294fd3044","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.42.1-canary.1_1642175059046_0.009812690466696639","host":"s3://npm-registry-packages"}},"3.0.0-canary.10":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.10","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"35e6c8dcf02980eec27527b600e76223a6bd73e1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.10.tgz","fileCount":442,"integrity":"sha512-OhZ2RBRYSlXKV0P9LfWr8gcuX6g3eRt5knuPwfU/+tZ7yN/QwbiuVB0YI5JzA3IpdEqmLyMmQnp94OgzZf5rzg==","signatures":[{"sig":"MEUCIE941hzGwG6BLyiD25iyQFDqxYT0kkesgiHHK+DUENRpAiEAtPfJX2s8wyScgVrZC083+qUPRv5HbfDbrUpEO4itCR0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1362300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5r91CRA9TVsSAnZWagAAKIUP/i5i4S4VSL2JPkxPOnx7\ncZTVa1lV+k/zjhvWA9hUVFArHWfhQuNwbigs7OtBofMDv/vbbza26505OJrI\ndhWOfv2T61Pf88j8cwts9kl7hJetqkdi96XB7wGPhAce4x6ghoueGw8H3OTZ\nhrSqlKrcA9RMkjcrAzeJxf3kJFx+EjsAJ4ETtylpQZQYuLwTypLxMGyRSnas\nNxURvI6tPQxtVePuajB/QfdcVUTLvXp1bzScxP/1RyY5aG0lLpH237LCQnBN\n4m8uK23QU5T+W9JIY6EZkmPIl4ZK2fku17wgL75gbZGbpKNVolRddodlKMg1\neqxjJBjPLnwDHeXdAk3Zm8vs1Mk/63H9Hl1S69WvluplPbL7RvgR6w4aw6Ab\nC8hji0XjvzNR+8e1Ok7mwTuFiACy0QxBg3/ySkicPB/qmQhVzfUodqy/H1Hc\n5LnlidRNq/NLOo5y6tR3DZ9cortUMkFQFOQoTzDT5xMGO6tYIS6d2pezANOL\nd2ZzXvt4EhqaO3OefIli5hQoFF6GVaPoE7XPm1dPlQgXwHa8OBk+hamwHcuS\n2OZbmqV5UT08g4TKlGKweZHjnUYayG6MeyZJhC76RDdgcLBoByHdm5H4e/hl\nEWyoUGDUoGKdgW3vFZR1IaBYJqOCmlTgWFgrTlZfcvmYuTa1VMjd7O3eJqlh\nCmc2\r\n=c3u0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"085e5b9163135d844961fb32fe153c21654f3f38","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.10_1642512245217_0.23150825920630025","host":"s3://npm-registry-packages"}},"3.0.0-canary.11":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.11","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.11","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"119716400473c72f4416687ba81cf5d6555b4acb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.11.tgz","fileCount":442,"integrity":"sha512-OLDotn5ee/iSqAEJoubNFa1TTt2UQ5V53fEHIHp0BU6lpZrCYXAbS036IFUibha0o2Zwcuz3baaGu+YkuhOpdg==","signatures":[{"sig":"MEUCIB3B2NzOyBnpauNoLY2KG8FaBaM9ZPjIJo/t2ipl78kOAiEAh84STDZXQtNrTnyD4g5GdVjrvZhqKoFb4PP7UKMFQJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1360222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6XqVCRA9TVsSAnZWagAAIrsP/jkbmQACOHD9IpOH0wYc\ncpBSuVGHza92lszbfY1ISP2N4t/Zl5wvheoLu4IXFVueFuTrbG/KtiFZhktY\n7oiKisx4HMMROeKKq86tP4jADUV01LxcCHKK6gwh2P+SBYz9ozJCuc9J8Mhg\n3svQrhdFUGtrjeZeGbJcN9kNTouBVoAG4ydUbDUkVc/JNxd09yoNJQ4/nOL6\nmrC0PVO7hP2wikLMM3HHSPVBlRWLw/rsFkYu8BEROPhBjsD4mnc0rN2F9CLt\ng1uhrlSdIcEsc2Pcoa6GHObHCSJnfvuQQdD8XZlJ2v1wAYmM+Rup/FrgI3AM\nJMZefwvWtnMXYlR8BzvCv617df1Ms2/vlgqvLJ73baYq5dL9TQajczyIJ6E4\nWRXw/F7xKC22cqBaEk3/sIVNvMsL174HYmWiostK5muW8CpJC4hRJpOSTzFS\n/IdXTybk0eaA3hu/yQ3bgg1RXFBa1yKGBelPWsUGeIKgpkEkrfIGlmZ/FdOh\nzfLcKqf1V2qs/Z4zi2b0HM6ZlR7DjJKgYOYTOXyWOIyPbwNbj1vwoeMH+PGO\nWKs7Yd5n5QGI37IC+x37kDiVb2hh+Bl8LceeaOhBFogN0EGeVtO/pI068bnS\npH2gHu2TlWoJsEvpOtJ0M9FPIeqbxwvXEtPHQPZtIFUnDn6FSXzmL38IfAr6\nb73X\r\n=hIKk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7bc386fbcf009b79d48c34fb80e02d17f51cf006","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.11_1642691221492_0.7377188205510379","host":"s3://npm-registry-packages"}},"3.0.0-canary.12":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.12","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"48643db416770cbad7d99c7ee884a6e331408228","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.12.tgz","fileCount":440,"integrity":"sha512-JoByiWFG0womg38bpHTYhKymGq5vaQNgiO/Ejj4rKpDb9ofWwWTTlzLbeIQrZxAhCw1vYj1aBHqGlxsw34jXRA==","signatures":[{"sig":"MEQCID0cMlrXn/clZUll/eCsL9AfzPnobXeMYO6AfgLZYEMaAiAA4rWrRcTB/XmskHOSXTYvdEz0gW+QitOfr8dlBHz7ag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1355580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6tdVCRA9TVsSAnZWagAA1akQAKJ4eGczkj4fXtgOXgrY\nGwVj7ig807cDNI9IxKkmCK4k8NkBo230CSek07rJ/OW74cEWsB5QlTRrfwwS\naw/52IgbGdQG9W5frzu4BTDq6m+u3rls0wBcNUQPk9pLsXp5Z3qAO6hxcO9P\nA8JnobcrAMhMrcsxKNqdDoblA06ziFFZKZ9uBWvy48JGBWG8kEa6/r9mfDaX\ntXBs1UUmS4K73KZT88EgahuEoP+VD6JCG+rtCZB6ANuPWjGC0FhAjL66XJMC\nBeJsvAXjogrqR0u3C467Mo1u67F9SKjB32k7yfBRrYrQZpy/kGkRM2Fug7gX\nxXMAjfs8z4wL9qJS84lQ00BFBGdgfR3T2Txjh91d4wwNDkbexayJ22AXwciM\nnd+ub0syHCRFEFy+c7r3FQI9Wjt2vqBMMoHxVtyi4/kNvmbASVPi1cspA45w\nX107ZgEaB7WMqe9pteG53oELQzSgR1NgCL8KOOwAQK8Ps1JleAdegGDnmqzh\n17zfjTj4b9RIIN8wBBBMzefpo2qUko/OWhyWuQvCPMKLRZ6zy0jU1D7hCdDw\n3ZnGAEVD5bwqXJb9DysFmJbiEn/mhEqg0mA5UhA9xCeKZ/dRMZiwbxRFH95Z\n1INjvR7fi54lzl+O7GBPNp06z3MPRUeAcR9b/qi1pXi2OJpMtJrjcXY1yPr+\nLKLW\r\n=jH9a\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"95092c52b781f45d86041f33efae80a41ad0e210","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.12_1642780500832_0.576705796338266","host":"s3://npm-registry-packages"}},"3.0.0-canary.13":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.13","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.13","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4b9c61f6426235c89d8b2e706e643736a9737694","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.13.tgz","fileCount":440,"integrity":"sha512-OB3GqVbhf3S23wDTx+u1VgInf9oiZzZEgL9hTeAu3lCFZgU3IuMJ2+AOUB9QcatDprGaEnZH3sBfPseubd3mgQ==","signatures":[{"sig":"MEUCIEz1TArGAiLHqPFoRe2wvL9tNLh9s5ur0B5AGy6YAvuOAiEAzb1ZCCm9aUgJ/SkO5KHFSksmM33kRdNbHw7NbZcQSCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1355951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6xLPCRA9TVsSAnZWagAA584P/A5nczoKDX8imgnkdfS9\nLXNjZNnjjVzu7UWBj1aiFFL3u3rcPiVxZsy69J7Kd5ZjI7rhOZUhUh9aHNod\nhtIci3mMhLaia5kJMDehjkaD/gx0ucTn2n0xpQznG4BmuVlwxyvxhlyzDG7K\npCCPP0dI6a6h+r6YJdgS6Rx13Jvx6fiphNcQGXwDaXfkVay6vr/NghZMTAsQ\nR+hOmysem+TRyxV8fapFACTEAnkaXLWp5+R9xWVFqhrqOcxHbvtJwCAzrSjQ\ntRlVc6I8q3c4D5hfEArSUnfCAJpATn/Y8mTI03uFsO2eK45yjTzJ2buMnC4A\n3RmtV/LJpZVbUu1DIshDZnWl3n3/apNHEQsxyesahx4uXEyTx3fC7Tve40Aj\nksNbM2VNooWTmfTVSaigGluNfS3FT55F19GKikLCXXr7A6oAczRPql4legMR\nkuUxoqEaa12ZKB6c4Cocwr+vHbp8+K5h5Fd6wjiuj7BfF8aVVjZ7Ljpfu/HU\nJcbla/xfjK79OUMri7h36WcW7Fd9ru5Tu3qt8oRL/wdm2gvyUBnRz8v1ooba\n+HVwwXIFpikuOvtAq7Nur5hXwMiKfsdfM5vCOw8CMsGpRhqIQL+LZYCKBI1d\nycOM86vfT7eW0dyl4xQppVAigWbN1yMjEqBgs5NPqIzVEvqn6LOtdBv1y1eT\nXtpn\r\n=FvTb\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f97441a9d954629d69d5f1db4e745a7d2d5b558c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.13_1642795726774_0.9331615240775417","host":"s3://npm-registry-packages"}},"3.0.0-canary.15":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.15","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.15","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0574b6ac39e296801ec05d35cfde8c3ea73d2a42","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.15.tgz","fileCount":440,"integrity":"sha512-O1skkEuhRc2fYo1GfEWXaTPckqbS55Nc/IfTA4S1ejfL+q6mzGuZo4DP6TZIgD+OgJPr0qVJc+/SUwEk+mMZcQ==","signatures":[{"sig":"MEYCIQC49mB0nP6wjyu3pCNW2R2/NwQkFlSyz0cX+w0RX1QnsgIhAIk73c5qLvEiiOS+hiyLrk+qpKRk4OGjmxnFmFwxVjSF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1357990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6ycwCRA9TVsSAnZWagAA+hcP/RKEwuBlhUdfZRNm9PWO\nvTP5gnia4BhFUiiiQ4idY7SPNjW9Aif1MpP9dyhnQccCItuZKzwz4MT/qWAi\nzy0n+Y6M9dO9Oxbj3v3zix3k3FeiHujayGJGFdOFmQx0vDOyOsCeDcKKvFZP\nJXVGnLWvAsJ8xFMmN82t88e0CWscdGnNKCig/Ybb8qHKYyjJ5yGjKCXtwFer\nYYlE8i6T6U1QWOFW2MYXrA+nMflPBjQq7y7dUpt5LdND304bFQD1uiz+U5/G\n4iNeooZnGv/iAjZjYhZVR/raBwKxu/zTBSjaLeEqAwpnWG2i54mO7d9JuiMC\nWxt9c6hezjuQ6FgLwh0L3XBD+dq/Gh5ShtLkHkRvjyyhp2fCMjqavzVzbrEa\nvDMa8Wp4PuHHwdFXM90SbRndAvBAjJtTg+bOEwgk5KCW9iVkjaGgZMEBsjII\n6/H0j4gPIGmeye8c2irurQCnoYjOchEThn8EahV7oKPLLsrZ5ooykeVDVsci\n8HtJw1jigeQNWKveeghEjxV2Ku5sIP2NYV81g8SjOtuJGzPBOBofJaRUV6Zq\n5H29ptTM+I8RqyZyjdiNKtgqeiWunZJt0Xttb0zU1y56jd5XDtnhOEpCfdda\nbbCoO2suCAPKTGNvciZF/MGIWiZ2vzLb6utcqASOvai2yhxJTAkznbcARxh+\nDSRX\r\n=48It\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7e81fd0ba6181479091eb55245be8ca6caf67083","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.15_1642800944373_0.15555586081290596","host":"s3://npm-registry-packages"}},"3.0.0-canary.16":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.16","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.16","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6628adadf9f8a509a6732ef51903220649539a5c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.16.tgz","fileCount":442,"integrity":"sha512-7qaoszd82R/HPkdk0wmJkHt0e6yWIICf+rPUDDUvmXDIzPnew6a+GDWdKxdFm9lnbhm9yGLvMWWBekM4lWJOsg==","signatures":[{"sig":"MEUCIHGckKMFRXYGCBBnp3ZihrOeke+N7nSlMImyjl+ntXhCAiEAtNDpO36EGh45ruYGzFvS0d/TvX7LU4M0oTd49jy6EAA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1360063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6zGJCRA9TVsSAnZWagAAQAoP/Ah/QG2gJczgxWfzSDPB\noZwpuq4zTN83AlZ5z4IRv8NAKEgfnq8L6JieXfABW7BjGjw7PbcGcnffUXfX\nXyCGudNvTvjzVwnFXKNy/XZQJX2zVTRAP/aDxjjwZyidCuXm+xxCyiP6D7j9\ncuiAZM9LThORw/tIilAeQzWGwlHH4kZu5WDsMSdmPURuiDCwUXZtoKDUJahY\nIjNbZMFr9MtLQDQwcu50KdOvbWCrP+4viSY3Brsi1wO9x95BAQZzR5dD/CCY\n9i3dhsA/vLfedlXR0iGL5UbgOGn5NpHfgeWPGqkXm2LhUqT1sJ2kUy1Z2+8o\nvBI25aeJGMl3JlgPVysVGeMN8uqqGf2+VaD6iWTMIsv3fPnffQKQvo/45NbE\nsyL5EjDuS8TDyXcS/epfMTQJRyZM4mhJJMYeChOh1sSmwzhh5h7ULRquGDR2\nL8xfc/5BIwQb3os6oRniv67R03qrCLVa1ZN5B6NPovJMsqjAZF02jPIM12Dh\n/TWCA9R7ZIRP+9MK3bJdnGLx9mO03ocEK013xDgIKIi3YMyi3vsAI7sfsdtQ\nvuCxdOiitCHZLhuVQ6D2qeiXowdxGhIHBN/WLduFt3aH7RJmU3ZWmaH6yWHY\nxRqvHhANsZBHEAKW6tu99etu/XwMC9AiOzq6PlvaAVgVX1b+qpv1YGeBfqr4\n4fz3\r\n=auwS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a06a4c30a196aa7b159394af5d0e6bbd03c89178","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.16_1642803592930_0.17951004039211726","host":"s3://npm-registry-packages"}},"2.42.1-canary.9":{"name":"@apollosproject/data-connector-postgres","version":"2.42.1-canary.9","_id":"@apollosproject/data-connector-postgres@2.42.1-canary.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a9169af2efa569ddb3a7f457ab28ff79fab9b392","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.42.1-canary.9.tgz","fileCount":348,"integrity":"sha512-jIEOJC+YwgmQKWjxjfjqKk+b7dHtMd/JvMj3LkznaG5q2OEOG8+0RqoWWIyX2eMqj2ug4HrHTk7lqwUOpwEyCA==","signatures":[{"sig":"MEYCIQCcbwu3eONgpraLkJRxvAcQQLfhaL+00fpqFQzSc+ELqgIhAKUGxTsaiI1aAVUzs88qurkcZ1H3TougrcczXAyB+Pl9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1092796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7rowCRA9TVsSAnZWagAAp88P/joDrqdzf5VhsvLG8BI5\n4qDBnzMZ3d7W/l1WFaghTg7FOOALIvtzhqCJTWKfq7PNLdVU5X1a14h41vg5\nvPIhQCUWCIStU/yuOabVVgyZXuqeb234mYlfKSILBGi0F4/QijyVYkCxvz7y\nBN/S/hfcGEX+9RwlvXAELNvSsaHB0aE5BD+7Woyr0pNkZ5aP6+y7R8Ru7CsF\nTYIXpEdh3UZPSP32bKpNdtGoob/YudDnxftn228zrZxz685YA0rix/9L2arA\n002pxNPOollogcSPTDUJBeMdi0QjddClByv0abbql0NF2Jk7IYFtcbKTF0Kl\n+Rr9bbWBB0i8XM+oZTL3Yp2Jlzvvr8XgBMB3H/qaPqV3baJ4N5n+LAXMDH4E\n70jaGyDTEbUQyATVS4XsLTdGzzYoEqkA9OJNaTqUviivDhRRw5CuhXtHtUn2\n6QFFCoRaF47lRAdmHALHuZyK/7BJ4la/LFSsYPMvqaXT2FmFVwV7WZRN1CNf\n2vgEt30rSy5AZlwsZGyjGGAi7rHVa4El3MOh4wWm7ErpX6Xa2tba6HOUl58N\nDYHumqiuWsczCHRU8EdwKcL4hosk2A8M4oWw6LJ5NRJ9YOhNlDo22fqKToOV\nw3yRwrOCIW3Bs3dOpmQqsU09B6//eLSuHSwq58ZgVn3DjZk6Yb0s2dwyuBu4\n1MAA\r\n=2mJ/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"76f05b65e7794fc9a63069b70573e4b202980580","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.42.1-canary.9_1643035184360_0.3464661908681046","host":"s3://npm-registry-packages"}},"3.0.0-canary.20":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.20","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.20","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e3926310001f4be4b7750db68663f6e98ef6635d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.20.tgz","fileCount":442,"integrity":"sha512-W8zHEYxn+f3aF9JshxoGaPRkIBvTXGHLYZ6uwYwmg8FB4y+mnWkxfpNlxAP0PyvsufVTbDgA5N2vzEyXK49x4A==","signatures":[{"sig":"MEUCIBpZMM4aTVSGG/Xld5MfL4gH95gYvVmT7WrKcJH4qXpwAiEA6qJzevYvU+NJ+UZlUJxAxpo2DH+th6lbmnirUke7XD0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1364117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8BeACRA9TVsSAnZWagAAsnMP/jE9vZ2hq9N4A8AHsJhx\ngqzuG32QLlJRoLgGPEv6c7DN30vBfM6mbK5Ah+M3WHuHLPWvxKVL5t0bbAeN\nxcpBDYFh2NtSMRJEkTDo2uXHeEVUjM2YchsxMHw1Bk6tHQr4ak/TVnzUFxxx\nCVikCmTdrpy5WgdBqLegVkYrEPmb3KoutIOjhW5ao0Y7kPisJyDmVcSW1VJw\n3tz7Cv+IkgTkTox00WLP1tdLo2GhfeS9qg0al06GE64a000W4XKnyWfZyBxm\nsnEiezKtaVpJwJZ3h8ShgzrSq0cHQzcsDfKa5/Mw1bLlaqz1MqKAi2GaJwoc\n257aBbiagucTuSIWUbEoUtPJT16bIoUOWgp9CN6FQiS3tJ3+3Ge3r14SFD3v\n2yBvX5QuufBFuiJHeIn8xRquD3aIxYCr/xWsYt9YSXeyRV9XAMoZyS1lzbjh\nPb0f+i/TJ5kLzQf2gwywc+mr/f02p8lyOY2j5FjdNPFElzgjDS9pLIFnp3zn\nJzzj/wb9bIlXNILiY5PRzmvv3gaq9FOsDrwCsduMbtpCdfRQLhty6aLa8ypi\nko8OVkuBnjoY+gSVN1db4eyjbY23JMToeDvSf51oWIfdoySr/Lkqilzszdqs\now4E8RtxeGGDsSpk2fKsleGreOY0VKh2rfFfKiing9FCKPAVTzmKqnI0sEVl\nvb6/\r\n=prGy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e4088119f4028703ce4c63da96d51ede7a2a4f70","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.20_1643124608262_0.8051867628694922","host":"s3://npm-registry-packages"}},"3.0.0-canary.21":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.21","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.21","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c761d4e7da0dab62b629bcf84ecf4700ab168cd5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.21.tgz","fileCount":442,"integrity":"sha512-mSM2BePtzdcA5Ey7l2nblLfj32DNCwkAEXhCkjFuoqOh2CGcuj3oQJ581DGwT+5BEMUvDN4NlZJl1dj9IOB0GA==","signatures":[{"sig":"MEQCIG62NHqlKWeQXdgYNAEopj2aZaLONG4SkiFFjzwlunrcAiBTG1/jZxxjvzeZCLz2m+vEGVdrIS34Wsct0F//2ZWJ6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1364117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8BvFCRA9TVsSAnZWagAAQ7EQAI/Lfy1N5J5q4u0RIgVU\nZYYy9SN/0GP5+AFRKnHHdt0vPoVIfUIuV08RRtS0ThNIKKiyKr38Qix3QNEX\nn0OYhpJ7stCkvs2ZgWNJAij1Fc48iGW/pVXfUTo5HM146fP33Gv++maPCm0a\nXC2SugQx0ExEah9pNbHJD9anuRYRjjcrrYsx3EeJ2skREJTIaSW8KeAXXSrE\nfJdcOioeim5pmxjum5ec3tw254j7IZMfLoat4Ta06LQE/6HGpPlcYysRcSgr\nXpVEpKYDlrob1cafpOeL/YzF+fO0DpxnyEzslXirWdTdyU2I8oUHtw9YAG23\niub1aylZRoikEjr7AH6LOwnjPFkebfonSKLhnVCSnLFQVI+DUPpHol30mBwX\niWJPatkY9+VO5wmVUXwWMMF6p7wLJKeN8931E1Yd44OBCsOiVXmMP3ENhLdX\n2b3nPQIg0m0ZqFErqjHbssFViGPadyilk46Y3Fu8Xfqxg/5kx2nCTRTK5v3J\n+iq4thHVwlBsxrFwwcJoOB8Ndihchi4Ni829bGuPZXOGMzrL82mpIX2RVO8f\n256DPI1thPyKi7BQWnNwewVECQfe5mlgmAwTpd25+ft1ryUqABlEYySFU/wB\nmT9hoM5Hm0WmDgE6BMpklNoEPRaCAEuqhu7y3dIO3j2nDroorSKlzMN6GL5W\n5WB3\r\n=5ApP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"092745f31de03512983276a691abb8aced30f1af","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.21_1643125700960_0.49108318446158483","host":"s3://npm-registry-packages"}},"3.0.0-canary.22":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.22","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.22","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3a7ad924873529a4efd7f096d25a60aca54cf3d3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.22.tgz","fileCount":442,"integrity":"sha512-95TYMryyv0iM7PCO/BElIHyEAgqGxreHNd01ZpDajTX01U6v8H9nQ8dE7dTD8OKnzDl8VVsmGdJSIrca0vbp9A==","signatures":[{"sig":"MEUCIQCyhDJjKpsHa/gKdxePlVyt2Z9NkFufBMg8ZkvvCDMtkAIgPSY6wLjjnJjXbf0wm86zVrpcXMdJ8lqfxzvnuv96Z2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1364117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8ChaCRA9TVsSAnZWagAAN0oP/AwL+9x+FsTZqUyX9vUr\nRdU8Z4UKsg5xtIjUpCe3T3xRS8XiSf+45LCwMA2OrorLeQYUoDVkQQdKQ6f4\nkqHy4RdbrEG/T8vb+0UsaKwTs+X7/r93JPHsuyoB/7sx8Pa/OdJmHk8E2t/b\nH/n4mU7o5lLfoXwf1c3tJM8Y9PgnsBsu89DcMggbsud9KaQ0I1r5Toouopq4\nVlEo7LeWL4EvUOKYt8/QWm5z3sTZaZxMlwJjFGvaGd/SAic6kLYYFG4pV7jY\nhS+d4CoOJ4FT/Xt5L13EJkf4TuFDLaX0UiDYTjytkTXdhtF6k6FS6UmV6Mm/\ncclU5nxms3ST8zXxVsWKobJsZtxqMnbQj3UM+zLXweBkU8DDEkN8XIojblp4\nGpHhyU2oCzecufA1Sk7ZvV0AfiUCfrIhOaWcEhX+EM7baRcpnGIG6guwFlL3\noi7xjaBz2N+Cc+he/JY0LGBDBxxxSMeHVxRwVNPS6u1AZQQtpMmdwrBCwE4N\nzOoSC6nWLz/nt5LVo9cUSmlHx4KAvOSPd8PVI+5LepPdyFjG4nQXoPD0u/NL\nNt1sUGxAM2oQi9MCio6OX8TPjovKTDTFRNntzEYWXR+LEFZca08JzIHfVlbm\n6TEsm7GsP+F4qelPUXeq5Ydo697+pAJ4NHy/iuEL5lETiL0inA1GOzR9o0cp\nqftJ\r\n=eU1W\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ecb1404b15d997320fe99ebc2bd73b34794d158c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.22_1643128922430_0.5276426104075105","host":"s3://npm-registry-packages"}},"3.0.0-canary.25":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.25","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.25","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c2c4a92314fc854d2e452f0d1a06511ea827e034","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.25.tgz","fileCount":442,"integrity":"sha512-Uy7+OT/jsGMPYh/yy4o9HYceJ1Lk8pGsn2iS61ua7dmHnOrM5RKUpIMw3r3M0S5PZDrrPl1BFKnh8PvxM1ZktA==","signatures":[{"sig":"MEYCIQDbLpGT7+sXeyjPV1dO2ldf/8CmuL6NyQo9wrgHpXlspgIhAKAKEX0BKnuW7YOEweHUsx/iQFAvCa9pQ6SpllHw955B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1363935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8sKNCRA9TVsSAnZWagAAuDwP/jIZnaCPn9hNiUE99GKO\nCcNQDGyiNOsg4ity2gvL0jk3rsgHg/Y2bVd7tY7fc9Th1eHZjsvG2y1W76H5\ns8ypmmC4Y9J6MV7C1pIrIEicsKNPN/Zu/enW9Vhb2zCxFQrXS2yCaNgofeey\nRKu9MzwlG42IdmwASkGjwqBEnXvSn4HO/kRMJpa5yQXQP8qTQl+CyQbAzTk7\nDCQZ2Ic9qXsn8BLfJHUoPbZaltIsNKjV+mCDbLvBBCkcR+eCB52TUYEzyXiu\ngZTd045S2QfHYT56gHMme2I4toV81nf1ZmQZ3L/5tTWJANLQ79NubkeY06wv\nf5GfA4gffO2cN6Vk+1eTR0YILd87X43JWogsLMOeSpEUGJEAxwGA5LpRc3TJ\nHTGrmcRYDJY36ia61I2jRvKp/2CKn43U4g9C1QNrS2dH8LUyMG819XaTrwDA\nS48K44UHsEMrRc4RnjeVBTvS7JNi91/PV0jcmx/kc/EEzO0rNIBiL1kqiKfC\nE8eYgew4wEshyFZGdMg7kFXeYhPixtmGqR3n+4f7Z/9HuC0opWE6AbGG5R3I\nHxWFP3mW9sYrDurprkAKhxQD9WqGVzoAjIYMy8XneMbDIdYjEObiwIn1kTbr\nF8a4vOl0F4p7yHbjxSzqvofkpJkAUuYRpnliX9CeizP+DcwRIqCZyxC9AyVV\ntgO+\r\n=p7eH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c2d6f36b869ecd710dd9de70cb51d20b37cc24fc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.25_1643299469250_0.16339170470432274","host":"s3://npm-registry-packages"}},"2.42.1-canary.18":{"name":"@apollosproject/data-connector-postgres","version":"2.42.1-canary.18","_id":"@apollosproject/data-connector-postgres@2.42.1-canary.18","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9df2726d83bb77729a08091f6873164b53aee514","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.42.1-canary.18.tgz","fileCount":348,"integrity":"sha512-bkNv/1eKYBCbxISYaPkI5s/e1Ob9+SZMkUa/GlM2iFBk/x9T2Yqt/D1Wurr81ZU0pglO8wcCppMnfUIBYsuoEw==","signatures":[{"sig":"MEYCIQD9Q5OYN+ntqe5sozKn91QWIRahO0cZEOVxdhTV8RN1qAIhAMz6uzQmrY/AgQW8BhYrmnrCoc1B8R3gzxi4tXvKb/V8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1090899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8vcICRA9TVsSAnZWagAApfIP/RrT+kmL1whtPSjWaF9w\ngtcUf115hgXVqajXcI66B4AulZaZKyzGNgbfb6oHuzuBtatHsuotSZA7/Rpr\nXauLtyj16VzLUshTlNpaMfGQhVREO/mWSQ41oPMLATGE5b63iRyOKEenMbhA\nXz1ZHnZ3T6PKzJyJ7tn+b91VMwEoCAHr1cofD/PbVKzlE8El8S4j0FqvfVb8\n5eqVW6yhykSdfDEhHrLbjNG8glqpu5XQhtC3LxZCKwMbJGtIC8yUX1qHSUVl\navpEmbEgANBoIwDWGEH5X5TYcSxLv4bsMpuRVXHK7tO3E4zCmlR3ptCeWAXQ\nHyd8/gHlcI8f9M3k6G3VfPN9ED69NbjbKVuTg6rQ8WWRC8KvXTzFTVEQZLVn\nrmaAqvE3snk2Gh55Ap+DpOLG5SOPokSQpE/EBpqjSEUjQEftfEQ7WPoN3uGE\nV1CbeYYju6H0sc+iZa54uNYBHk/acfT4zFn4ktjiNJsEaSFLe2aZdA2sbIP3\nk9HNe0bb4ZiVGkQQjtqqTCqtD7ffYp7M+O+IZSazHgGBaOriXLOs8BmZ5hNs\nnH12uRABQdPS9dvMMcwxuAFPzRX24dLHANzLSg+j6a9XNTP8NRb23zObtbZA\ny1sJY9N2Z4QpczCkO9EuiHO0nejQlteapKomCk3FJv+QgMvPhGd33T/93EA4\ny9ND\r\n=62ny\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f95a5f50625035d85e5b1dae3415a62724e9b894","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.42.1-canary.18_1643312904107_0.06119984597418249","host":"s3://npm-registry-packages"}},"2.42.1-canary.19":{"name":"@apollosproject/data-connector-postgres","version":"2.42.1-canary.19","_id":"@apollosproject/data-connector-postgres@2.42.1-canary.19","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"119a4ce94109c202cc4eeff63302642191d904b4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.42.1-canary.19.tgz","fileCount":348,"integrity":"sha512-w4weDLs3Msy6r3FHuVXriKmdeCQFNswOGEL7Ntag1ALesM5Yd51kyMmGDYEjRNp39MQjmgVTpL4R1cSbg9UP/w==","signatures":[{"sig":"MEUCIQCMpH1Xqr78YHPXp2lxfP8eC02/OVrvsRKIZWmK6iWueAIgBHItWL4vHddODXfKewbnt+qMn8Rpn3Ozh8E/IhWT88I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1090971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8wG/CRA9TVsSAnZWagAAicYQAKF+XGC52hbwwKbAd93u\n+6gb/fzUqRvT0tvQUmFYP4p3rlo+J/YAQOz6tT2CkUihsE6J7KDH1ehvOcKN\nn7NofSnQnaCYBAGxFqz2tR14/xgczR9yOZD/Q+kmRr8vJk/hvQvONf0dIZoT\nfqojkDOcTFtyKBIM9KY1ZAEpOw0EI5WBSE97aZgmcI/wddEA2QLfuAyJ+nnw\nuSbxxSYUYjoP2sSSfgJjwxdREEKj/IZjgQVTdEhYGt+kBquJ8OkY5UvtizCx\n1ZNE0Yi+/cTu9Wtm+A25iHvYbwWCs6JMUAoTDuahm1EXGM0McMA1jOoHfYds\neOH/LUbzHwaKOkZIPZ35EAOlL18RiVc/bUt1hLWvlUmbYCzC/cJZ5J+Ndm9V\nRf54GGUp01zHOcps6bsFyexRYjF+wAAc1KO9XCsVplP/QwTiDGU5Pb9VPVVX\n6rqFnXPTAw+lPahVO5JG8ObLdBmgn48BgVoueeY94MJJBMbd2ioCBQ/9EasN\nfwUUBVVNX2XEwU1woMW+dD0AHQatPe6zEi5EY/qD8whmL34CCtyECNrq/Pze\nGHM5GQoiJnc3KCBsh31Z4dt28QAm+Nvc8zfsJZIVBVEAzj+TnrAG7uuezOSM\nwMpMQKfKz+ZK8gC4e/TRpFZ/+/p8HZBdIhKy/ehbMVoSjufoiZmJzPRjP/A5\nbxNT\r\n=jL1w\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"47c5b7ed50c985cee56f3c32747573eb781f75b8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.42.1-canary.19_1643315647256_0.41612129196824643","host":"s3://npm-registry-packages"}},"3.0.0-canary.27":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.27","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.27","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b3188149999d172ed9c5c2c5a23bcae23bfce471","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.27.tgz","fileCount":442,"integrity":"sha512-mTWIKC59fvuEf5Ef9Y3OdAzE6Q3DRHiJKurOpo2yP0DktrFFun7ZCuBSFCAwBOvvdLOPJnGYqPvhsVHxlpr8Eg==","signatures":[{"sig":"MEUCIQCykdJsJHU7bz2FqRLYbwlXvUvncvdrmqXboWSwvHNqGQIgUx3EqOW1uwa+luHLSzJzeuUXWx/GZl9spfPv6dm/fFs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1363319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8wIrCRA9TVsSAnZWagAANTYQAJbzWLI2s9PcV3K92V7A\n91fiYT9oI0mUFNU4YYwBDcjgyqMYI7MmzqbiauzxKEYYKFw4XxDMVohRPIlN\nDhgBPFu66Go64ZsENiKE/lYVnfcMY/LzqUW2zOS5zTq8FD+47MBKn+xD4Zs9\nQsuZh5SdQUnUjB1OSY5lM9MV0PsWKhsGvWmdU4lm0EDBWJ13F5UAvTYyVrVv\ntC9hatmAXwGpslnQmq+9dnw9j57pf7X7+8GV83UzRKgHBgUbJsswPEWrVtSk\nu5+OxsPZtwVQJnRXmC9/SRH6N/aqZSpKIDSuXewXke7MVxG0gD+/RxtvjDV3\nfAk6aKzfbQF6HjaacywOLlvZIQZOHz0/5JJu9xmuX++56mUMCcy/wFTm0UkT\nB/OVWO07iQw7XniKI5ptSYn2m2TtFRNod4JVbwCheBECaI9BmX6Zollq8OQu\ntd0HPnTs+2Ox8aBmFTxAKUxqUqKxJ5YVxD/mfSy0zF5gkPbnLMw8x2lBFrSk\npr8yIfVntKRBvBJnViDQ8JVnDpUor1oE4LE21uNHH3niXOXw3k196h5z0lhW\nCzqxYZ2IFBeQ6NQJGwafm6YnWxOQ6IS4JPua9NJ+4A39PJvmsAe3WrdtEJ6b\nZ/8+otdqWepCZiz31ZivB829GNcpvXQQTQJZcVDqDUZDthQhxTz4D0a1sjrx\n6/Lk\r\n=vVWu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0161caa188166d075dfee3bfbc7bf4f700d82f7e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.27_1643315755023_0.7490938728406884","host":"s3://npm-registry-packages"}},"3.0.0-canary.28":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.28","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.28","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"522ce7bcea756bdbbd37d3c60a5f36f661a7f7ff","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.28.tgz","fileCount":442,"integrity":"sha512-nvzevYBWRCmI9NO/qWO7W0BUzweVLQKRDvzmnbbRCtpCeJSyv609JERaEMuTfzK/4ucdDSiiYDl8sgjSsTw2hQ==","signatures":[{"sig":"MEYCIQC4YircsQ/naeZk+blo04GhHRx/DeDQL8qFOHwA3QZL5wIhAKx18saK6XOOmORnG62wuRvg7whC2VbUWpQCeksyno2i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1363389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8yTxCRA9TVsSAnZWagAAT7UQAKPC/X3Fkv+YDF1S3Wzm\ng6r923ZljIMfI9RIQGrtYD6CnLJWkfDT5aXTInGDpiwVW7+/mEe9yzmsSVlk\nkCLzjfOBnoEiQ9Rhrd0L9m5wQ9tYqlQU3tC+VRXh2x2/7V5dpCKJKDOjswxS\nO8T2tYzRhYefE/OlFi8cIYzt+LsfEeNo69VRav4JabIrOIKzY9RCLA2ZT3Jn\nXgoSMeFwO5YSHZhGiczK+rQvkw/0FT+ET4QOAPAlk99baVftK4CWDIfydhC3\n9Jw9MQviiUV4F0SNyzAaqNDWVFTWk/Dj8mHtWjyRFRixGZWIfIICyiteltDI\nYG6TV3gUjF5Lp0Ripo7ExSZyLg5C5oXxH+blrvCRduh8fB9c/dy/wNDH+A8h\n0Zjm/gY2LeV8Jq1FVZT6+0IuT0Z9HAUnS8q3+FmpN3dvvyF9elq4wuTkSAkm\n+h/aalKSgdoKhFHWKzBUp7/66XWHcmcISqfm6jNCjsAXYHL/rKMRBGmNcl+u\nLiaBaJtwpe6MhrBtu1QxNw6mv9QayWYibXqE6fznGTycJnncqWY3C3qogcsa\nlDLT3jK+V7Lu7kAbIbBHLjgWJliCubS6+5za5yCLSDgw0v7O3Cx8b4sEUmDz\nyvPMzOAWYva/ZGJMBope0XD/SQue0cpnuM2PsdkYiP7J3VGtG2JOstHaaoWm\nzvJ4\r\n=0tW0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c05d93e984b6238be5d7dff9e0b45003f0abb6c3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.28_1643324657109_0.7713562159148437","host":"s3://npm-registry-packages"}},"2.43.0":{"name":"@apollosproject/data-connector-postgres","version":"2.43.0","_id":"@apollosproject/data-connector-postgres@2.43.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7791ad740ff6f410512cc633a32e6641305fef63","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.43.0.tgz","fileCount":348,"integrity":"sha512-YKIy7c+IKBFF1pAV8l/Zqz0+KN1XOn7WgjQgpeo9O7o1Md2Maa/7CcFyAuWSdC7atw6THPnxe81B6y1n/DpJkg==","signatures":[{"sig":"MEYCIQC9/k8kYh5P4dfXcQwYZGGEoH/0vaZUIQrtDzgouHNQoQIhAIfgFuf+zjp6Cor3yLK0gAKRDJO7fNfrhddDw4tSHkdb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1091702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8yV1CRA9TVsSAnZWagAAgV0P/iHH/WSuLtxIvrlJWC78\na7n5IKaw2N0CcGBJfeuuUTXWsnqRnp/oOKjRiEF7fBE7mnJnPJoLBBH7sFji\nQ2W+5GCT6OJadCZF+rJ4d6hbYhLxpYRqZltmMieyB6sB46EHDKiTdVkxHGoj\nLylF9aPvLwOAkE0sHf5VzDxzAnS3GdOyW+Kjh+AH56nQW5eviH7dEIMuLsXA\nOEL2oeZ9tfw8rn5SC2LeJ7M+TFV/mBKH0V/NJ0oH+aoYik7zdLMLQ4id99pc\nT6vOEPNf9HvO+0Q4BYDai1HaATAEborGooaPaRxJ1Wbau9rqGTW+RYHUcL4x\neWUa9vUPO5NmK4AjI9yjtKNNTMx3+6H1JdolRNHRRDezgZ/zX10Mdo6rSDcv\n3amkRMhBtW3t1x23SmCmaM2LnSOUdPl8Rfi2l5TXXHW4jFm43QfLh+hLdShV\nW4kZT/ctz25Doferc+VaWUn2pJcmBev1aNw4kX/a8oCbHmmJq3bhnGIjxz6o\n3CFACvb7ouEnBQWFNINXp0R32ZugGwb4Wen2tZKRKKmrVdXyfTLXKDstfC/m\nGxo3HXqdCG6jJSdNIyA5fJeRfNRXmmuORIGjcxDZldnAxyJQBWYrzO9Ro3iF\nw4sXxKKvz/hn3gnr871lB4FW1x5LWuAOOpr3kfLWPKTs3g4Ga9wRsgaWa8TY\nDiRK\r\n=a0BO\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"d6765b891d1813cae128ae764c7bfde6aee3c7c5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.43.0_1643324789415_0.8716398669787497","host":"s3://npm-registry-packages"}},"2.43.1-canary.5":{"name":"@apollosproject/data-connector-postgres","version":"2.43.1-canary.5","_id":"@apollosproject/data-connector-postgres@2.43.1-canary.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b29fb22bafc5566f37936f51b324dd748b87fb88","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.43.1-canary.5.tgz","fileCount":348,"integrity":"sha512-92e4pCXRih+OL5fL2TYQCT3IAOLnl8+b+Au/55/5zXQsd2DvWn8tO1kernE/u7SDg80bMvqAEocVwsx+Cm+qgg==","signatures":[{"sig":"MEYCIQCTgp0D3vSSC21PhGxWu2g4/i52L+OxdpUev92jee44FQIhALyQ8L/qaM1wQlkwpaNVKelDEwEuXSUSSb5BAoRTVz5f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1091720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+HBMCRA9TVsSAnZWagAAeQgP/A/K5FBjPBxF4tl7Bib4\nn8kXxx+ElJWTvEx55bP4hf/r8szMTGf5/f5Abqw/SkhddZg/4ce3gPcMacWj\n1R138wUM9XbMWXaGQHM3uZ0JhZUY0eWWn4m+WqJx+OCRS1lpPMh6F5dYr9sO\nbFl46ZSU8Zj8IcV2CjG0hV7Xa0UvoOILzk9JnJE24RW7UjAX/B7sMUVUn/NR\nvofJsm0JoathUgCE9ARcIkQY+Tqsq4cWdGi0kfs46aOsn4ofKm9FqmYMxrYS\nUDbJLay0sNHG67OCu9mA+95uLOVpBne145EiFWHSLsPEbRPniJEJ3ozG74dY\n+8bTUo7cezzyf5i6ZFQrkAc5Is52Ab2GnWl7Vcrgjk3sfdBTrxwshqK+7QjH\nUBpqfCPV8WBTBtoIOeeAvwk7sdxbddmtyFqs5klaI6PMbTxoag01V2tFpui/\nsXGIY33b8ZuVPy8W4e3y7idJra1c2/4cxlRaoOitenP73StP1sAfpQtwKD2O\nv+y2aKTzTwhg83inw54E/w3kkgySi6//wKj406cDJ9yU5g0MRju7DaY8uWHD\nlPw1gf4p6rL7mrzZpYivOdCne0WqieriNH3IREczX0w5i2RwYYLqgaY3yoyG\nYxxiqgDGLrUQCS1U0cTUDxj/nYOFeIdT2qIeczKjvIBewFdHG0ptG7U4t9ch\nH9fM\r\n=cyUJ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c4f87067a31132eeb4c7c2284b5ddcc14e3623fb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.43.1-canary.5_1643671628536_0.860003210279461","host":"s3://npm-registry-packages"}},"3.0.0-canary.32":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.32","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.32","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fe9fc9454df3e3cc7085901f6cc0d7a0903347e6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.32.tgz","fileCount":442,"integrity":"sha512-XO2KD85dKyb181WuCbiAja0xEvdX6VZBLCom3I4VLPA7aRK4cSldqF7swfQMRpUxH2uyh90MAMhAF4PeHb7tbw==","signatures":[{"sig":"MEUCIDOV9vNojQ9i57NN2nzIGvNhYZ7UGEM5xIcSMeP3ChdAAiEAr0xtax5oUUE5/E6PQ1Ij4zWISdKW7824JGOi1c/GuYc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1374403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+TxdCRA9TVsSAnZWagAANbIP+gO5hFVzbbacUSFKrTKO\nspyFeQSTiwlQiV0P46O31wnPGqvgD7+UWndhxwoY/czVCXR4uMcdaAFs4F70\nEVOJ6CZBNvWL8xPUW+a4S4CMRPFqByUTYbuHR6HoBB4/G0++M7FcQO8YQGTw\nSYRxc/RkiB3P9kmsUK6bkIVH9I3+An3jzPWx8zidbNOAjMpV95bFdgG3zvo6\n+ecsgjsnRFcE3bRP/elcAHG318O2abUMmIjyuEP6YaukDEQkg0QLGAu3zHZG\nRRj0502zuqBxdoBotoq6YFXlwhv3Gx1WWTV7zmkLKcXRhEP1GrTkLMlW+uIO\nTcANWfecV4ssdPLaGhk2gEXzx021UhDTtjlLBGh2gRC/zWklx/aY+4BzV9Ta\nToZWBnkdnWNkn3sEXCy9koQIWqkAeCQAP4NvpTez4J7RIsSJOZXPiCYLuItW\nGHXMQf2PYRJR7/C+7FCwetJPaJZpp+DOr0r+X0siEEU0hqtwsRM5I4tD3AL4\nwP1kK5t4IRF4/NgEXSylGW4Yy1fcLHYtO6Oq7JrWHw5hdxpgkqHaiy7Ps1Oq\n9l25PJ5IBrt3/9DWtcOqmiJxLVNZ7B67xSYNl5j/7VjDUiK7f6j7yb3WFIN6\nArxlpXt6zaODFaGJwF5hwOU68ikHvph6GdtXM5r3Dt/Y91+6POFDLl6mdSRg\n7JXy\r\n=eFM1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0582c1d75d8ab1a69b9f996fed48c99bdac84f39","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.32_1643723869461_0.7073356973591349","host":"s3://npm-registry-packages"}},"3.0.0-canary.33":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.33","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.33","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9e2135e42404710526440e4dbe28910ad421373a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.33.tgz","fileCount":442,"integrity":"sha512-GaBAYYaoIjnie/QifhJqFoQCHuZSA1+79ZuvmPZZKrJnqzGH1Hav+Ga+1h9yTx3+a0PquUF/4P1R95Qlp5nlpg==","signatures":[{"sig":"MEYCIQDsBHYdal2gmENhOezje+CXmg7lXdjlIxoOulvOv3S9wwIhAIUgM3vW8+CVca2pOxgHZIlAIbkEmD101t5PIIwdqFH+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1374504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+VG7CRA9TVsSAnZWagAAYrAP/jdb0jd+MHcUX0kshZYm\nxUbRRXEpSKfs1e4FgAABQN5rwXkRUxzvLIXW20Thr0f+aMFOZs51ONeUKfvX\naoXk9Z2+qyBmfq1KG1uj46RnMJ0AakJgwbhvk/IkkDhGOoq10gVuDjRs7aJk\nqNZS53vjttCWKXeCyFGVVXUqN4AScZ0lnMVo3JK4jRBuvelVMdAK/QHKeA1u\nr6+yWMEWIgX4IiX/H9miAeEBDcyDLX5PGmrpNFwG3iMFEY7WEbql/v8LywxG\nBaJWcEorklBM6TQ7HmY8fo4yCZmQAyesJCKHccH0QaAZDfsOyiKXUdO40P2u\nCHRfaJaq989jqheNSH7+32z9468wHN9C3Sn+a/2uwWa6Jy/4GzrBPb3ARIPi\n5v3D5Vr8T52fA1nOADhfLWjOzLzSvw6VaG/Pg5dVQA1gWeOsOD6jNA80Y3gg\nxvx1ilKS2TtsY72s34dRvpJb7biDZNHwd1zR+FX4OTtzmk8x7YYuqkib7F5T\nNs0oQByRtcPdDthRIS1u2TJI9xGYD9p9FHEWQw27PjHlExWDv6mj7w0bEjLW\nSAgFlVN0/y2RAA+AfnV8/mhYmyeZ03lejVexuZ2aawzfxKvuNRkvvX/UUc8K\nOJ+HIyGhPAfQbuJbiZSgVt4G3OLNeDWdbJLyFd6rJrXGo0KztGEgvP8EOx0R\nRnVE\r\n=IZbS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4e453d627cb0e8714d308e5eab737654d857c453","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.33_1643729339632_0.8055580582985828","host":"s3://npm-registry-packages"}},"3.0.0-canary.34":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.34","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.34","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"742c05a7f4ce78e4259d05946c86a277a91cbf8c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.34.tgz","fileCount":442,"integrity":"sha512-dy9WALf89JbQqr9nRP9aR/f7BygQvUp+9a1NC+gMhPhiJ7Crhz5APQqPuEwVTnXKslQFe4vlSzeYBoxvd4xmKA==","signatures":[{"sig":"MEUCIQCZjNVQD+nECtNhH7HvrgnaBY2/eKLL9+kj54AZ9WZSWwIgKukur+uNzvm6ZiLpSC1RjbBvet8yySkUP7yxAm3tK4M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1374634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+ZCgCRA9TVsSAnZWagAA+SgP/i1HHK75v1ZF3XgRqORk\nNYR7c7dcviNSeMnDY1wcNG+GBh+PDqLDOufDMptXuYmwBvai4RsVYSQJuNZ6\nl2AiKi49Wvv6Zb+QVN6Zg62TURyV6apB00bEwu0piqZIV9ZHXnOy1qWbN7rO\nnfwQBBWpJpGJqreG6s7hLv6eok4J4eAucZfm6DY50153IctSoXQ/4qycH8+D\nRo2q5Vb4oiixHIwlIFfRv9mkm8LYR3aUplHVKmnncE38lwFii7CygBksv4hu\nfVCiMttM57m9pTYhVbS19bZMvglcn2C9ExEhBDd00p0kIJp78YYuNQ9mYIQT\n8ejD944f50axARsw4nvmTAQD0i4TdyXSna0T4nMkQClmHoO1HGdSwxbgCyzz\npCoX4zhW7AAvI4itETIORrxJ/uYZUSUgWv9Vi80RlxnYn7CDmxkJsQoJbRL/\n+GCrkPh7uwlcOmwOeB5lwkzlylpWBA3Wfzi2RQEXYfzlDufnWHxTn+jEOHjo\nv5wThBdTwwigua8MFQcDqkCcR9VVtM/j/wk6sA/Vc/UjsJzhLMV2+4fVOBWT\n/ldDg60v2B6rdapKayj4VSdfhKCQEqAXxtVje//Gzc6zuTCx+P4pTstU/dYc\nB4LJFEVJwpxzLK+k7VrV1BqrISB8J/3Bb0jv/u1LpI58b6K9BV3f9ftOf4i6\nmXGX\r\n=18rR\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"5d25ccdd2e1449f51263848ffa5ca4a0ba40ade0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.34_1643745440380_0.8490328068725674","host":"s3://npm-registry-packages"}},"2.43.1":{"name":"@apollosproject/data-connector-postgres","version":"2.43.1","_id":"@apollosproject/data-connector-postgres@2.43.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"611784fc9edd13dc73cfdee02c1d0d867394bec9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.43.1.tgz","fileCount":348,"integrity":"sha512-SQetmft74XI9XcGqpq2iPIc634ISIeB+OYbtobUGG0/7nyUh71cXvyCfm4iEt2fmepXAx3z3kfsIeZ5k5I7ptA==","signatures":[{"sig":"MEUCIQDRvkf6YNcLaerWd6tLSkeVtv+GbuKhWQdbT0Ex/zWDhAIgC887lWtz0FbQht26Kf8EyOTy3rILhjqSr239fH/VtRM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1092080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+beWCRA9TVsSAnZWagAAWvwP/3SMI4qTOI2qRZENWaMj\nNyB+uTr7cq2fGUrRb/KkajRyXrBtvaBXzbN0FpXH+B5fDAjKDnAy7QqJMvkG\n+sU2PINDVBMt0m3PyTy8dUwKFUwnVv+6j3ouj5YKNWY0rVzrGYhL3U8XLX1T\nSz/nwvstLOHPWdJBAhXX0aTiMjXQjVtm1cqAuNoIurskIEDQ4Y/nwCpTSa6B\nE/v2qSLlkqRkD+ZNP5d6rOQNWdIMPbdBOO1LNwOsnazwsueyRCLTVbHMipjI\n92QNruzvu7Mft/XCpP4jVHYxEuM3nEsWvhKIInN5HAZ4sVvBEVfts7jLsURe\nqpL0Mv6tKB9dnW/txrd39+58jyFYONpUF9nSrkEVStdaepHoGVzbbyZdTuOU\n1Qn4BFBStRNeuNYYRMyCQi2bKv8dx7HnYM/jIN10TF/Iux3fvc3igPI28tAt\nZAR8WnTszMXSiUCMN5kDshxFvh7tS76EeD9bSTq4igycfozm7U2pQxXT5sYl\n+z4DTJICtA9wr6LDbi7LtPCaHJZ2RwVTVkv6D1n1KGUSIvtcf87XxjACA2l8\nPlnYu/3tSkIi/A4Y/Lusribo58L65Yjc/HBMZnfLMYVa20IvjN/1Uu23zpFG\nzvObFLlTkuTPPiAn0GZ/jbUKKZbSvarj/E3nLmIQIV3BWs52MmcGU2Ra7m2r\nJLNY\r\n=C18G\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","engines":{"node":">=14"},"gitHead":"7cbe3d1415d201010e932e19519fb20ee661308d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.43.1_1643755414095_0.5783154952238274","host":"s3://npm-registry-packages"}},"3.0.0-canary.35":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.35","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.35","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"652855f2b93dc1e045dec0da86e0adef2cb9799d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.35.tgz","fileCount":442,"integrity":"sha512-5HYXs8hyd6rUVDwswnlyEFZENQj/NVqpI5d2Q3cnEcffNusMQWDlaeUej3Rn3JDYeTTQz5NiflXEWOyS9l0yQA==","signatures":[{"sig":"MEYCIQCQXKS58Dd4kR1jUlZa207d7xSjfkqj5F2+rJbnad31vAIhAOJwEV1gr7BvAcSWuiJmJ4qVN+4Blf+4kY43NQ9ayUj3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1378515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+pCkCRA9TVsSAnZWagAA91UP/Atxz7VVMqSfGKe+Xg71\n6+WRLnl0SxGzzrgsUPiaCK4Fw8yKjh5TPgNVSok23755nmLtl2bjKr4IYfkZ\nNzDrgPBIUDGZkWISN/WbnTpOVZH1lv9OaoogzbXCFh1BE7qT/VbWlKiYPaO6\n3/WmiPcJj8PGAlLe4cY+MNvidbi+lnwV3sd3Qli4Wy3bwZRUNRoXAfb60JPy\nDLhjF8f9T1b1B03j8Y5uL5xPQJPw6rHwuClryIcb0QWe/UQBTP/T8NFvVz9S\nYCngg+kdEJekj1ZkhxmkfjQ9JirtitI1iVaEBdo6O08IVgIu3SfkQoXcwMH3\nM26tJFk1N2DE0KpQNSwuFI87O9n4uKHpEkx3D8k4LV2VTCOmsxeeWl6gAJvz\nLdjpi/yjbSUSjKs6UDjlF8q//c8h4a4ejJvWycEU1etcWGuaIyCdi1l4LHNB\n4gUCEAEYQs6Eg9bDU826mIFhNWm5E62nShb4QQbdGigiXEWBZ5eaTW1b0NSF\nzmf9CZ4xV1abbrpFDyoBf8YoAe5L/yQ44R/NyjhceG7hB62Maf37Y9gqtSGf\n0Pgno4x3XvPaBSYWXkg/dVbN9i8UKhMhPDiB209dLbMQ0GeJKTuFS76Y/iQ2\ndHzyjP7ji36E66VzyyCTk47qu1fwmtE6U8lSGI2maRsL6Ln4Jv4LcKksrXMp\nTwhF\r\n=HWe/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"eb0b906fe06bfc054ae36ebe2bbf7d497174fa53","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.42.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.35_1643810980081_0.4874825623994137","host":"s3://npm-registry-packages"}},"3.0.0-canary.36":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.36","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.36","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0836e5ae34130e6594c63d8463f1224b861a7e6a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.36.tgz","fileCount":442,"integrity":"sha512-l6vb42dFeL81ny4nTm5Jr9K4VaLhMTu98EN+LrHHPSQZfHPFIMm9OUpvdbGBDl2O2lFFq4Y0D0isfHKc/51MLQ==","signatures":[{"sig":"MEUCID8ThkwQRxFuAAhkMGpOhVhENd/H/sy4UMQtzlLm/j37AiEA+/lwXYKyZPJ+0WlNxWghk/KZWWREt3TC2DNCmbvosZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1379661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+qA8CRA9TVsSAnZWagAAzNkP/iH9EJ4+NYqggvzrH0sY\nQRPrrTTRsx+BvNI7Ck6rBT8LsmykhGKONkR12936CedKVi5WplkdKCKbKBBi\nh+Ah2X2KZJK22i4eHZ7ouFM2rpsml0+OyTCQYma7ouDeE9KrAXxNJ+Y7lV6q\nkb1LHsim31FmRvEn0rhUF7ovnPu629OweYW2reZeGqaWceQyPES43AiE8ExW\n/ADjvelDEfencHn/EDRYoYA+NRadLcGmuKbZN0HGF/HiSpXn96AAiYNWsTcG\nIQYLOgFHZMW2rHblgcpiijaoDDNwaD0FIjfha55bLcG5Vtg9GjE+4J68PCHh\nZ4Aj6swVxJsLwVwhu7RgGV1PkhYg1fDXn4Vvqpy+Hikj2SfSFJ6Mpr+quKzh\nw/V1C+7aqsMZ/275Ngw82Ozsg/f4wl8y+TBc5qvSJsFYKW0h0VlrPZwtI/um\n9nNCrTsHis/QdlpXINbORFeFFEtBQQchiPPVxIHqIRHMli1zpV4LYdds1kjN\nl5O7r9DB92ymjN/uHQL9iZRF41yfCRLtf/YnwUQwUZxc5m3rBOHSyivK6NxA\niMJAoBWS9bMvVOEPBUoTZPxjL/FdipHPnGZP7Mkp3FDw83QvM0KpFlzzcm2w\npBaFoLD86f2q/QBdU9CiAoDLCMbdHuD117qJSSjZm3O7DNnkotkqKdXTu5km\naYJH\r\n=dS0U\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1db55d6b0134bef10b649811d5ad9950d02ccfc3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^3.0.0-canary.36+1db55d6b"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.36_1643814972057_0.8285969069482748","host":"s3://npm-registry-packages"}},"3.0.0-canary.40":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.40","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.40","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"028ce936e92527a3034d8d9c03cd072f2cc54bab","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.40.tgz","fileCount":442,"integrity":"sha512-D4g+aiQ/LTSd5RJYSKgGJ27WSmY25gRxF9ZM5eqy/equyxgZBooLGjayNOhKElMkWPKtId0GG8BPS7iPSFPWBA==","signatures":[{"sig":"MEYCIQCFhO3rkDvw/sYYJ1J8X7vWZvEdxIhlyp1xP3dX1JxBggIhANW6LB6y/lzjpHv92urUc5YiDboVXBUnS39+IX9zQshp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1380844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+/GaCRA9TVsSAnZWagAAxfcP/0m5cs7FZTQD9FdgQv5u\n9c/IYX2vjbqBVqVjpf//UC+baP+EEL+hAPdUf5Wf/86u5USBwW0qOfPpi3jX\n1IFRDo7Cc4y/OA7MVYoH6Hus5TPF7V2ioDw2k8+UThuGMMDyarkGdj/YFqko\nfL7HL0W9XEGykdPfDxkpscpXtaoiyFDzmJuPzvUDAxUH9vrYbnRZ6VVFHu6c\n5i7AQjiapH6w1/qx7C3y8suXEnwgWe7hYCmCzKRiHo/KWskqK5ynf/7ynpR2\nwEVv5O7JwzdtIGMIpj4Gnc0inMrWBKaWPJb3ERcpYoCwzEEKUas8Q4GYwPa9\nt5xPGAsDiObLBGOjUW3ql1fskNIjjGSAPqeihn8KTMunGMg9gDCWTlcIZl+W\nzJ+NvbRDSU7ou8XKb9XhR7fTOUZSSmsRhh0Zfp++jvUwAzq7woWcOcrtImRi\nKHa9+ywwCylmU0pzDbArd+QO4TVm8djIzbEmYXjbeaAjRc3oODC1Ojpb+BmC\nes4mP8Ww20te3kLgJonHZO2LZZ6/0MplKVkkl+uG1Ue8vYPuSHL8EXr1QGF3\ncBthEe1cstPA1jplm/vhOjc4YgsuTWWQfbg8ofIJywDvOHjPXpluuImF372q\nFk8xt17gFcjASzBGrOP4AA33e8Y06fJk6f+3p7qtjE9nUSKXB6I4twTLWmap\nuDzK\r\n=2QpS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"04031f6fcaf238dd01e3c929998db86c6f85a624","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.0","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.40_1643901338440_0.5158778907444499","host":"s3://npm-registry-packages"}},"3.0.0-canary.41":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.41","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.41","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6ab1658a256dbdc9661d0df9d6b3e0e3a95a78d9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.41.tgz","fileCount":442,"integrity":"sha512-1rkonzYoUXZcPswZPNzvRGh0wY+ip3LNw50UUsEQHDAfhzf6h5391CigbYJ5qS31+t2/sU3D4V7ZjDMWMVrdvg==","signatures":[{"sig":"MEUCIQCJiYEzUoiSyK1emVTBT7wRFb8WV8WLQ7u87rHE8WqctgIgfaiw6stiol0NOz4WE/xNqYzCU/FgsmHeBLEgF8xAObw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1380844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/AZYCRA9TVsSAnZWagAA+QIP/RANCZ+fza/EFeJ7PoeO\nBTX7eFIJbhR3MwEfb+dsY5i4IyDsAOhPExiS6LGoj7BbPGTZBW6iqyUFn2cj\nziCl3d6ofKkd/DKmu/D/+aTunJJiU7KAlC4mxyZGUT7bPV4JSsSrOaEUOR9Z\njnZZ9dFgBJn2IfM3W+3dJQ63wuixnrebdCDpyR6AwsJseSS/vfOSAQddv2iw\nGzIaMi18IWMJ6jlG12LovtCl2exYn+ci/YPw1DAkmv0bOeD2Q9bo1aG5Gunq\nclsuWv+GbQiauVGEkUg5WEXsDdGQMDxrQ0+QwFZhYV7iW7dc6so394AD6IIH\n6CNml+D13u6sGVqV1/AFXk9lWJa9h+L+gsBNXavT0Ewl15QB7XzrYLexboBZ\niOmcqd84nG2lqb7/uiXl07QQrFyUBtXbzSn82HP1sFYrJMh48UE+PTH6Nflr\nCMZLpr7LPxoHqQOjBT0qqHXcvReuC9obbrvFxmvIQ3YTvCkPzlvU3hbLsGBh\n8USW8Cnz+DOmopUuItfwH/9Oqi9k/2hCJFjuFjdB+DuWogE/Uwlr9VbyoAiP\nN/mwdYNu/T7zFMgt2lVvjFiD7+Cv+Arx4WihpHfCyVfbYnshEZXr840ZNqLW\nENIPgDn41PdgvytfSwsODl4km5a/TW/KL1372KZ6m6+Bf6NKONKbyjYs+06Q\nxYKh\r\n=hdti\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"200427caa0613cb33fc59ac83821e12929e8af13","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.41_1643906648147_0.5000278529172617","host":"s3://npm-registry-packages"}},"2.43.2-canary.6":{"name":"@apollosproject/data-connector-postgres","version":"2.43.2-canary.6","_id":"@apollosproject/data-connector-postgres@2.43.2-canary.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f3a485af8bebda0dcf1d040b5044cb2435052cb8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.43.2-canary.6.tgz","fileCount":348,"integrity":"sha512-cwcsI5gTxJhEycrwgezYOJwXG9Q3WMl2a7ByL7uKUVT8TmxL0ykCHgAgH8wopVsnfH5AmzsIXPNRwY3v6WRjng==","signatures":[{"sig":"MEYCIQC0YuhUrDR/137PK9/oq0cOKV+EiGUSIiot91r5rC0GvAIhALTgZFT7ujwozOWk3S5ltE/bn9sNsaX6TQkURCGeVksK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1096140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/ByICRA9TVsSAnZWagAAVlAQAKUtYqitm4xnYi30BdCX\nEeeNTWZkfqomH+Fj/Z9w5YdeM6B6u8DKQYZat5le/vM2w2C/dZZHJiSmWAD+\nxYbtXiDD/3IGcypgtUPdI2CLRSvnnnE7j1/BaBgAEBitWOZfYUw+fk44u4eW\ns1lm2h9jBwlCPTdKbGg6NnS/bSqZ72ZX5CuHTiIuBSoTn0YkzGYkiQ6qUZBK\nXR/fQszKvlB60/tHwad416Q3cD6JRxj/NoMjGVPE5NkoJ0Xal36CQvtSMxWl\ny5xcXj2pLesRRepZKQ2HUuh8EwxzunXz83RAxh6EMtpR9oeZqMZNcJPwGl3X\nolvxLiCLMarBINcraDIzBJ7OvagpdrWHMqme/D1lKLHCndiiHxnIEalWgUAY\n+gNjoiCfDyWexOIhafACM78+SzvpaROuUVe5wKO+8w0lio3dP5swxHLgPF0g\nypXsOiR4iv0v5xyRZRdzLBlbOJaloriNJ/GZhbut5vZSRjolTKqGcPLFz92q\niSyt4QyWHUW8m7hMvVsKFuhPqPX5Fv9S5rOYmVvT5TOBholC6cIBZITCuwYS\naAIxHbS0QrWq2GNLY5HbefWQVZb3o6BR3EWlVV5kjtM+GtkYZPr8ZHa+7C8S\nx2X0mEyQOTwH35Q2TtD33XT2DtOdS70jqY86Wwge9q9J8yfqiRvvkBA8wGaF\nCEbW\r\n=EE0J\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"04ada63ea9db1b3bfb7e8f91474c380f6c8861de","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.18.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.43.2-canary.6_1643912328329_0.2097259530288269","host":"s3://npm-registry-packages"}},"3.0.0-canary.43":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.43","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.43","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"68af9aac5b156eb0c640d924aaca751993562892","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.43.tgz","fileCount":442,"integrity":"sha512-RAF4s9AB5zJEfV6Shx7YZLlXuWbicF6U2HVsNbJAV6dTocL4uXpS0ZzBlvX5mP4+/2/1lPD2ngQewnMpBcxHmg==","signatures":[{"sig":"MEYCIQDWBFV2VeGrgVim/NlSUR3CQkIfbxgINVmlxQvwuQS/zAIhALy0bnkgB4f4UK9OlSOaph8yZHCqkoNfFCkT4+uJuUDw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1384884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/ELYCRA9TVsSAnZWagAA04AP/1FjTZTXVL1ctEsz70jA\nDmejRj94hIrFibwy8SNry3EK6YtYGfTo4k2xIOIk56EPXKcKnhOXN2Yd/lGE\nxjhxAn2WneaB95oxJYZjjXa4kSBpHFK5woWVC+O6zLeom5khbn6sIKJPfiTH\nTFZKPGuLn8edJRZDbwnLAgofTmP8B1YLt/S3AZxzk95JLEnEcrus7BL7QF3i\n+eiFoOO/tZKlXjd+9x6q4+SrMQOeTY+cJehe6tkhtQkcCStFQ6xIF04kqLrl\nS2TDfBQcJaZtZyuaM4EdzoANC7gBCGFPEEwpVX/aj1P5iEjyRw2kNJLeUxf+\nd2xQGIVcvP2qLGqkImiUfuJUEuH9EaQF/vCpmmlGQumX2TcNWUlF7dEECD0C\niMmtbHe/1kX5Rvc8SvoDdf04YGYekh796ixduMQCbulUuBINYPvBueQMswAu\np1XX3dbKlmKnMrE2bW3ukdJmVArIQ2JKuN85H+OZJXmtuZVQIZuKTuXwQey6\nsvRO+zOvc3+UfTBqp4v6tAImNQEGgVdC53Jq9wq0s6QIu4CVe8pe47ISXjTD\nXCvOl7Ln17DTlZgnyP35nmpL/seapDFtfQ6b5PMx3WK1Jc4PMmcHhK6TGXgl\nb1RZTObXBeY/RYqaIFBd4JkynUTvvfU+pPudU3IGTIM/u0FiePQaTs9WgvLV\nIm+u\r\n=WH6z\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7759329506264566fa22a3370fd07ca9429a6705","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.43_1643922136599_0.9917986127447382","host":"s3://npm-registry-packages"}},"3.0.0-canary.47":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.47","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.47","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6503268b0bcf134f7e2203d91aefa7bd8ad989f1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.47.tgz","fileCount":442,"integrity":"sha512-jtf9W5ewKygG4iFEvQAbjphjDeXUfVv9dnBFInCT1yCURJ1t53LkL8RyNdFmTBoHRlrJ8caf0iTveQm7QESuig==","signatures":[{"sig":"MEUCIQDBasmzfbIXTIfKP9OGzsRbEvu/Jkr13AnsuUvebcnK2wIgNQw2Nco24XP65n8EDf7Rh84mpT3RDZ6g7Gw+sDd+hcI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1384886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAS5FCRA9TVsSAnZWagAAkUwQAJGjMB+ZCSiUDca0MiOB\nbeySeX0ujktfLjGKQedyHtZr6UpGs7gvpNoabFyJY4HcDjvUgb24DWOgaMIq\nZMCsXI2/PYVAbWB0sA7SSUsazbdb+3/0NjewTfB9wVw8vBq/59Hrg4lsXPrH\nTjgoJe2NpwbRiDB4zMysDUUD/Ihp2Np8LinAL5QZ4GpUooMFRpT4klDELjp0\nLgEJgYXHbYaMXNwB+w1XVCTAevyG54/ZakLkqvIPVvuhwqacajBdOmqBBcoy\n4lBIjWPTSuelj3mHN9Qolx/5ApYc65vzFmOPpPL/TD7DwEtBmiiXjCE8ti+z\nMjHNUnHbBe+VG++/GKvaYmHgpJQb+4AKzzWJc8HoaOtGXVhEf9rMtzMBFQMF\nHzRq8YOLNdppb4E7UbxmtKSbiRxtQ1EVXLd4ICAEGXnZSM6uycxnotLz7Sf9\nGJ5JmFK+VEQvHd1wEgdKX5KR/yBpL4YHNzCLXvkVnNMp7Mh/iN6tbta1dY6Q\nU3qGq9fZ54fNpW2WIq0dS87t5IFO+Qg3ipQRTxKft7tLh6GUcmfr1SdPbckb\nQoV6WGTdFx4PkK2tBMt3m39LCqrr3GcSDCSY3SjDJZa9PPtjkqLkqDcYqJjx\ntGsmxYme05kIvvx5lQRjjF/hLfR3Ct+4F/tHcaAGD+ULbIJgcH/dUtbo4FIV\nICEQ\r\n=/h3W\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a3cb9c34845a00da52649d63c53a5cb07ca7115e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.47_1644244549733_0.19397592702868538","host":"s3://npm-registry-packages"}},"3.0.0-canary.48":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.48","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.48","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cad384f4e5489396707cb0329fc66541d3634d0b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.48.tgz","fileCount":442,"integrity":"sha512-kGlvR6+TpjfgvboV5iKWyeVyMoW202DlO7//AEfd3fWJMPsPAKIcP4LZcBTAc8cAJkbbyMb9YKbEoRdwRxdHZQ==","signatures":[{"sig":"MEUCIQCrGL9eJ82UfQS9+hdSEEhn8cpgTk2DK6wf+xVaChWhVQIgZOKBo1uXOX/pRj/sROZZTOqQRmQSIyvKyNa/ZjaVFDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1387170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAtmZCRA9TVsSAnZWagAAdpsP/2MdYPv3EWpiYJwm4Pqi\nQ594UNr/cgNUbwi0Qp0pTqVlCcuyQemaqha+TlA6pXr3bCdKfNu0Npj299QK\n5jrzCFmwS9H6RtT3k971Z8KXvgcooBA6BcAnSm2qiCid38ejYLi0pLaPhW3I\n2PiqZy+xqooiRsXrRTCCvUoU6oEepQxCpqKOutYx4OPYeS8Xg6qu+M3ac00L\n8ua6d+v35D/C9xpZF90ZNeBJEV+TWPl024ZAsopsJuLMUA7ovWSL+VCiZ+mm\nuQvNLghdq6mBKlBbcdz0e2+zCwLB9QcTvpGL6LWEfwugvCXaUa/JPqakWuBm\nhjjIoUJ3erFi93u8pmMAhOF2c0RzEz7qLCb0mx4JDbjL6BpPQuGLzYP3ua48\nJZLPx9wa9av6Tv61tHPYP6M9gU5gnw4wMuvgf0okN1RXv/+aempmNxwMyLTS\nrK8LCPL6fDr+YqRuP9IiB1TwxDvPtpXS1NDIg5Wj1Dq/ivzkdIUjmWn1y8VJ\nfnUW9thk0xaToHhQCrg9RIgrpj8eE5PascNEgQPEvbpK6Y80pSpBe8MRHWbt\nFwPKK6pYoUnKQzZmd7ML/y07GtdDudtS7ujg+2+ztQiqGgW3vSoZ4jbDwjo5\n/dshb51/WJ2+aAstnuMGZVArhLvUcpz9w29uXv7N1/m8PfgEFXlxXtOUzB6N\nfnAl\r\n=zUei\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"323db0cc651fb4d88ad492a97ad33c69ff17cbd0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.48_1644353945759_0.47534373581427647","host":"s3://npm-registry-packages"}},"3.0.0-canary.50":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.50","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.50","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8ed4753a94b74c9974c23e2182769df61f771a5e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.50.tgz","fileCount":392,"integrity":"sha512-GYlxf+895eqEbTpAYqwHx/zdk3njtZiyURAeo8jMHh6qbyb9NLuIkYJ5MXk/TioOfSJwGsZL97durE7ia1w3qQ==","signatures":[{"sig":"MEQCIHLW8CzMAj5LZQmOVzm/bvpl9W62ttG2cslcJGEXlPtkAiBFvVMEQuRcEYfLfxLMMBFlqpaeJ75Rgz9sVhmcoiYCYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1337153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDP9YCRA9TVsSAnZWagAABb4P/1ySsFH7CFnSCmjTbtEf\nClaSMqi70bOt/cDAytLIdttUMiF5pRGmlfcrnCtKJPs9hAtXy6PXkuDFZY9n\ndhh55qdUjNaPdYBixK7VK78JRFfaPinC+ESiFW0lBYbDlGHD2rdTXiqJAffQ\n47HWzw5JKfearXMJdJcnKXuQo4aHOHsEZhjhzysGo1/nfzVimkH9RhCvWQMl\nL7VxeN292Ob2fqtrS7Rkg5OUkeFE10rIGUbhq7QZtpFiGmhC2fZWNceRjGPG\nYtWUzcPJI63Wv0boIpPM3zpx8zKJIl9/1vGTT7wWBHoHLP5g1L4rzHf2Gbvf\nQKiNcW2OpsKlD9BQ6J2zQyXzyYiJPw0y1Hp4Eompk73KN5ivC1qf1n3WAfTS\nXHbphUQwEv6968xV6D/8GxUdcgdc1EVqH9mIOS+ac2kNKVgLtpoQp9iwQkZO\nJgPXr1o2q5QbizjZ0rJc/HvYlyd9zbFZbSlqWERnPgGDm3Qnlu19ry+w3CuQ\nnmCqoUoZJ/Hqk2bzQSVxJZNujtZic7cA1ha/mueRftnnrdVZO6P8xiu9Nkfj\nNSbALOu+MBSAdJ7abU8nFCYsy+X/18PuIuP/9Jx9wIlCzTqHDOlZF1PpwxDL\nCYZWXkmiz2LurCBitrZUsGo+oZj1kQdrVoigp0J/iyqtB1U76O1GbpXaf98F\nIHZM\r\n=OYht\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"afcf1c785d910ea7a38d40588a33f72a383571ca","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.50_1645018968677_0.8520480797744794","host":"s3://npm-registry-packages"}},"3.0.0-canary.51":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.51","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.51","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"26d45d752f5d8cfb400dd13ad228d877169cff5c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.51.tgz","fileCount":392,"integrity":"sha512-foLtOP3I3Ntp6UctmzNZegRg+DNZcBHAwIp3D8pQErBAXaRUNmEKnGfE5O0IVeRtoasn/R/AGea/Gv6DTZQTjg==","signatures":[{"sig":"MEUCIQDBi4HVgW5W60TmWYj1E27BkKi58yerguPgEOWnM00IjAIgWUtCrr0jlJsKPYnuHky+cZJ3ERWsofoXv9BcAPme7fM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1337153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDQUkCRA9TVsSAnZWagAACOYQAIf9JtzHx4d88SFzDN9/\npD7rTmtJ9KYD65d7JkKsDs7C258RQo3SwixdrNA54icvPKinkw5XffFUJwHG\nX8sfH808rAD7sTYVmOFq0WwKhphRbH8RD5YgYCAyqFpqlxgQGcJxXJ4+gS5r\nVoir1gIn5k3j8jiZCfFqv+ozHypyjcDJbHF8lUwkI9QpvE/ud+C7yQ6p8o7q\n+9t067kcqB1bHuSWpLhnNyiu6sJkxpRsXRGf+Q20FFv2EIqWCpJsiuyYV7CF\nkl9ADUGRpGZZ4CXPoRDOJXGDiMIN9Ce/3KNvdbs1r2RC8ZcRsEH9NfdvFl8L\n8RN/D9oyZ6CgqDxXWN7YxF8hoXReg6Asy5bXABEdS0jcsvGixRQpMI33jiBV\nIFJuvbWDvrkVZpdBeNigXx9NZBnTWAa6D8UJSDi78poeSR5xYnvT750j6osJ\n8oevFPMCVYKoXE0pRwnP1LyvwrxwGsHpFnySCzDK+KK/l1/b1/eADtAxVUJP\nplfQBxbuuPLGG0akDdjPwPvVtFSkTSKQTtFdp972m5h/z+5qKPXbWuMnvRFX\nXOIpGoiAOCCdwmYYYBxDJEyAPZkF0HiyIYVNGp5/GlI5PoWvwwrHaJ8PGSep\nl/wJJOKwjMbXwnQT1n/qw2159SCyTceboAkVuyo+GdBUj+XqFDh8hJBZbyqt\nRkQA\r\n=IgY/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e5d3822f631950eb9ec339e5da0da607c182cd6b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.2+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.2","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.51_1645020451828_0.13945239048285996","host":"s3://npm-registry-packages"}},"3.0.0-canary.52":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.52","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.52","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e0ea1e6f910e528480be547aaf54bca460bc8c41","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.52.tgz","fileCount":396,"integrity":"sha512-Fii9OxzP7BwQjcBdEdmgnDbgromzqKL6xMbP7khXWogyOAFVD3xEgIbLUqIUPY3BPEFsjt7Mb7rMzEBBjXIxOQ==","signatures":[{"sig":"MEYCIQDYendjrWJWJ8Z08MtOdejs7Z+GXcL7hfwEhc64+TGt+gIhAJ7pMDoi9RaiIDQKWz66fXNf+OkqkrbwpffZ7fApBKXI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1383827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDofxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqInxAAgQYIYqHngcLUGlK5JOyAOHMngwQyEv4c1cYTBF2iyx10l55B\r\nsrLh81dTxJDgjlbZNn1vV4sRduzEvc1WhhxwUHE/RLMvyohYCmFNpgK1Bkew\r\ng17ojL3uemH+D+PbmdVjCNoC5K5wpZDrIkt7hT/qFXlee/SwPwwxmPaB9Y51\r\n1Jx4Dd2yzq839UXi/9yroWYGuDIMk7u35/gSfYiI+lRZmBnPqm1bPdLzenlS\r\nRJmhGD3vwL1f6rSSg2wTgc8iARb+nCp+I33jxA5ENmwrAgBsMKmC2S/e2WyI\r\nIOfSFIh4yRkSCW4yFSNTokoYzYURbqP93rfeABte1x688enUejUE6qjUe2GE\r\nMVw0hOEwJg0V7hNWYSnKccVCt9Uq2EkZAnba0nWDSf4DbREIN+UYd3EH/dUM\r\nWKjXRLXypQokystZvj3VT2oiEZC1QAN/oTZ7F4NWBGd3MBlJFcx3oe2Hf5Ym\r\nT8z/70U4WrijbPfsL2HzuyJvVwOy5R94u21LgZvrUmfEvmv1sLPWib8pAD18\r\nwTyZtnVkUe30iKUIgyVOvCYYEKenG8V/9KjFxmOUiXFrBVIA09nu6GFjWYez\r\ne1uwkMJ7Y89wpfEyHMkGwCJd+Cb7K0fIMJ7P8LCTxvvhLPWhgxXWl/kALRKd\r\ntajUrG5cO6ep0YKYzVR7JMUFWOY0KgDYZqM=\r\n=9xGA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0f7cd3ea116580e10354d581810843315239735a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.14.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.14.0","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.52_1645119473409_0.8153153800690414","host":"s3://npm-registry-packages"}},"3.0.0-canary.53":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.53","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.53","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2234dd81c6476cb7a50441365742a3f347865edd","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.53.tgz","fileCount":396,"integrity":"sha512-hBJRO+RMQ+Nxs/zLwCaSQu6ZZio+Nd3RneoC8nZkrQwD+MlECiFXFkwbuxB8U5AzOP77FO6c94xs9k6tMmikog==","signatures":[{"sig":"MEQCICHNKhUgsWE3HNow2FZw+bqmeNvT1N4x3r5cXw/FG1C/AiBCR+dz7UszHurpu+fUlpTSD9yTECPpjVHoEQOlH1m6uA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1384591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE9DXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofwQ/8DTMN/VYyQ/+Yz9w2wGLWzIOI2JcSzTNmH2DRz1ZM7fR5mTnw\r\nDR0Ph8iUAFy7bYdgWWInbpV+7DA87EPcYJwmTaZEMBPjpv+lvSkCNvUMc/er\r\nibZLAJ7VqB7t+tmYu5PhBOOZCyl2vQG2gC3FnDUocpSCcnauPA7UlSwEdGhY\r\ncYPI/Hy8R5KYwMirV3Xo9LcCWMwXghP1GNSHwTrI8H9jwOzficrok+gIOmLB\r\nKFaTr1lv6rPje8lT5ejmZMN6cZnaikqLaSDT3PIDIWQ8qzLeKyZ3mzzF6e7N\r\n8f8eFDD+ozVkUsBsOJcUvO4aVIcVLrVl0o1nyQhpD8FiGE0gquhJ7oJW5pHO\r\nZ6waic2tjMzhHdP/1jufGyOIpgnYgm6JRE0M6X9u5Lk5PcAloAH7qyHBaVqz\r\nA0OAFNywY9OYXtA8S4QblKeDcAMB8gGDx0mMCm0sLlDnQGWowykzpMv5D0f4\r\n9KgjEYkwa3I/8nQNFmRwpwxFP9iDWOalQgXtKVur0IVOytka7SN+0mqrDWTa\r\nzW/V5H03ytYPrjnPRI5D/iaxNYBXyD/JnvltYQHD+RUjLzLb54P1vBNxiDlc\r\n82eKcr1gpQR6s4UIQ1bDzPA9/u0vGkFJl5Mu2W1b1o2X87n2tgR2fu29qfLW\r\nPUtwVhW7vJDLNNMwCtAIDGJlao9WDFLduMI=\r\n=tRKR\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6851017d574bb9a361a586913f31252bf944d418","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.14.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.14.0","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.53_1645465814827_0.3549940324974148","host":"s3://npm-registry-packages"}},"3.0.0-canary.54":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.54","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.54","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a7f61e0bac9eaf23cd6cdb41c8a5e6c3ce6d4fa9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.54.tgz","fileCount":396,"integrity":"sha512-kybIs0uymy5AFCN7A2/JfAIbTR5EAmESuM4dc8TWZJJa8WRSZNYXSWXJNz7GKOOJ008FcS1f7Bx8o/d/zR9RuQ==","signatures":[{"sig":"MEYCIQDdmL1QfXX2WIyFdT15bHqn/7PWgLXE3g2s8msXdX48fAIhANF+b5OXtjo/Q00hTH1N2+BZT8Hbb3E8HfDSHWyAcfLx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1384834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE9pAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoC3g//S3H38O0kiX2BVZtFCfEnW9ZmcnPfNMc6pwvUhKecjdYGXDig\r\nGCc0n4X5hgRridN1XEMRyqSCM6I76wdkzrXVzkka/U6s29nGlR9s9e9D3r15\r\ngK0H/EF8/K9E2mvKFh9HRQUEGT5h4uaaikitJxzHP9f3aY6+XwVYOX83pffC\r\n4r3MXxf1bT27OBYL7YmpJ6trCthVB1HgzozyGeEFBwP7JPGtHL6UxXMn5Oeb\r\nerPz9NkQ1W7BOR9h1MEX8Yo87loJ4GWGlYm4u2E9QEjlTTsHfAVpKBgyXFJC\r\nEOVE3QBJZqAVIqoGh/BMRdBWxyb48lao6se6ugwmn8bHaylUJDzjTtA3yTdm\r\nA4NYsztEQNMhckAFzBrnedEXBUM+DF5nC85IvfBBDHTbB6DUdFs/92u72SxJ\r\nD0YRYDvBYHcPCrlN3bwzt9vfM8v0kUuHN04e1xXFdbeDaoQo6d4epQ92Pvir\r\naqfpbQy1OpiOJaa2LWHBmye8F9ClTAMCd07WLLIq+JM3cczbUgBHZQmrs5u1\r\nuZohTJN2oNst91VSlA/lhsc3Mhh+4UaC/3v3vlzEaGAFpddGr+dN/HsZTOWQ\r\n5vTMY8leo3aitZhKQ3OQywTEW+bOkifg/1GLWwzUcqrbyV8KImKIXuvnX8Oq\r\nyefhCm3plBkBgsVzcXyENtImWanGXih7ozo=\r\n=6SDj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8a4174e525eec9db67684743c07c0fe371c85e6a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.14.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.14.0","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.54_1645468224398_0.37946929286811093","host":"s3://npm-registry-packages"}},"3.0.0-canary.55":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.55","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.55","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4fc8468ab35e21e240277e494c5dbaff92bc379d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.55.tgz","fileCount":396,"integrity":"sha512-VDlaaZTcpIj2+MMnyQOFQlmQqzEf2DgCnoeI0byCaqbKfuZEtn9qx9/LmFJnu4dqq5peifmGkRT9RUs5vh/5LQ==","signatures":[{"sig":"MEYCIQClU3gdrGbae4zmtmERk65Rzc3p58VSvXJPtG8h6pRtHAIhAJ4xajWLWuxJyKVlKiM/f9EuQVTOXBZsMXI1X+iMDJtm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1384919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFO8VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5dg//WngxqOjUQaz+iDiOy1kOMC7QkH4zonLIrSBz0+QB5PVg4Kyo\r\nD/8N9BFmYOTPnMdz0YL0Ro1e3fJ4C3NKPHHcuLW6K51BitbmFhee6Y+PJqj7\r\nbQCQSRo+LUvFIDnRe4Xvk+e9EHs0aN7D1EruMTmTIDAvb3puDa6R8vLxwF2x\r\nc+ZBkJp07ACn1QHJPIadf8vQfeViG5b89DsL4GPJNYJ15B8mFoC5aeKJEg9x\r\nQh2dMgTvmOO0CbOB+aCyrpkQusVFNOKWo8tvZFuFq9h6XeKuXGPcEAkGjIJw\r\nu8YTrKED2oI5/STdv1r4CGbAop8uA9xGzmafVeH/vObPkrawTpEsdHUgz7qS\r\nBjl1cNCDlRr8ZnVeHWXvkMks3ehs8Q+wmbxBQKiGDzdH6ote9sKH6BbpGhRy\r\nSUo1Al1rSuYsTgOFpTUbC7T17tJLLNLCJtCvLBBPktaNYx2dtzxklDdDaiLX\r\nE+uikT+Orz7qZq4QDf7Poth9sl9mgtFAvbY1IRi/YPDMZecfY945JJJnxz4e\r\niJMR9ZR+48L2Dxc4NBdZLTTbGBsD+cgCyXa+OwlGFjKD64wLoBDfGEY/V6GY\r\niIH0I1f9FQOAcV1MsYn1+9NbQL5CO+og0jM8VTg7QF5rqa+6hp9ijxfprolm\r\n/zf/01D2ikYB3OAzIblohXYGv0fyed9jv8Q=\r\n=M1Sd\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"647232c986eb746814fa6449dc2fb1b4ddf1d3ba","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.14.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.14.0","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.55_1645539093617_0.3207204226641873","host":"s3://npm-registry-packages"}},"3.0.0-canary.58":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.58","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.58","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a4c062fd292ddc50f65f310ca0ed3ffe04308db4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.58.tgz","fileCount":396,"integrity":"sha512-5WyDf7ZPlGI8XsbHu5pQUglkfyaiAB9dJRTIYRPZgdJZN7qWXP/f+xzvWisQ/QbFiZkfBHm3L9LjamVfUF2n/Q==","signatures":[{"sig":"MEUCIQD+emGlB/KTbv+KDfW35kYLNYwjbviamRRp+pd7XnZ/tgIgGJRKQ+K5ScPjsi9/mNTEEl9lGeptMxwRRmLWWJIjXHM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1390491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFpduACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq51hAAhIr/yPARhzYqTIGscGBxQtxJYXkx9X1bgsmhAunQrGopPjtb\r\nnHDol2BJZVS1Qu8TcxePWZFU8K9sgwx4MOPAnykx+DR9orjxQ5R8CbyLtPsJ\r\nmgNqGu9KJefjd/7XAq7RtfWcnBgiVIPWIgch7EDrYexQnc19bOamN4vrdGdm\r\nvAudvgBpM+vq55FE0X+OP2PNb1o9cb6VlF7FLn8dmTnw88i+vo/d42nAqmBZ\r\nkp6dgMBblnH8peyIxWX/DlbL+lpsna3cX1l8o3UgirbIorJyAeywZ2WHlK54\r\nMxCFeYFKt46LVwMD8HlZUI8ZW/pcc8eo36WYs57Mg4RH6v5bZnnt4c45dz3H\r\nSVJ/NADuDgedDMZS/kPFsKwyN1JAzaMdAZrhrFSY3nzFn5ffzoucEubdQpKb\r\nsp2I5NhcFy9p1kHIdNR06GgehG26Oeswy23Ks8DOx9HYQLj0sNsrI7ztq7TK\r\nuDQtAHeXRQGjrSxwGssrn9CdDlS0G22JVSKRKwIFWWQ9u+FbcWQj7sfxhojR\r\n6mGHNK7cTFvZn2xy51xeNbBR0aWyh00ejrvcmkKg1KGOZrblU3SZp92tlZuG\r\npB2CKID7xuPnar3WnCWcYWzHwlAMzs0CAbronOU09J1OGxAtih4ciI3s1d6D\r\nfx1kuYmIwOPSJ90FaP3kG0Q9mh8MyiHtJW0=\r\n=oOqY\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","testTimeout":30000,"globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"setupFilesAfterEnv":["./jest.set-timeout.js"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3f4ca974f8b29e6a0b16b057db78c7b4d4582169","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.14.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.14.0","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.58_1645647725925_0.9899157131140344","host":"s3://npm-registry-packages"}},"3.0.0-canary.59":{"name":"@apollosproject/data-connector-postgres","version":"3.0.0-canary.59","_id":"@apollosproject/data-connector-postgres@3.0.0-canary.59","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"81925159e22ccf2aba19150d9a1931e4fa256606","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-3.0.0-canary.59.tgz","fileCount":398,"integrity":"sha512-/iyV6433JduQYvt2g/vIqMuq4uVdZet+U+Rn2m35Q4kA4d/7DtjXDBrYgKgWwkP9fWnWzhVEB7pKiNz6Qdw3jQ==","signatures":[{"sig":"MEUCIHlQ9NEbcGTwEcmVh2vci1kEy9nTY5p1lxlj6M7a4tnrAiEA1V/NOiKxT2JrbYoeUDizb1at9nmlgJm2dmxwx+QP5Hw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1392149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGO2wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdiA/+Nj9+U+C5sLKtU+8kKKImqwcvi7/v/M3IY10/HbQ/6jIJNlGl\r\nCuHSuYus8wvJ3ae4SV6ZGruoc0kJqI6isTDWgngJSJ3NYO79/rDRpWxYl743\r\n0IcRUuLtSQyb9gC9IRJlIcE+vbMwmBwlSk+BfbKvLV8xYoN991XBsStFRwGZ\r\n+pVGMhNaWmvBUEogjy1z1S9KqbhMDPvK5BIbvsngQ6NadZXI5SF+D1YZX3dq\r\nvVS1O8pvIGiuRmHJhrGAHk/1N7bXUNehiSmXODgXHTjleyRWglZcwuU2r973\r\nqJkWGWh/c5Hgdd6wBfe1D46pVjRuENkKCnpueJU8n04ViuFfUukFxXqcZHY0\r\nyiVqu/YP3ySpk6QZ48bh0EknOakM/MHUEiAOXNVFm0QW8A0UyVZQOs7+9b7F\r\nvdag/Z0R4sxGO+7537RWOzCRe20JXzZTtM3MgIYP4pBoYQ1iZQGWS3uT7LFx\r\noANHaaIrim9D9wW+uXq+zHWM0db2paOCj6CivbzXt8B0l4MAZfJm/recOqn4\r\ntYxbZKTqdKecTncfxOxfHVx08oZo60FVwzeiNO1HWHXfZGjOzGO0cqkgqwGF\r\nj5sZT+VfWlIWcblntxty1jfa9fTxchI71NuXaXbvJTxtwva6viuKLKxL4xKJ\r\nw8OAd2TVTf7U5mtZKQdRB02HiFArWEbSk5w=\r\n=ynfU\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","testTimeout":30000,"globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"setupFilesAfterEnv":["./jest.set-timeout.js"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b7b6331e426d8659ccaff9a952726d6d0b30c72a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.14.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.14.0","dependencies":{"pg":"^8.5.1","phone":"^3.1.11","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","openid-client":"^5.1.2","@sendgrid/mail":"^7.6.0","hyphenation.en-us":"^0.2.1","crypto-random-string":"3.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.43.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_3.0.0-canary.59_1645800880197_0.3722765142471658","host":"s3://npm-registry-packages"}},"2.44.0":{"name":"@apollosproject/data-connector-postgres","version":"2.44.0","_id":"@apollosproject/data-connector-postgres@2.44.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a6eb4693cf6b5008cf71beef6cdd0b202f944ee3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.44.0.tgz","fileCount":348,"integrity":"sha512-SURDRLjOU2/4xz3A9miq5zQPIfHxo1eX77WSpKjKOOpUKZfD/ROYwfHxMfRNof+29I7sH1HYVZ8EegVNScgJZg==","signatures":[{"sig":"MEUCIEb9h6veyQl1IE8wggGITtLRgI2Q6L9TKrbhuxIwY5YXAiEAo0O7PYMSjYcnDX/CXh4wz6WltlQa9o9A95PCRCuN6Y4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1096442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIPxhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWuA//RzMHrff6CaKHefDLPRYjUF+NqRQI5LVhi3/rI1yiPVma3Ny5\r\nPR1rXTzI4zEJI5xe5mYpw6hOu3VL5E/6GEwwFLGbp4Un1p8S0Gun/cggh3EW\r\nXKZ4/x9E734UO5NfCTuCN+h+ViIR6F9cyVL7Eh8vho1qHWCg1Pu5UtdvdE2I\r\nRXgAAAYUj6zMKaX6QkUoflqDMPplq9FKvCtzuod2FgFtr2Xz2l5RPLXA/REr\r\nRbeqr+uBWzgWxGFxD6MS4Ucddqg5Ke7hbzzh+x4mTMkN285DARSFzN2N5HbS\r\nJGQe2Is37ZKA0zehKCvyPjXZ2ocBnTWQD52KFxpttXOV+o/swQpsnJWSM173\r\nTCNMXLphZ1mGeUT2bOiT3daUQaemBMqBTyJ5icnwjAodqfdMjPkgfV7ic4/+\r\nHt4HtjT9VX3RWxAUBvGznduM/7r0WTWgSi1NxETQ/VgyakCLygentos4k93B\r\nHQMYWVYrN1EbZwiDhtDcl8KcTTHafn5DV5QYlq1qi/Z9/xD5X/oXXoE6lkXx\r\nGU0a5K01d6i1LoL7L26HnZ1L4YSTkjC/Fqkd7+WU7uuBxCV12/SnimF20WwR\r\n7Lfh7bRnBW1vtr5ASnXaqeZZm1jGUlnBAUSg0tBfxbc3vf05bfHeuIRVHIge\r\n/3AvDbEaZByxa+YkuiuNiWfz2PLqYy2/auE=\r\n=oTV+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"88311514d4c0b398c02a1ef97ba71cc7007b1ade","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.44.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.44.0_1646328929322_0.665219990907959","host":"s3://npm-registry-packages"}},"2.44.1":{"name":"@apollosproject/data-connector-postgres","version":"2.44.1","_id":"@apollosproject/data-connector-postgres@2.44.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a6761039b10f3aafa26f0e3ff2b957f4c74aaa98","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.44.1.tgz","fileCount":348,"integrity":"sha512-5zrt0iQIxzDry9R1dEH0O+AU1Z1YUuAMF7+XFuoOMFncgKpycH8+TdSdEAheMMWyIl91PNPEY91thO/nd1RTMw==","signatures":[{"sig":"MEYCIQDpoBSzASu88Mb2o6JbYZ9E0D5nJu9QlR+Yp0F97GCTpAIhAJSh1FrwaiqehtElhYV160e3QBFIuS7qm9gifqRa2RCA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1096628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiITtCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFqQ/7B5QGeyozlaVTRNexloo6qV6LmEKdZU979dJChz/Hq1bRHZCY\r\nEpVi0Vdl44TD7ixvB3ste9pWYQJMS6pc4ZTPxqcUvI8u8Z/dKqxMnmlzBLiS\r\nwKKw28cQyqe4IZla1AqgzenAyCe25ipLNiNVlSLXmn0QjTdAG5GGqHku586E\r\nl+dLgl94KsHo0hi3eqJXPgxLs70jp4of28Tpu9Z0zo+tmo8od5Y6BDllNv4N\r\nXCWCvdyT2rKGDgsUVgJTPm2dtNSOukzcpJn7cT/gOccRU6d+Id1f71q+e5pm\r\nIhn6Jz7H1h9twgenLwuH8TlNNXQGmh8BS1xG5HcyKCGvpRi1uemPJBfYQKav\r\ngSojc9B5KPAx91jBau2Ekd/jAvJEZ2yqGiupu0JId+QyuH5ZQQnZHw0yB/il\r\niWckEXaqGnaXQyLP6Q1aIz2bniJvRD9WwLCFKi6Po18JyMstA7sSGc1Mk/bX\r\nrawJyfHFzwE90V0C9KUHgbGln9w9UbPic9hMM7NB0RQSzLTAN9N+lBJ5lKSL\r\n4At6oJai8sL2tIR22RlCAQ+rMAp5TSPxjb7HOIfS0EIOIbcNjwcPs9h61TdQ\r\nHtQnMxIIkj88zN1IvWA0y3m62vXbtShHlZrHXs/9dNcKcRuhieELpBL8uUPi\r\nQRIwjurDyVgGqKGmhHDPIJkgZOE58Z1Xyhw=\r\n=MUHC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"76ea66f2bd57d573af16e7464300c61be616ced9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.44.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.44.1_1646345026393_0.007660390591510247","host":"s3://npm-registry-packages"}},"2.44.2":{"name":"@apollosproject/data-connector-postgres","version":"2.44.2","_id":"@apollosproject/data-connector-postgres@2.44.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"df1e3cedfaf4d40703476ba71b25cf86a14eba1e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.44.2.tgz","fileCount":348,"integrity":"sha512-ndezf8p6D7+4uKVJ6qx5oQ/U8c9vUQhGBY6DaLYAHsGsA611buRBQSowQBrVlOGRfWP3UC5GraDZXA1oSJRptw==","signatures":[{"sig":"MEUCIQDyo9nxAVlOB/CW3qF7eHDx0Gz8B6xnC+5c5AmnOH8qWwIgNtp0IoQIvti661YJuF25nQWiNsd0i0fdid5y6I0Ovt8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1096814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIkJYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVyw//VT2c26mv2avHZoclt/Vs13rFFY8BGdasu+ryaWqi9hdhFuOl\r\nx110KRQXtwyiozeG0DBlUA4bxgWQE5RU4d7za3C/Y3SVVeRb+VInBy3sjb0A\r\nxcTIE+k/3uVE66Pg6OcaX7NRfWSE1coSSrThSVoG9G7m/VZwNwmE2IIh+XJw\r\nSqVaHPT7pZd76kGAhin/XB948DLoZDkajYh71ixw6Ewt36QAJ8BHRWNLJ6IE\r\njQVQagquFAKHnQ7+E2h2SwmyJFoToD5Rf5ik0Af/uARC2XnwjGG4GSOxwzwn\r\nxaIrmLbJcACT+cvVh5JEOIRRgZnWwDtxdrwUc30zEZN+pSe1mOBBPzmaE8YL\r\nculw0jUrVQka0P9ttM6KlBKPQrr0n8kfGGCTLxFScni3m22NGkPQR9v7dW2j\r\nR37SuIXV+mye5Zcrn1tNt0UqJdP3AZVUAyjfKibxFsx9tpHGUJQo6fm1M6o0\r\nSR3KCYN0ky3rtYZEklbEQQqC4gSba0gqn5mi2E9ZVumXVh+hrHKM/XYLmlyL\r\nZ/8UNxRFohPM3asvYLCNQMWJBsp8KgqPl2pJpayZ6pIDGV6YbnTXnm9Mxr5o\r\nYge9nBXJCol9uprYI2fdXV6wOAUXI65R4ouM0Fhk6yo3huXyvvyIyIZdZxTG\r\n0PhF4Esv+55s1yu3nzLqbXDy7uxQJv1IXFw=\r\n=h+gV\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c0579c69f7889a4455351f8509b1b4cc674123eb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.44.2"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.44.2_1646412376771_0.7543953091514304","host":"s3://npm-registry-packages"}},"2.44.3":{"name":"@apollosproject/data-connector-postgres","version":"2.44.3","_id":"@apollosproject/data-connector-postgres@2.44.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"084aeb0f6f4007af64e01da7c2cab31b6c559e90","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.44.3.tgz","fileCount":348,"integrity":"sha512-8Xql3/SAIqDCrUsISJwRq/6qIgQafvprA97O4uZ34OGzRtT3D2xPZV1V+dMFxXHxMFwbX5Jhy9R5k15AFdG+6w==","signatures":[{"sig":"MEQCIHJpQ8RE1SmFwVjn3+Av5KdY2ExQxcOR1dUN6eErSWJsAiBietoMYDPEq/xqbJZw3+4yLVONOjPKaJUesovoIj/esA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1097000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL1LHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrn9g/8DHP8mNbgbqmvg2jZVJL5exTIq/RO2iV1XGyEJcuIuIeQsj/F\r\nMaElKiCzSJmKJBGjgr1e43RESW5fH6buYvnOOfCmQ/iAwOZk/GWG2OqgbUZ2\r\nNNnT83R2gsMs4f8irBjynse7EyIoT9Iffd4gxtjFo1mVNXgiKq8wjcaxY34A\r\nPmbx/ktRWbMqvyHFaW5cUBS9ZlHdh06imHupGyOxieQI1dVzDUNmkSoh0MxU\r\nI5H4okxLgsoz460Q2oeHszqg5BwGCCSckPTU2ukAtuXiPjIPKqQ4I/2BZCcF\r\nrUpgBZDxhgTdhkoXbcllGbU8wRl69+VzZWCRGgP9NFt7rcFgBIGKCg1KeSX7\r\nK+NWsvf6Y94OS2hq7IJTIAENTecmwibKowWcxCuGHaPb4aPU441FbWnFxPrz\r\nJmWUmOYtG8dyvgnhlLA1hi/VERvVq85IxZsslP++PKguh8q5G2YnyF39R4C6\r\nGT0+/dbSLTe2oQC6RGC4T+YT/FBixCm52GLk/LnRVaTkmL4C6r/W/ynV6rOd\r\nASR7bpjZf9WI5Ed1s3uz+c9v7vSZ2R+7ifAk6xkxSqsc+556Dmp9/Y8gYCT5\r\nc64UdCjZMtaCdkqzJT7xsZwrImvQdSAFn2B2xl02v11fwnhugJ2xiy7Gtati\r\n5il0Pq7Y5wuJ3IFztm9wbV7H6ivjopm7jsE=\r\n=4n0s\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"415a1f61343795d129f7cdec8d48cf5221a6a2c6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.44.3"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.44.3_1647268551105_0.5183024378422507","host":"s3://npm-registry-packages"}},"2.44.4":{"name":"@apollosproject/data-connector-postgres","version":"2.44.4","_id":"@apollosproject/data-connector-postgres@2.44.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"67440fc4f028e5d3b687d8919f46bbf360005787","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.44.4.tgz","fileCount":348,"integrity":"sha512-kg68nNu2HwAdnPtomWMUEdyjyYAztk6umdvMO/U+QOTJeOSziWVXjzuSi+WbM5gHkG18oMhyTz5dECtyoKbR9g==","signatures":[{"sig":"MEUCIG9zFJvP+WS2Ir9LGLeF7xFg93UqGWyGycL1gzryGbY0AiEA7Z1YINTfrNM98OA1bjzogfzR6x4Q5fgYHG+eDGlyC10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1097186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMRzwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrF+A/+LXE6B4MhNTF1A6NBxOtZlkV8owduZRmklk8/oFmkBS9z9wV1\r\nHv6E24jYpu8VjCN1Adc0QuEZa6R3GXkot096TyRe9DcpnmPq3YWthYxkmDh3\r\nar/wtAXTDI+/42CZSK3ZV/FLR2whqVW3LtCBe/RLCVOv3Zq/Qj+Yen+uwid5\r\nAXYwIIDFrI/Wj2pj+s6oQqnvCthx4sEJTqTRS6yhWU2XG+SQQzZ0q22Au5qa\r\n+J587UGNUyZOr5qrDSoQRXiSn3217gqjIHdNu1ES2NhOu5EmCpR+aEZ23ksH\r\nP0r5T+1oNamLuI/8MOsAtxoS8WPbz3gvd7QWKwAHAj9Zdp4yQmthXvy2Y4Tb\r\nuM/UOiPUD66LtOo/GIVDo51BmZr712LOCjPInp47yRsLio3sYXxocBsEauJG\r\n4u7msM4btdo7DO7AgNp9Lm4bW5MVwTEgRDBLE/8NH4mWZp5znKn5lIkO7Y9d\r\nDhDP65XyeJAFPgh/uiKtyzgIW6S33au2a4hrD41Hd0NE3O/WUoaA5AXODpt5\r\nlBNIQOOSge8z/UsmyihIMTNbDYkIRxPMGEmp/YuO4rA/U8m++Zx0rR35a/dW\r\nLLDNIPQ49WEqI/a3Qdg4oT6SztnX+Z3/pd5lJQgFUZCCWSlIymAMrGAaw+xI\r\nQLNpFwbzpcx7FZQcLMpqVzyfpxZs9D2Br2I=\r\n=ecan\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"19a714fed2a52898b4eeadb46c2059bfbf136870","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.44.4"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.44.4_1647385840805_0.682913619163221","host":"s3://npm-registry-packages"}},"2.45.0":{"name":"@apollosproject/data-connector-postgres","version":"2.45.0","_id":"@apollosproject/data-connector-postgres@2.45.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"38456dd1ffa6cb30e98f53ab7be411fceb4d742c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.45.0.tgz","fileCount":348,"integrity":"sha512-1EF1YBnfttZuZ1a8J4slHegdHDjGtxXCAB7mA9MU3LiVcF45N6czxGmRHTZH6DElgtk4sr1zaABWIJfzEIQFNA==","signatures":[{"sig":"MEUCIQCP7Tgqbr7cyNWry/ssYTEUz69JaA9rW1tY4hUehbLx7wIgfOZlsvLhmknAHYBkaLjIFdsbVx9yAYfuPBTmNJ02hlc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1097371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOikaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcRg//SWCmCMqk7fw8Ahliq0vulYL2kWzpwYwm9/bnRuZp80e1M696\r\n2Ow6R1mjYoOMqiVTMPJrHPVQoIhFmcrqlPw/IZTbb4ODIS+3V6kPgE7uqxOW\r\n6kUTqA9E57IhisoUSki88KXHQ6bcGMYNsGzRCI5jSvgblHKs2kqaQULGMYjS\r\nx9iMj9WISUmyqiMXVjtHx9yfrEv7VoXNOiXpzVr2km8cs/XaLAcTtpI9WjFZ\r\nhYOr4BBbDqKP0ot7xpfkJ8fPe3ZdxV7MCb/sil4MNjfP8DsYwCyGPman33k8\r\nqGFF/4XtbuCrWHJW1JPxNYcpYPf/q7w6j7Q9bxBhjaMWJsHgIWmKC1OgvIzJ\r\n36mOGTynN6JUhgChLda31XkcrmCxU+yyKR2bPzAgcd6D8uO2iFlY9fvmHYfF\r\ntEE0XC6R8aHS5hQsf2MV+s6RAEJCLQ/KB70DN0uAgT6HXhBpQcPBi69lUL5N\r\n0xy8wCvQmknz/bsE9niea49rvdVW0O4ND0Kd41ApBlydoaTXiEA41CS7sLin\r\nStTYEUfrb9JzZ6slHwuka0ztPR1+ilLI8At12Le4lI+gbzs5E/dAqGey2epV\r\n2DClYNaVijSnybiuJjOvaXPYt8RyD/RrQEmMgvvX9k8HM4TZHQKBj5oWsZ7I\r\niDquZela6xMi4xonh0UmpnOIbg9Q21NGaHk=\r\n=qlqP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f6d4c72358578c7447743f5d979be1600675c25e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.45.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.45.0_1647978778086_0.11560794493007132","host":"s3://npm-registry-packages"}},"2.45.1":{"name":"@apollosproject/data-connector-postgres","version":"2.45.1","_id":"@apollosproject/data-connector-postgres@2.45.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"012d04f33eaafb03574b7f1b45e8ea3c1768b663","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.45.1.tgz","fileCount":348,"integrity":"sha512-OCAxb1sXi0ut37jzIWZCuQ+j03aSsjZllPGg6586KvVuXW3HMjGMgxrGIXIFR/5cpZDzvo9J27+cWG05YQwAqw==","signatures":[{"sig":"MEYCIQCT51c3XopbuBX9Txp1EYYl5Dj8mSKPecr6YYWe0mgUfgIhAJ25tQaVfcbt+WzxB1+G1g0DvNzGHdZ3l+wtXfJOuoDT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1097557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQwpwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDeA//eNpGqgvXBudhhCrXE8Qe+jWvR54h0uxWqVMToPJ7eErkeO+a\r\nx7Fazb4fdgqS3TYJnTINvqB6Qqr9WtCL3ZIbvudbzYQ6b7kexNdZ4G3yilI7\r\nCoTB9fnY0+7fs7M9dUPkP5MUcNSTgV2xbdGjGz55v3lKgfvJMv8Nb6tD+R3x\r\nIjGYEWO4cszvPOgQy2UskqJ6oZdCTfKquVUTPQ1dc1G0pIUtNgxnxkn00DmP\r\nnebHSOZdjerPOMMMbIdku90MoI6fJ1ZkqDs2BtXzdShF+SjpnaG581R4pjbZ\r\nsoWX7k/Y+DWO3OUrY4YpqnF2FfE+KSFTpKTL/8Yer7gKsZ1gYrYyK745zWxk\r\ntg1rDhomGuVjltQWObLrfEQmiaX847/0dBFjwcdIeRnM9YcG2IniRaGhwe91\r\nVU9h6u4Up09Zr3FN607f5Dj953Vwa9japcGC9uMwPntA2ml1xaVqWflXdOoI\r\nUTpFqMJ9rUzBBebNCN1S5iXMRdjH7i/F6GeqzxdGmolqRwpLnjn7V9/L3pv2\r\nQ6P+X8/npMe7acIkdDktaCBirFNPdmjQt2+Bv5+trftrBxzRvdDvb+m3DvaU\r\nl0WVFqDfJuX5zTcSgQk4PwO5841OR1bo/SMO1LsH2uG1aK9HU5/+6Z2y59eh\r\nftOFLRRzmr/6mQ6/wVA2ZahnFm4gqtSGf6c=\r\n=cNzy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"61e7730ca9f630dfa0e8fe95731cd911628c7f9d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.45.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.45.1_1648560751955_0.35027777102117885","host":"s3://npm-registry-packages"}},"2.46.0":{"name":"@apollosproject/data-connector-postgres","version":"2.46.0","_id":"@apollosproject/data-connector-postgres@2.46.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"77bacaf2fd35641d4f8b93f3470bcc746742cf42","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.0.tgz","fileCount":348,"integrity":"sha512-4jO1KwAKKtzrEfS67dmDUTQXdLEwrvtr/NNOuMM2m3jWnIvdbhBNG2r+YScPt514hKa44m111Pvow2Kc9UMWvw==","signatures":[{"sig":"MEYCIQCyLfMsLr2ReIgKbDzHyr2aha9pAQ54bGrR2vxBdT2dewIhAOou+guJEJGC8FtB+aYlZA3qht7irHpiQMhTrEsFiKc8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1097742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ1ADACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSnQ//a/pLisJFAEUHaS4CmN7f7LblJjloW/Gqs3Vv+vvK4Q8AmPym\r\nAlgNwoepuVHEGsclUupUNzh12ladkgV3nWjubGwOUY5uKOJFBF/5uSZrD+0P\r\nCXQQqyv7r2wNoGk/okrruRLKA5klalHI+rKpI7L8yrKHNyXItalNYHB+G37Q\r\nWanX9nVOK10g78gNL/9aMpn+Nj3rT5IGAk+B65VM9Arl168anHfToBumyubu\r\n0M2U4f8JyKLmLUiSbns0N9UBttzOOiwIMEx6NvoQofcqaUcBsyTS/bVIP/Gk\r\nTRNGaSFd1UCthINcCEyJ8mu7Ic3BjZZy8dxoh9RZJ1LBD8u6RTPstZ617Pb1\r\nH3Z6ACA9F6Ah2Zer25VGUYfZPpLZVGd9LsxfdB2F8Bq8CumsosqEwzenYUyO\r\n7kl+LHpU5jLcQE84OpkQhd7BIbQ8SDcZBNIpnwcQM5FX3iveMr5kMCSeEEIk\r\ntot92AYbR1qDg6Z47uhCxZfC11yA+8MOoFCS6lw+S1LkADwwaBtMW8xQTWaC\r\nCAGpaowOz+/UhJJOX+4PvIzZwk9J6+o/jhqtlWMRAPz7YcH9oH8Tm2vezqZD\r\n2wiIxYmVuJ/3ns7MVS2qvuDyawIuuW8OosddzYGYAERyK4pfmIpmIQYvZAIU\r\nDl18pDPrzS2txzie4n8QkkPPbGnmmZueRDs=\r\n=+j9G\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1b53b711f6723b9ce61d638b0600731ca40b3a27","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.0_1648578562918_0.11662995294152712","host":"s3://npm-registry-packages"}},"2.46.1":{"name":"@apollosproject/data-connector-postgres","version":"2.46.1","_id":"@apollosproject/data-connector-postgres@2.46.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0fe5349fd0bda897208215f30c346bdd4897cf21","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.1.tgz","fileCount":348,"integrity":"sha512-uFnxcKQeXB/89+quJL1oYTBlxlScOLNJAi8BafLWLxUnzEV0BVmEk2sjH/d5KVjAGuj+7tvuPGoy6G/UT+onmg==","signatures":[{"sig":"MEUCIQDH9neQJtKY2etxHN6/dYOYEBOYWekHvePbT2/+67dAQAIgWR5u+MXaiK6f3yjxtBOUuMkbNsdawKKOCMrPETG4kK8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1097928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRHL3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6BQ/6AiNdWLIDpZWX0juobLxNTDFXbu4z0X9VepBt/eNbx/OebIc9\r\nGmkr3bBXKKL0aRx9+ZnoivjQj5fWQM6Je2Wdf1bS/SiammjoVdLlIRPk0sA9\r\naVZOVAXnMlWFPZAT9mCntGo3o82RdFBotV7uh4ne4Qc+YQWFMwdAQjTvCG31\r\npy0ekAudZsTgXC9EmWxkfl4DIJfGtMwE8RF2uodkNFpAnJjVxj/58iVsVZ1V\r\nMrC/UIvpbQnoHjSHDP9EcsbyeAb8OTE2oDwVCuY1FguSJhT5SibyHu4Ci2Sx\r\nhV4vF1JpGB+2aA7XRWXJLpPrZzYqABgl6RWo4xHo9THdVqATMFx/10mzVPdV\r\nVtiH4GsTvcCkKgMi2Ncwx0hqg81EKkrcSvl5+odEHqfaSdbFWNAqh1qQFcuV\r\nIwH+864J7kXgy0Ay09QWvi+JQvDJLsquHfMBL1K/za4fJm9S9GR3khbefDnK\r\nbI6bgo0dO9lwh4Mzq8IDhB8ApakzBLHrCXe80WKUsVkV/f8FVnAkSooUQT2G\r\n55OoCIc3jbaNcsw3NLFnKbljuaEzrDVDp5k7EErKeOJDteiWEjIFIYosHgqe\r\n1Ve73z3TsKcAJ/4ijPgh2NLPjTL34HsQPHotTuurMULfcguRgyiXcQeQDk+O\r\nUbMvn4pvIc05jftBSyIU5jEKr6JsMe+ivuQ=\r\n=/HjG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"55e1f2dacbc58e6d9d7edab4eab19987912fdf83","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.1_1648653046848_0.5601736975565685","host":"s3://npm-registry-packages"}},"2.46.2":{"name":"@apollosproject/data-connector-postgres","version":"2.46.2","_id":"@apollosproject/data-connector-postgres@2.46.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"969b3008766b591a6b9ddd5b4bb3c032ac214124","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.2.tgz","fileCount":348,"integrity":"sha512-gCph7Pjfv+qTkofmNXhnoh+K6UJ5Ro5zhzghjcTApkOCe7F7hOenD92eyo6Vef7nuxquTSnA95Q6OPx3zinxUA==","signatures":[{"sig":"MEUCIAtRkrPRqdMo0OqHCoT6mWrhz0meMAu1auNTZOFBIAfQAiEA2Afd4EKRPF7Nh9PPBRI92iyfucJLWoEPItjboLRqWcc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1098114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLFgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdcA//WBKpCPnzwfL5e9IJsepQ0W+J3vqx5K+/ZLbOxXp369zq2yTS\r\ndyCvVC6xUG5/ko7qkCOuVkr35jnktgyL5skpKeov/O7Lyd2JZMGgutnC1gQM\r\nb0g7feo0SKkgZUOURe1GzPi4tDNBEg1tn7afWVObz/cXJZoxU5ymOtDWOFxb\r\nmwzOLyIlqD9pDCGaIJpNAEYSXTcf5O6uZKwU6GAaKo1Zp0teLWq+wXGYF/UR\r\nL5yCUn1NBOcwHJ4I9uxXR5MVMLYY+SNxXJLM/l/zRQcxSbcQknKSApBpvEy7\r\nsjENyh3eVBLabJSBzo0irMStLXnpUn0WaCwSouV2drTJLeHUXhRcbhc62d9a\r\n/tRxR56E5rp+DHdnwIcWvnyuBJHXRLiAKjfpBC7Zcu0vbTWw4/sQoeqswuBj\r\nVFW1+mLGCT6JbdDsRv9Aw5g/UvGDb4ijzGbPlKLomFR3JW0ZoIYGzZVeyPj2\r\n/3WxMc2HpUuvxjDdlsZO8AB20scCDvO74SbuWAKs69If248nQgb2+Y5udB2G\r\nF6h63SWHl4YhQH2ot+MaJ5m9CE5TxKBNwdtGzmVEPD8yt9Ln4Qi4Gz2znDA6\r\nVCnfKPa5PWQMgm6hC+Hydk/2MnyohthVadExwTSbZsmIGIDT1RSxq31+6Sev\r\nMIf5mOZytiBOYN7ns6TtAJ8yXKzI3VafD7Q=\r\n=8JXx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2055046e5cbbf1fdbeb484fa1c6210d4252a9021","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.2"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.2_1648669024027_0.9886573917877319","host":"s3://npm-registry-packages"}},"2.46.3":{"name":"@apollosproject/data-connector-postgres","version":"2.46.3","_id":"@apollosproject/data-connector-postgres@2.46.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4ea07064ef83fd0c5fd73e17644e21d72f2df1d2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.3.tgz","fileCount":348,"integrity":"sha512-2umx/dnr1OHUt0SpGY/ORQl5PSBu8c3eyhXj0Q6Z56e6d/nSz5l5bpwn/wErWlGxbj5TC/6Otd0cE0yRn5Juaw==","signatures":[{"sig":"MEUCIB9IaRJevk5x6XHyKsRCifOC+NC1YJVB86LbW8cT34P7AiEA2DGHOdryDDSKbtseYDSRn147F7JAOzV6SL0J42pe0Bg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1098300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLIWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJbA/+JDO0cOz864ZaYleCh6g5qcSmUo8NuCvOvw9SDsoJch3Zwyi5\r\nwSQxbZOxPoMePnpzxFKxYBnXWpIf+8HAiSWh9npDLXyoWMGHhmrCfe/VOtvp\r\ntAvT3yVzgol5/lNIKabWWermHL7ffCgITEI24Wiguq04hTKeK0rmGMziO0Ti\r\n5Xt8hKlQ3byvV5oLtXxcsGmdnJOyr8nt0bPRhiZIOOlcbdegT75MWGMFRG6U\r\nYcrjmGE/OgRcBk+8zVXRIViEgfMrDLw7RHLfAJSMPMyXSzb7JegEFCS4qy0V\r\nKkwafmbc89IF8MnMT7xK8ZzRw1YtM1lG4QhnYRyDvrSSrLsgjbG9cVSFgjhV\r\nqq9OgDgtQ6ewVMxE6uPcRN6VDCIC+uOlUiPvw8TJsTG8pBWwi9dWDYTjDcMa\r\nmKXbCmUGF+AAwnOuIvagcuSp6bGMQdp4I5UiKHrQlW5d9ikrYkZ1RXS4AXw1\r\n6Br9kE+RpQRWWbp/8ivmfY/HAEZeFhsZcNmKfGBdvKMjLKEwRAMRpFl+qbmd\r\nmGyy6Q8FC7WsbeIdDKPffhccX7bZsy4ET9wohYM25yBzDKUfG9MTasZzmWfP\r\nY2C19dNqDAlH+DBu02xuVOTeztF3A5TtKmytb2x4JhHXAFZJzbnBsGEfGE0M\r\nHPvb/SbnYOj3opT1mLJI1cRsh61mfnUNeGQ=\r\n=IPgE\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8ea7936670611cd8fb9c4269585f37db3c66cc6b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.3"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.3_1648669206002_0.6754669957146702","host":"s3://npm-registry-packages"}},"2.46.4":{"name":"@apollosproject/data-connector-postgres","version":"2.46.4","_id":"@apollosproject/data-connector-postgres@2.46.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ce474825e0413e347a61ec657f7fae698ffce3c8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.4.tgz","fileCount":348,"integrity":"sha512-+d1vWmJ8XLCfWcvaVOzhZtWpLNKO5q8OuXburUc53oMcsZYsUOBczaecySvfKIkK1AF4McO4+j5rCOiJIk2f8A==","signatures":[{"sig":"MEQCIDv//KUa4A3wxvSUIuprkZO9muX4vJfurWhIGBUnTxy9AiA2wZGeaCT8HfxLDE6bHGTnfSLTHp/O//6A7485iHhNDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1098486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLLyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriSA/+OS+Ts3CRa1pKwOUZPOdTElWhBfhoO3enCMXOQzNzSHau7nXj\r\nWALiQTtIHo2q9ZuaNTDHz3fbcH8bxKccH/1OW0o4aPMvMGd7lL3YWacWPj6e\r\nBriJORXXcgIt3pH0KP0ok6hbf0KpTkpn+vUL9YCApXBClCpfjkGsjShY5Ck9\r\ny4CIQDxa8SHyH9gHvw58HLb/6ZwABaTsCmD7grqr5d9TOgaQfvo/Sm2DMJPh\r\nzk23YKHOIptm2Ghp+IXOMPSIuOZ+B2FPeifLWchRVtRt9cY/tN3KdsZtrXUP\r\nVgQOIKwxdoQ+VCaW/KnHD3ZwQ6JkFrwMewvvOZwzNMGCH9+wxynnz595xvYz\r\nL6/W+/Sa3RBqZwUYa3Nud1BrazR6KCscP9kdXrkBqcAkXFa1Y41Aw6o7xrx+\r\n+RgCztQFGJI2kLBkjWQx2T3hEwyPl7pS2rFGZfO2pqwoscHO4mWLd2x78DHF\r\nuWvlHzTRGrZOxDZbgNE2qaS67p7IUA1OfNt2eYup+yVXH4mstJXO6ZkXV0g7\r\nYlJwCl50Wte9mjAw8DZjslteHIW7CUfRNAV3FgbdMGEeDnoJskO7eFOJwpxr\r\ntVDJCXZt8ESTtitaTjcwQaDO4c7WEklmJy8SVfge2CSxl2g2DTrhHkMZDO/A\r\nbTJ47Ru2mDZpV1+Um5PmEDqZPtq6c7RDihQ=\r\n=c6rj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c48583d94569acbfaf3c8565b45df0ba7dc19830","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.4"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.4_1648669426334_0.6963252337702146","host":"s3://npm-registry-packages"}},"2.46.5":{"name":"@apollosproject/data-connector-postgres","version":"2.46.5","_id":"@apollosproject/data-connector-postgres@2.46.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d8db4a4dd413563b83edd5663e8948d5c16bf03e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.5.tgz","fileCount":348,"integrity":"sha512-Co4cyjhJW3Q5PXth87XzG3PZ5sA6JlBtf90WFSC/N8lSNR/FDDLgX2uQrUZ3o0UlOmPeBqOd6aeyDfHOrw6lyg==","signatures":[{"sig":"MEUCIQDwRUo9QGXHooOeIgrxCCO4HjrsDUq/nhIBHpckDJamHgIgVwmnMVjtieFLO1q7ITNS9zgLzjfXObfNqxBDratRmVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1098672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLOtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzPA//TZij8Jv27dfWiW18AaoOg4OKBs89uJxyq8re+n9DjYuBD9xz\r\ndAXu+mEKG+tT4rJonV3cjtM19x635cxkPcT8htjwJTslIQChuNqdEs3cTb5D\r\nRxc6RwKH3ETQ7BGPFuCYyZ6qig7wWhpMeQg1rlhunBdVszM8GzmR4UckVRRO\r\nAxlzq9q3qQ9Gm/2QGYUGTZ3lXgIDcHTZiStBghsq7Ga9eXiKex+I4dAF2bTB\r\ni5mPi4B8eSIICm2ytdmOkBTi5bqmleZ5pIQCo9Io0/5xo1AlTfYRtP31Yru3\r\neGY67i/4PLSjfrCdXlU2k5VApqEm2aWQ35YzQ4cqASFsHnLyO8X6rTIOGoQt\r\nlyp4R+Z75WmE7c8oJ/YKrzl5WiQ8otlzyVdusDvrrX271CeLgtJxUJCM17TI\r\nIpe1pCnpWePzGxABXOpSEZb9VwwF8h2qO72hUtUsa3uIYF7l+VD9qRBykYgu\r\nCugnQujpMAZxNQnns2ejGAfZlCNPZjx9PgK3vKvadp/Lbph25nGs1zdBvzsw\r\nFGFm2jvBcITKjU6ojFc75lxywjTHEWDRlDWNvbprR48hDehO083rOpJNAOmc\r\nTvyxtdzC/8oNhmxmDN1x0LovxIzylr6JpyFNcTZQL53fZ4RtoZwTD2YyqCD4\r\nc1/28TQQq+X7g01uYp4CpihOP9kgLx38iE8=\r\n=jwXn\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b08250b53767f9a1bf580dc74cb59b2ab3c68f96","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.5"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.5_1648669612857_0.21595754027534575","host":"s3://npm-registry-packages"}},"2.46.6":{"name":"@apollosproject/data-connector-postgres","version":"2.46.6","_id":"@apollosproject/data-connector-postgres@2.46.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e30835eb3b3abc012f19746aa08b6cdedfc3ee77","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.6.tgz","fileCount":348,"integrity":"sha512-3swj7e8c9scVkFHfqQOGe7Ui2/9PGunB4pwlPuBiaFNy53Kuq18R9Fce7Mf31EwaZMJaXSUh8Uv96bkxRL4GMw==","signatures":[{"sig":"MEQCIC7QUOUTuW0kvI0LMSO/QKcFJ5CTpXpJ8x8SZU2aFY78AiAe6W5Ufnq376AtlznNHRKPjyh3yk5YlF19hH6vomLb+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1098858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLSAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4lw/+LbhIh+UsfETFsbXGAzah3LUWzw9tFMNQoGzNX9VfVLkYf9Il\r\n61DVdAscZAaAWsd8n9a77z7hkVI6UpGV7mFnGssU+b7EUy90gTdT8iJ5DCu0\r\nveIQ278KRtm6QF6XxsUSWQjOR96hbD3TICmfqIKh9cukNwOQpEeHs1O7FxH5\r\nPnbBImeVN3rFsCPD/X6HVZyRJc1VBIURmBrryZMUqjvoNRDVuuZ024rB4838\r\n7kWt6XYc3aCcQTEAeBzUgubaR8VPtXY5/UhpUEZ/MXkJzxcgPjRwp2S9BL3M\r\nV4lBBQ7aTD70d0O4QW8c218xRiOFwHrd3ZDjKi/vwMvK7Tt9lAruLly6eNne\r\nhWwPyYLiYY6PDFk3LRV76FQg4gxDAiRPmlK/W4gO7PwhB++OAu2zdL4UT9Tm\r\nt8w51gZsUVWmeQWBk19ypt/cHJN6rc+pLVByQuSeuuC6kvmpYt+JN4MC5f59\r\nbJHlmFCFCc+RS3HtYiX8OXAdxhSlb5+Hewddq2/3C15J8wOlD5W/sMae5Tnh\r\neviLbC8JWMyqOLbyVMywsK8dZhS8K0M+gLMmzUMOVXc9Ibu/rjqdBUnmpuFd\r\nlnSbqn76a+TEgMG2N2rjoG23D1A4FnD+I6X/xy8sIqdNpsOfu4p8WE1MQpVX\r\nN0o6IhEIjEZU6NgEYWGB869NWxz5dCZF/aI=\r\n=N2ju\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"769c125f3919a1c240f8cef52d37e204996f7167","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.6"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.6_1648669824566_0.07731980976262842","host":"s3://npm-registry-packages"}},"2.46.7":{"name":"@apollosproject/data-connector-postgres","version":"2.46.7","_id":"@apollosproject/data-connector-postgres@2.46.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a96af3756cb25aa867e9028c735ea9ddf0b97d68","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.7.tgz","fileCount":348,"integrity":"sha512-4WEuKlH9FXKgEnnEjdsdogl8Oj5RM8KddG8OpOfIL0t9Eq1Jd7av+Rv151I3Nh0catQv2BXdB1v0cVvjv+nLPg==","signatures":[{"sig":"MEUCIQD8OqyXFHvak8e6FITvE6a5RaXGanCrarEJjMBtgPPM/gIgaqzRuZ8i8p4nfOGEogl4jF9Ocvfduu5haJT5kemRu50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1099044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLUlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRfQ//bkYLfg+WMEbpwOYjzlojCKWS14fOhPiSri6y5YxDUDMHm5gb\r\ncZrVKPHqg6vFoHt8lPlhjeTQBrRBMBec44W2RP2jI3taZLNzzzVIjvQQVEOQ\r\n1O0+f2WgVfw8OdKTcSOfCRHZLcR2YpseOq0kU058XRUDedNTQ0ddnttTxoMC\r\n+tQsivIPPUFjT+5Xt/k4ORiAWIur1WK0xSXcURLjUZSIgfM0D8xI8SK8kujc\r\nW8wO8SvfdbnddC8AlKN4FMpYhG01WniurlW7jt9h/AfaNma2wu33hCCLK2s7\r\ngKbo8SXOcfi6qyUGJFPxPqUawGkp8ofRNpgQnO+VBKvuMMW6+JEDsi4pqpTb\r\njcCpsAIJOEKF08dz5xn+as61iQRVRtHkoC8acgUj2x5QK/vj6FMiYQ3Ib/CE\r\nxvK9yTv14TcwivOncnwE3useVflJiqeaSVOKWbnf0t85kdiGxhA65M1vgj/O\r\n4kly68Of+icT9tpDgeYjSZyRCBJa/T8+BrkBdZ//ygVwLKar4p/TSs1OFG0R\r\n+vB0lya/oridgtASF4K92K2PuameBlAHwrhsGf+4LZCN4+6iPdiluhBsxxFw\r\nGGY6F/HBbzDqvghyf7KZFvHn1GGcqDy60//p68hvTWIyXFrMb9dv7HHnWYtx\r\nVrjffcDlQ/WO9s/Wb7f0s97cY1mub+N3myg=\r\n=y1Fa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d5718a003f67a961c5b03a967c68a9e0fd77f840","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.7"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.7_1648669988843_0.8213359273530465","host":"s3://npm-registry-packages"}},"2.46.8":{"name":"@apollosproject/data-connector-postgres","version":"2.46.8","_id":"@apollosproject/data-connector-postgres@2.46.8","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"aa7cdc375068d686c510d1325e63feb91d22a876","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.8.tgz","fileCount":348,"integrity":"sha512-2cilll6cdwFwrhskFdqEjZ+m1l8CGZyuWvnCWyKCDNYpH3LHWmzWuJ0OHVoYioM01Nqs0zVMCB0GzyFpeNVBDw==","signatures":[{"sig":"MEQCIDmxjI6OsqFVFSI3ytB58OvUQQOZPGMFrwq+OyRrVjeQAiAVU8EN1shDY77FleM9vsQoJnsB8oHx/xIt/N1Ao1Sbqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1099230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLXEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcUQ//SjYL9lS5zBLgWLmC3G96bxRKOf1CK/d9zseAZn3Nrq+Pe4Zu\r\nD1amvgHoc9e/TmfPK6SphaxaByNv48HZbjtKWH4opng+EdtupJCos30YJESb\r\neCMmhECrjf3BBT5S81CeXkHC1yf5mjMdWFLjz9iUddCSAA+t3/dSaVyB9w/o\r\nFw9QssxCxRZegCGvjHnZc5MHk3wqT/DL/TMxSYWzaPz0DUQsl0zYB5JVjJT4\r\nwsnxTun6t0l7lG6sUb1xE5iHN3clKnQKHVx5Znd4IOnfXJmhdeSKydPgBmre\r\npLp2/i5l3uiijnEttH4zDwgB72A711ZM0Fdqm3K+CvIFgAyP5eAzjeSVf3hr\r\nPkQZ6A8NqGen0iTUVxiJ9wjiswmav6x+thnO864tY0nZnFzHJceErcQQq/S1\r\nu5Kv56AQMpY9avu2KczUiiNYANgulGiE4OTgojyScI8uQNNvSgJt7ofVXSra\r\nwMNJwT3iCvJ3qCQeb5u6kMzzGwbdmg6I8/cQ+3ZmW5nap6sKJgPR3St7ILUv\r\nVZWcXQ3N9KiOYFMuFVJsSOFGggLUHS7htnBBxC8aGZLamLuDtCceB1OoFTkF\r\n/cmr7sroXVrYIDvJ5KMnT+pgZ9DRbAEZceVhHXgFksRzDG6e3wMlkDFIkVet\r\nZPJktHETD6gGR52aqILOnMggt10kkfluRmk=\r\n=v//x\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"060359d8d901806bf09acb6302fbf35241b10241","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.8"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.8_1648670148097_0.7532642388966946","host":"s3://npm-registry-packages"}},"2.46.9":{"name":"@apollosproject/data-connector-postgres","version":"2.46.9","_id":"@apollosproject/data-connector-postgres@2.46.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"63266e7d0611ddaf4c5c2fe8f729d3171a76858f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.9.tgz","fileCount":348,"integrity":"sha512-QZTpWElPDcs8Hz3Te+DnmC2Lyzhi4yLobxfNIFGnJiQDtq97vzOTPmF+W/4t36qDWqhEivlcEklOUU2SmlAPlQ==","signatures":[{"sig":"MEUCIF2WaqPjmHdllcLQhwWIEFk3hglhvVSWgqa+LwFGPeJiAiEAnPJbhE+HlbeEK2cbBsR5W4XukzdcJFJ2d+vbUf/gLgY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1099416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLZyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUjQ//RDv18LHg8sRjt9kuI0KpTbr6wRqbM9GWGwYqTZ/SJ8qnEfod\r\nNAF815EvpeREVFSNv/i8WOTUvEtkOLf3Yj59ylnvH5zNt/0u9EAmdez7RLsO\r\nLqoShv8fQax83jifLJnqWVCudRMbfCGqiqS2A0CJzL2l4poXbXz9DXnebLbu\r\ndsehCvjRMdBEzKWHX6XNwOA/nYs+mrrgU/spcb73a4p9+AWuRZHMn9GuHNX6\r\nHjwHX6arIZ56iuSAjBdl8D41hzj4GQysxC9BNT1dAZRA2AukDEwGDOkg1EeW\r\nysAaJZPNZLCKDpeysHIQM2eqBUMa4+rUKKUuptYiR9dIQD1NzNh0qszrW1AU\r\nwUGezkEJwDHCHRUw0rJcnf2NAdTjU1cDofwHaZeYLyJy3q5XTA8HmkqLNK3/\r\nNn8yCjut3QtXGZF6cRf5Gpkj1VPcP2sGchkFK3lvWtNCIoIJHEpuK5rnM3CZ\r\nFqBAgeZnFkHYsil9Ymu7SkVtbvY+aZkI/NE8659229i6VDd12ySt2O7ENcQA\r\niQ1jKD7pmvWDEB8v0GFzX1BBBWVc3hUxPlyDCjL2vqXpg80uEIB45kDy3wKN\r\nyQBfKpTGKRVNvxY+miJQgMBViaWSALBmmdj8eFiepADEyxXsEBkbEmNCJ842\r\nuPDxmMgM1pk7AQV1B/1CFXnd18kx0SaIeiE=\r\n=caNf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ec5b83a84465b89beaed94ded0c4b2d6cfc399a3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.9"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.9_1648670321937_0.9463503209119313","host":"s3://npm-registry-packages"}},"2.46.10":{"name":"@apollosproject/data-connector-postgres","version":"2.46.10","_id":"@apollosproject/data-connector-postgres@2.46.10","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fc119a2d1ed455fabaff79fbb8f87cec7f4b7c8e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.10.tgz","fileCount":348,"integrity":"sha512-op5Ah0LDn9cbL0NBcixHmycu4GlonjbPanJLlS24bh8kdk6n/4gXaFVwXl3mb/R1RGni20s7mRVmvRFmDOnfJw==","signatures":[{"sig":"MEUCIQCi5lvj+pMPUUpIbKr96jKUX7mbO04Z3ezBtmgGatWWeAIgH2Ia9+oSTYEmkO0jV0tU/thbFO/THyXXF+cO2LtqBM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1099606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLcfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpChQ/8CX0V+eRNdhWkynYF6hThYbg/+tEf7QR5tzs0q9rIKXHKfNrz\r\nRkie+XOwaJRLEb0orsVYnnaAwtELaJvXtlKe58zugAOwDgyODWBlWG11KFyD\r\nW4HFrDykt5sb0d7kV8j1F7pLQT/bh/Zm8PR2r2qmmiG8N9+RrOYtPjPst/H6\r\nutQwHnk1+9GkaZKd5vnJZ/QsgfMRWBhPSP1xmwQCPKxv3EMFPfB7UNEfb7c2\r\nZepmIM0igiHAwNYEETkgNfYQDkOq6s3EmkJ0jQQKAmhdYQsMjOipP0oSdqbS\r\nDADYNvwnWeoQmuDfOZShLdl+vvtn++HDNGKu74867iTnWAtpXGxC8uBjnAIU\r\naNoTqb05S1afHYEDkRtcXV5/5ik2i3CPJSiC+f89DjgU3EcMp9zxDWbjDKz4\r\nJx1Iw8icr1XYVqizxw3glyaXFjsJR8v62ef7svGkV0Zr20ttN9mtttwlpRt7\r\nTt4DCctgKFnujVQgMhY1tcha99HkEArFPqCKH11qG7KZisogD+vn6DdLNdul\r\nAIVTBTFWbFYZUSjGzxVHosHxA2HwFRvs5DBp8XP9HfqApa1ictSj3K0c6hzA\r\ngmtofEACqw5EAk6XsmTVuq5HNVYv3Bf/3CFZMolcPDPhidGGcKMgMqbpowJ+\r\noiZK02txcLhOdrbs698u5cxERUgff4wrxtA=\r\n=Ei6a\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f3a24f5bf298afd9d054863248cfe5af1ba154c3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.10"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.10_1648670495461_0.3841285454528043","host":"s3://npm-registry-packages"}},"2.46.11":{"name":"@apollosproject/data-connector-postgres","version":"2.46.11","_id":"@apollosproject/data-connector-postgres@2.46.11","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"36e4dd64964cc8693f50c43eb8e16aa9d2a62b9c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.11.tgz","fileCount":348,"integrity":"sha512-fsKhisJOVZ7bvomKlnzEjH5+trf2Ea7BsVFBmovK2VnhPCJGFN+4EDRxNG6UkZsncl+PydLUap57o806hjYJyA==","signatures":[{"sig":"MEYCIQDJ46EwxCYlQGPVNbqYpIo8DnmZHW/JYfBVfYr/ZNpuawIhAL5N/TWk+S8+/PgfQvlak6nPXbIWZ8ZZlIl8lm5V5PbP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1099795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLe5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrgow/+IwTRA1Kh0VRlFMHJRb/3rQWpTww2vsLymNADEi8nh02A37YV\r\ngx5/PXdRruYeG3Jbv9XCjPwqSsSHAw5/HRzfePpb1FeTXaSvbr7VAJQb3JmX\r\nKQWcsoMY5SFI70ydeZeBy7NOEG1+Qb6QuKbHUesJSgABPJItx43iU/l4fxSl\r\nodTWNOYZrCaUF6cZGcv2BoSlBN5yLwkduZ7qtg0dM0DV0tP5Dx7zQFF4um5V\r\n8dw6Qs0+HdoD+pRf3601WKu9iErg3AxpSpy+yx1CqWEX4qumy+QRlA6VDTTk\r\nOGWlfPsqEdbNB00B5JMchLLwgkvwdRDDk7Us8YACMlDxjZ3/SO2TwT9XB2T9\r\nROeqXv+0GYMFl17MrwsWTUF2T2awJCLN5JdHQbeufKkCsnOoRRkDJdqdEIZW\r\np4mtcQc6eNO33xP0FDwsnRtUjhVnhRfCApMSKZeuaaObo0jePmJk+GBpEeJS\r\nVecieKxWp54YKzt+g/Y4pbPVrAXlmk8/mbHXxB/8MVB0FKBJtpYCn/SzS4gB\r\n0qwTeSI3PjyubzYez9lnQO4kIfsnXA/aEUOkiZoXRsmx4xCaQL2s3oF3SZ+4\r\nIC1Ti0xvr1lX5Aj9G+yJr30NUfrr8Oh8Bnan37QFtsyDheYMImjFBUnJ3A1G\r\npE+eozT/FUNgotva37vlKjjbwfGIVHEDzQY=\r\n=gJXA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b009e6e643b5d491633984ff2c6b24a8b6a0c4e7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.11"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.11_1648670649308_0.6418447003072079","host":"s3://npm-registry-packages"}},"2.46.12":{"name":"@apollosproject/data-connector-postgres","version":"2.46.12","_id":"@apollosproject/data-connector-postgres@2.46.12","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"02fcfda93ded8d6f260a073880314296378df71e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.12.tgz","fileCount":348,"integrity":"sha512-LCnR61q+VkYBLObbt6Gruw5owhlJv4EwzT9yxz0PZZ5/5HC20TVHystS4rk9C+W5qzn3ZmH080V8BpaCW0nmMA==","signatures":[{"sig":"MEYCIQCTkt6MweG5ZVeBcJlmJshP5J4AzaCJoqGWVi/x/usk/gIhAOpA8Ozn2/IjRq4CjW6+nnByaaZi+XppRaMdpA/eizQP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1099984,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLhuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQiw//ezG0McUrfjjHhNdBdMm4XDgXpv6b+NqGBJtJrV5hp9bNQEVg\r\n/c24lMQUte4bkd6p0R0vLb20KxS5xMy9uXJlMVmDWdGcgs+vkY4DTDPfO0WI\r\nGoT7LDXoMJHwR0WA4uyhylxQz1cz9tVhqiwbMjJmvNSDbiIvE0pahzEC8L0G\r\nWixBFZ2SjtvN083aPuVqMFuPFY66Ass9gAp2WppRDdlbtgUe7v3W/3X4uSMP\r\nujSBProV1AzoMVwI7Tlw5xP1pegUaBXcvhFCCfNqstUAif38rFCktmS66wvY\r\nrexFtwGSaDMJrudO+QbDdJnLjppHHX3sHbCN+QgGm0RLuqh6vnmeq14moLZr\r\nVavrkKPh6wiMx7Z+Nqe4NCNH9Vw9jbZiqu0tz6JpvYCsrf/fpXQBDhF9gYHl\r\nXOWzJMR+zfHdZDIlikE65Ywao+/DqAIRVUC8qLAsgdp2LDozdEQpJOOs4lR1\r\nXwEvgzhNWwwcFhCkCrMyCOEXlrxgMfeiVRmc99PMrl7VrXmsUMpM2VQ70VZ+\r\n4WQPnDKcCnczvmNO0U2FWud31oy7rqtTNn0t62dO6FrN5agYoMDpm3VqSOha\r\nDffBImqfNt2xnX5yi6E78yldsdLSY6G13UxUYv5nhKbLYSWj/OdUry2IC7uA\r\nrR/V8Ym9RCnY3AiWsqGSJoTg6iRGdDGp7c4=\r\n=sCi2\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"fa8a23dea0b9b8aac3bc51bd7124f9bc102977e2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.12"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.12_1648670830798_0.782867463668047","host":"s3://npm-registry-packages"}},"2.46.13":{"name":"@apollosproject/data-connector-postgres","version":"2.46.13","_id":"@apollosproject/data-connector-postgres@2.46.13","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"98e938948ccb61a8f0880e8d836faeb1a3af135f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.13.tgz","fileCount":348,"integrity":"sha512-Jxnl86C1KVCfkQALpF46GjsQxZRbpC/RmZdd0aC04WJyHMBtP2lWqO62+VWNBeg8nymQh0Jk0xgxqcW8pKTH+A==","signatures":[{"sig":"MEQCIGPvvhbKzR+Hn11EYFCyeqkaTtciO/NTbnfvQWVpHK3jAiArD3HbupayJsGSwxa14iiDzjM6mLeW2IYpmeSxUCISHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1100173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLk2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOmQ/+O7LPYDECpfGvBzPK95BTmHb66vhp+m2pRWPCL/q+yHZB+CZV\r\nwZrBd9vl1lUZkOZ8DK5vKRknfBNXi9sBsGOv1Op4dI2USqP3uSFfBWfabtLI\r\nTIubiWmaEVj+U7tUoxGdgNfc/wJnN10K0NRIIdOMVVdLiPBvfhLhmopNiM+w\r\n7mHUau36nRPEASXVMQkb8gcuLcRhtN8a11xDpp1dd2iD5yPpgS8Z5/20Y5As\r\nYmS+fhFMjTUzDYLo+K7QFRKDwzbvpP6UTL6EA9lBIJv/XFQzLHibZboGTRdx\r\nHoRyUgmdKg4gAr2O/+UTZYx0J7UICP19a9bPcbSjJm30TE2OQZ9RuqJDQ6DE\r\nnKxmKXdgN2KIThPeWxFi5cJRCxgN1koX7QqjGBSVat1IC1BN770Z5waQRVZh\r\nCmkR83NuZaxC0pAVoHB8LSFeLkGNmZjDjo7GwGpjBHw4fTMGfa5rxAEbYRKb\r\nfSk1qhowbWVxDc7+lBmC5pS5ViBLpoLThH8IodwUsbx6TiKsNU9tbjFVisv2\r\nT1kSzxDxy53o9iBif5piz5UeSEy4evXcVYwkIAsEG4HRV3t5G3+IxXYBHgzH\r\nCQ6UZ7xVKv948DFI4n865Xr/H++4FKy/gIAEAG+gvU7aJQK7rWOP78w2rsWA\r\niGDLsCkztNhTmO5w+WxgxVOadYFYGu0PHrA=\r\n=Jwmc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8840495b04613d6e5d609047b8626637c2f38696","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.13"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.13_1648671030053_0.44811202579490317","host":"s3://npm-registry-packages"}},"2.46.14":{"name":"@apollosproject/data-connector-postgres","version":"2.46.14","_id":"@apollosproject/data-connector-postgres@2.46.14","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d65fb1214515fd1f8ec24fcefd1ca11040d366ae","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.14.tgz","fileCount":348,"integrity":"sha512-pZ80Uj+Mg4QW5Ukeg+0jELSTcynHw4NaSXfQiLoKYlbH9XDS1rcQ+OigAQks+3M2CL7yDwVSFwcoR3Dbmb5izg==","signatures":[{"sig":"MEYCIQDFRtRvFGhl6nsovRsTlP9GRAFY0jeqEH2vA2bN2EtexAIhAPeQu/WOT5JhqAVPpg9D4lEgMgU5ZKMmZJkRMh32sXqf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1100362,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLnpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNEhAAokO55yv9wD9W0Hcy9ujyNV0UloLwnp5Fp9CTV2PToTop7wQT\r\nHg0qHuW8x99lo9x93qbYmDMJUzXahnx/hikxF8tWxEtfBpnF0/hryg9t5Jh6\r\nTtjq9ZTOeNuk/LpoHjksIXi9UBGU2jZB4O+uumyvVzIDWUroI2pIz5uXgh/D\r\nZy5e9FzVXWyF7lXUGz0j7k2Xp7NFEA4xOCBRdgMpeRVbucafK09JWXk+X1+t\r\nIDq7ftfR4kxgvsBU1qT66WBMX02tHNl5WIxoo6bgD/n2cqofphyhIS4s2eCS\r\nxFLP6/ljqceBautRQqEpqdis2S+rfg7T/c0DfBLPSJwbjUF2GP67QQ1dfPkl\r\nZbu46J+nClZtkNIK9VF/lUtnc/qcggj+a3/SNaNkqYTb96wNBPIkohZucRwj\r\n04pJ0W/FyXJlK9FeH96TU96a7MXl/zEL2LqDWR2etOKgHJMk5PD8/IaR3X8v\r\ntVMqD5LU7nZ85J0eVY93HpqmrxlXR8+KtvMrUjfn/KO9n3zSaJ9HcaIqVMWw\r\nS2tA1ZfGvl+d1ALYrpktwJWwl8ZUdHxz0XbN/16PPLPvDZUterkoNRm0owiF\r\nQAcVsw9TKTH+98S3FqMvypSZMLTs2p+WpFMiiutG7vWmrCplLLTeBfE5GSwJ\r\n8JqIgCrcqeqK/ausYJ+FuK4bLArF+maGKS4=\r\n=rSut\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4b7a688d787bd30e60c77ee401af83208f65969d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.14"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.14_1648671209567_0.06343270542128199","host":"s3://npm-registry-packages"}},"2.46.15":{"name":"@apollosproject/data-connector-postgres","version":"2.46.15","_id":"@apollosproject/data-connector-postgres@2.46.15","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"13c87eb0992ea83e82516af7fc85d1235803ef88","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.15.tgz","fileCount":348,"integrity":"sha512-CS0fd2iUVk+/thTM3CjFsNt2Ae4SzenmxyyZcanWLXnHAatsmV+7Cu6zQzvSw1GQwTBrGLPvHTWA3uVg9fRr3g==","signatures":[{"sig":"MEQCIDu4nUwRxYKqNCuo07cjy7R9NhAX495FWd3EvjrVfnWLAiAbbM4oUAqPCQO1bJIUnkAaNDiNTDs8lS80wE7S+Gn0sQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1100551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLqgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrU9A//aOBwZz0/lhrsrSzX24bcthpquvyn6+/25EFYd9wlFN3pxozI\r\n0moExzKgfIhOqeDzWTFBgRIzH6KALZBM7VdFqp7e2OdDoz8ypjK9IgayzOxO\r\nUu52zzlGOZ0PnrwwLGBpl5qh885/bGq+9L/UJk3kOJ0ytpXVP1P2n2FnMGGr\r\nsYn3b5R4KURp3TuR7u7M3AFvK8t3VaSXOOYFkRWlEdjScseRBbHHj1SCeB3G\r\nY6bEavcqMd4c7IDTvKC/2lUNM+y1+kZEN8AuemavfbCAWxCVSAvaG+M+i+6x\r\niuZWmiaau6aW+YGT1oWR0LRlmWkyPot7qaABhWHdNX4UsUvLByhwgvvjKlAW\r\nUA4siNrUSRLwHl1KasH+5tb1g8ZbVahmhkle0JB3QYNPbCg7ftd/XPgA36oc\r\nq/yN1PUkS94jGV6jYqqUe+KXd8OfJSW4X5yXh+jE3xHw4WoYYGqor5IQxAdv\r\n52LQDRNyFZnJHzdkSp/wuc9YF/Ae8qTawTC1c23VVuEE+27tMwz2BgE6iude\r\n/JMQ5nzRMep1Ibxz2XE6iIJ0lFVsaOkQb7qbhvlnPFT/CFdfqUqeOUGN13y/\r\nZotxocXk6PG4imIl8v2YSyP0yA90jzCca+0uizZXI2SiNdJT1v661h+/y7xA\r\nObKcZRfZrrrep0KDsyO12/+y1cDAQNyk/XQ=\r\n=aitF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"81e8ccd71efbac06ffad1ff05cc658e54d3c0a52","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.15"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.15_1648671392236_0.8230175725635236","host":"s3://npm-registry-packages"}},"2.46.16":{"name":"@apollosproject/data-connector-postgres","version":"2.46.16","_id":"@apollosproject/data-connector-postgres@2.46.16","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"65af0ab505a811646267ba4ceefe365aa8b7fdbe","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.16.tgz","fileCount":348,"integrity":"sha512-8cnMMo17IWrQYVL1HUts4CihuI61+VnJOJjFDFLRl6QnNSZxYtZh6XCGUG4RLPwNziy/Q29Tdqbu6dinVDlueQ==","signatures":[{"sig":"MEQCIBPa+C5NDIaMZZZCbU6ZmY7YkQQMJYUJKiq/KCcaq0e6AiBWzVMPfmIyzjWReAvfkyZxkBMnl/xefE6nbhv+BgK7CQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1100740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLtOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPXw//e0HWysuj8gSA6bmzpkPRyzFGN/P9xOTV3R9GZtNaS0u8xHBH\r\nVHonOh8N5XgCC5D2doEGUArLnkxzq7pmo49SwuekktcJUvENVAPuCy2Y4FGz\r\nscWYDHFagEvaE3Wofq+CPGbOV1pawjhLshQ7RBvdztYiSef51ydG7A2+0H5q\r\n1i3BWXPD/M11qCHA7eDFrtq45ZVZWr7SdVgrTlzfk+dWkJvwoopFyYgrunbk\r\npBL9ap/tdU+YEe4tu7U2wKkUNTxM4Dy8KX8btXmav3qt3uHONPXLKPkLh873\r\nOKF4URrbSwwosYQ7+ZfqucixnmBBIpgP1zTz9Av9WOwSCtS9+Gf39FHlLwJs\r\nNo4OQTPEy2e5mMF6gNo9mNm63cjJ7n9Znh6i91xpW9fpVWGqB4xGjs2+hdnl\r\nNdVI0modTzzDu4xw7Hj81EP42QGpnL0fP9tiJdp8b0/aKIsQkgg0E6spcPIZ\r\nPeEszoQ19FgLKZDGJM9uzbvo5ugbxui8lRei5d2Hd3uZRZ4pYRln3y2V4zBo\r\nlFg6HepqMXhhyQpakfHogLc2cGr0axrc+jxXPnck5h/4OGCVB1W2+ARxouye\r\ndOiPTVeFQKxWvkfUyb3SW3aeFez4GwvN1IUF8NwUaRxeQwd2nyxAQA5NmhMa\r\n/oSo/CqM0NTsgmi71xdtOaAVZ2H9VFycN80=\r\n=7dse\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"01ba076f1a3a4dbd8f845da31249ca0a11b6dd7d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.16"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.16_1648671566498_0.5182196665965872","host":"s3://npm-registry-packages"}},"2.46.17":{"name":"@apollosproject/data-connector-postgres","version":"2.46.17","_id":"@apollosproject/data-connector-postgres@2.46.17","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b718554975bcf0d90376802880e66684494b6969","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.17.tgz","fileCount":348,"integrity":"sha512-fJGdhfS8DNLgz70sv0H811TqkMzvxjmDnhzTQ4DZnHEBYQzo4d6uQPQQ/Y2BCEjHe0bcrbj256b/LJ2KpAuwtQ==","signatures":[{"sig":"MEUCIH/cJWS6Zu8DImk58FieWgKLoKtv41odpxVeCgBkpIzbAiEA/Q9TDHys9Y/YTPbFgTNeekCWekI52xAzFtWMam8frQU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1100929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLw0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7fBAAg8WQ8nr4bC7L5jxBaoOZ2blKIiPUPZqMaMyjMZysw5jRcB6I\r\nmy81li+alNkcFKqGwcUc9IwHDmtspmxKKlzrU5XkyKli72pc6qEPt38FUfKn\r\n4z1I34RHcLTSJ3c+8NA7f7gQn+NnoDHSrHXwNF8Dc2VCcc03KoqzTpNfUZKD\r\npB8atfEfa1c4tIambWQJDXi8Rjhs0dzmexBNzttE/ZnIbLNWOXCNG+EpfbFC\r\nH8/lEVXU3DU4A8Tf2B6ueHmqu6rHlAUeuq4weXmqIx+CxXD2FNg5KwMa5VHm\r\nTqu4mlJXlwweTh7go+In0AQZvjpApnUZFA1KVtPIkcyhfoIBh2sDlC2bDrTe\r\nlPbRgTrCJueFXM57z2V/mEF52tLxrvb8s1YCjDJW/M27GBEZGR1m2Kk7hNni\r\n910Wb/EAhiM27F/qnt2XTKHOeS4RGfSv/YzvucdwU9fgSLlXjI6DbS29vJNI\r\nA6LpMS0fWMGi6oSi1zTuv4Eqy/egJcyXVQiHZyYEIXoRfbTCa4Tj0erqZbDS\r\nYI3XvS18vqrelYGj169DAjJp0Bo48u0EfOG5H/Cxn71tSRpVKwASb9HiYvPW\r\nChcJHHVzFG23O9FzUT/eFEGFjSlSduGGq4tEqqhcxdvNzkABfnkrcx+AshYw\r\n6V+BKgFQtipz3K4SB3jGnYobTNz7aMGK9tU=\r\n=eueA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e1b5312728d9219120fc8db06184cd3c94b338dc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.17"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.17_1648671795853_0.9472445543598247","host":"s3://npm-registry-packages"}},"2.46.18":{"name":"@apollosproject/data-connector-postgres","version":"2.46.18","_id":"@apollosproject/data-connector-postgres@2.46.18","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"55ab3218e018782c4fe652c5c39b998851cf5546","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.18.tgz","fileCount":348,"integrity":"sha512-nFZVSce5XOdKH5SEZupZuedy6AvrrTe430srQhrtjnEVghNhE/LtSeFk83VDPJMRfelYQ1iN1EdkBOigDqWjHA==","signatures":[{"sig":"MEYCIQCrypsyqN070B7oaICUDcHtMEezqdmll4nXkL+qgfPcXgIhAPn6+QgBEnWu/e5CU0Ym++wRAudYbmZX9iU98vXFfRmB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1101118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRLzZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAEg//SEF8mqCF0GTOA0HFxCtyv8nsYmHBq6zd8SQg9y1+db9391mW\r\n7dDfxBLp42qwOkheEp5N9PJsgSXTaPfHW4pcLGchfE03R4YlBn9EBgTqWHLs\r\nX+egmNm5SvxzxL4YCbdrzcunRKYQAdO+Fb/1WYS2NR59ActlVGT33swu7jIg\r\nLJsNYy9FuA8HgJ9lyuhJcgw+Erj12NnS0UmmbCOUUgjJRihAj8Hkf//6nb0b\r\nsF8zgOsX/nnnQWNgCW5S+Uq56oOhkVD5muyDmFOKaaN07NlSlldfWqyqF4CQ\r\ncNPzx1SQgreWxphPB/auMEEO7FqgZdojtxpvV/rIIXoldSgtS3F/OfiGchGl\r\ngvq2cZcLe9Fs2jjL36B4e3VJ6esAvHtaBQikCGUxsPwoJ2dbr76P0ZvH99ub\r\nJPb1xkUga+FEmC7KaPOBGoyW68quvn79ZRg4wpl2MQdRzRHc/losE8t+XTSe\r\n2NVstJawM4kkYB9Ulo9OaU/I+yXhlQXuA2XXlsg1J1lb2NtAzHtdkgCcrX6s\r\nHkqCALQxEL5l5A6in2vmUio6rpxW3zBX7anoGGXr7+mzSXV7lPMumReQeXL6\r\n0BiNvP3QoPrkzyI+08rPyDFV+PiY0H2ppm02wrFAuImJU9W4ANTzDOlAMZNq\r\nmTq6ElEYWgfgV1pnI/r7aDL7A11TRVT2Jt4=\r\n=zabf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"33d4839ca5f9b235c3ed7a62a4b0d4705fedf82d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.18"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.18_1648671961165_0.25495360493293906","host":"s3://npm-registry-packages"}},"2.46.19":{"name":"@apollosproject/data-connector-postgres","version":"2.46.19","_id":"@apollosproject/data-connector-postgres@2.46.19","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b20b01f47db98074625211e463640ffb695fe885","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.19.tgz","fileCount":348,"integrity":"sha512-8RPKoLbVl1LXvMfmdPcUBhZgiI6/l+hdVmlqTElruwTYLwt05yWiHjhWpYIM6caOmkrz11NnMa+CNDvJ4TRkkw==","signatures":[{"sig":"MEQCIHoU8WiieIpnIKvwTXqTMbYFy9cNzYY8CdLPHPt6ZzDlAiBF5RHu62SY1r4AcmPUPX+2KtMYkzbErBpMlAK2x0FH8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1101307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRL2GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2XQ//W9ITtQRJcNHdNrjMBuW4446s6B4uCH6Z9Ur8j7WW6QwgfZyH\r\ndHJ1ON3u3qsnA9dqVwvgLfgaFHnwUQ7k9He7Ge7xNQfmnIjYxCjTBh04UQrV\r\nrmw7yHeihqC3FbBowtURyLTfRYO0UVDCiv1n+/VPHd3C7a4J8Q4ZYLhNiKkq\r\ni2qW4YzwDUukHu1D6m7IILcDIZSnmGjXaC3awjUeeobAcPtuaI+ygvIek9Rz\r\n5szzfhFVmUYqJNW4mG4HB7teduOd92YTm8lcIZ7b9qT7aVr5i+P2kw1Wa4eJ\r\nKb2YQSB+3nYvgrOucv9e9x/WLaHmLLY6qg6n5o2ZVaksj87r3LvAsk+mi8s9\r\n8AyeRaVLoCM1bhmLON9KPOP0vrRqjG+sHnEm9Ort/DRQRRsSQfjFv+IyW9gn\r\nRd6/PlRQpjzA2ZeJZynTalnCKrzNN5N92N9evr7k9FQWCswkbkjujDu4f/y1\r\n+Ccypbg/WFnk1IM3EbgLPiLlq6tYLfsuxOdsG0iKpiK7HDCNiYptD0oSYhK/\r\n58C3TOmfLOtjiE4xhl5Ui52rUP70ySZ7TjZXj2My/8MOhvt6/qTYw1QyY0wd\r\nNOT72bDcnrb4CkS5xMPAmfsPZ4Bo5IkrHNJKgSMCV+kQ7YPgwufxwzMuoKM7\r\nH74V+8EJEdNCzTVcH98+blxyufUSapr6YLE=\r\n=23W2\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6099a0d7109442204c22fb6c21ce58a34107e223","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.19"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.19_1648672133939_0.27161910956052604","host":"s3://npm-registry-packages"}},"2.46.20":{"name":"@apollosproject/data-connector-postgres","version":"2.46.20","_id":"@apollosproject/data-connector-postgres@2.46.20","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c7ce8ea43be69081311c8ec41806ad328b0c9eeb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.20.tgz","fileCount":348,"integrity":"sha512-EWyKvF2GB95XSYlICSsbfrhD/DKR3YsDkk+t8mk9C1q6kJz7QxKeVjX9KLa5WxIkOKkHk0/LgjsvN/O4Q4qv4w==","signatures":[{"sig":"MEUCIQDXptpl3gVYJKIS+js4gnnG6M0zg0/Imzh2vQV6X5T7cQIgWvHu4QQxRVvzkAyXuvTeUOrBbO9O7LnRs43EG96lfGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1101496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRL5WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrashAAgccz/5yI0xIa7wIPCfpL2W0+1i0PlFBwsyNW/J4q2fTfQdrf\r\nxQC9guUiPw2YOuSaWHo1JYCmDXRI5Lw4/5pAG1hUze0T13QhWAk9AnPHxx/C\r\nxnpCoHF0YXLSfrLp1FbmzsYjkVRrUalmm9cJ2UruYJb8j5sp3I2MrbnG6dfl\r\njj92mpGDgom8J3FZXhy7mHtwqcKlU6bPBXOnZyhQBAZibC5G5uVMyKSC0dS6\r\nW3jdyRI4d0vas5gDWqU8RlQJR3YEsgLco854bjUpgzlWBeWGc2VhxyO96LW0\r\nudmWOZwCvIOEQaZq10SAArudtYUlz7ak1+NZ9l/8VtP/YkQ7hfDBGHty2iM2\r\nhWoKofE058lTTfUvHkQb3ORxUoluU8WiTE6W6wNXpjFCHelMiXruAbsVn02C\r\nE7c7KjrqjFBwCbMZdVY24go/Ejx9QUzfZryS4PhWkCXqrI0XIKyw/3NWSlFj\r\nCaH39SH7tyQSgjwraMHgd7IHsfJXeD4jGS9befsk63wdl+k40G0aHj9/5yrQ\r\nYMuan0c68OWijPPKsaS2E4XXO/1Odbrf6KEIApTX1Yo+OAojhS1hyCLDNdgc\r\nncRGhxfgT2ZFoltYBuUUaqQjgU33C6+VTGGV0Auf/qZsuxuBV5axmX5+nadH\r\nXFMp4cR1N1ANTgI6TFq7VUbgBuvkxnl86ZE=\r\n=MIH5\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1b3801532001d82f81bcd9284f3bd45883a2c0ad","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.20"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.20_1648672342744_0.19457229498277462","host":"s3://npm-registry-packages"}},"2.46.21":{"name":"@apollosproject/data-connector-postgres","version":"2.46.21","_id":"@apollosproject/data-connector-postgres@2.46.21","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"257fa21a3603ae7ab8280329592894319a4a0b56","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.21.tgz","fileCount":348,"integrity":"sha512-VV+5z+F5qjzWs3gHWtUkwQS+1QnP3Xan8qvN/1qAgkleRMeL5gr8ZxMU0S34KyPkTgZwK4VYxjND0xIA5nkyXg==","signatures":[{"sig":"MEUCIQCj+xpmHyHT15gtRDjjBvnWYK0gE468DfiEHjKFkQLCvgIgA8UlHhUwRnhB7cPO95i7gg6xlpoqp/0shl2J7cuxj/k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1101685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRL9PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKbw//RsVEHdVV1CV9ZjkrmMxbz70nq4K4bJlWc3caUCRHL0zVCv6J\r\n1ULn0+iGSuW8jIhYhGAEX9S6Zr5F68/8olMcWV614VmZy2sbjOlXhePalfG+\r\npnKzlcr2r5cLCKs6dFeMi+0wqXmg9qQ8pxvNTa8WfKVV8JzjQznQ1I7quQXO\r\n5MD57zBDXgz9q8xS+A6sthDjDHBij21i7xnVCiajy+QjaQBqyKySkBrvWTcX\r\nUJ9+RDkfvBfjE9ZsIrVpk7m+ji+5ki38uB6hFsiHl7qCUWL6UXku64bELrb4\r\nde1iMLNBU6qJSARwRJgHA5lbiVjAz8wINchb3ysJmmR/3AlUX+6LXuV6vnlB\r\n2UpQnYrlG4ETS8wGgZE8jf1/dTvVn8Jh61h1NTsKGdA13Rks/xeVKyVznAq8\r\nmMpOxV5LOVNj0V5of733NXj1LNQhPKU68o9bRrDXoNPKTf700J5miihHxvKD\r\ng2PYmqFNJS9L5hx+RV2MyToSUncrWkQQ7YqKyZFUlhK/4qPj8O7sC1G11EJd\r\nnNXZaA6ztPoJGYmeCpoc+rx6cKI1HvDv7eqwE8H4/IuNme/kACSGSUYiAEW4\r\nCno5v61DgWmU53oeb0tgL207LyFY6KoO0HZgzH7LoHsdHqvZcsaGjouz4GFA\r\nAUh0Jl6X5mJxQNOXQ48/L2mBN4c51iYfxxM=\r\n=fByi\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ef31e18fd365cd07afca135b79aa2d2d7c36910b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.21"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.21_1648672591288_0.8671174188621924","host":"s3://npm-registry-packages"}},"2.46.22":{"name":"@apollosproject/data-connector-postgres","version":"2.46.22","_id":"@apollosproject/data-connector-postgres@2.46.22","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2e31bd3b314c0fcaeeeac41a035fa9c1cdb47b6e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.22.tgz","fileCount":348,"integrity":"sha512-SbqDmVwXRt2vwGQ1QkWJ8O8PvEaKvgpGyZbACpzuVL2r5IRDLIPCu4XNLN5+nn2z1PH7qi6+X8eqMoIQ272CFw==","signatures":[{"sig":"MEYCIQDJ26qQ0yzfiliuV2fMRfmh9KuZPeMGXpsEk3iDf9LwiAIhAM1ARpQhRLpbm8O7vgxIvSR4f3yL29FnKAbT2ahR8/zx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1101874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRL/6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrj/A//bVgYk5ynX03xdVbIDHgzbLzYRIG71BU2TOeTYw7GzOw+WbSs\r\nQnpSzu4z+sy3Sgsmh5uZ39RVMSc4mP8lEpo1XyAIwaHC2c4CtSKDQvccVW/W\r\nAshI3yDOdJ1q/KkIbT6HwmQyAY+0Ilh8DqLBV8m0x+RBWH66QZjjuE2SkClw\r\nwN5fif7V2KyaF/QS9uzvtGN7BGkfcLA6lw6+sV9ud4dihfLyd18WMnKf7UEH\r\nBR5BM0FZp4wy+6l1Sw4XToQmV/55JfDrQ75DAESKwbmKIAL4wHFAXLyJ2OPh\r\nsi0QFR3JgljoNaUOfaswyK3TBuhZo2taL/wCPrc+abDD7M+O9Jr62sYoOQX1\r\nUJb0HFVcuU0BffSV+IAJ2eKMcFfOslfNVdy7Tb1D69CjaCuiJkVWxdnFbJ1e\r\nof/dZMk1M03xAKDbu1r4dXoNvk+uT6fabv6/Zz08/L6eFKH4qbMqGh2f7cBN\r\nhtNzOqwkj2UeQPdUjGI6+gu+EMV9ske3D7buVEyJrE2ZM9j+WXPyO7XioZJl\r\nOImDENQpHroH7t34txGpUXBVNhcxjNToyLCSGjPKddlhtW8GD3XeyXi/Sg3Z\r\nSasW8QBedRz21kvhmzoGEDOLU4n/gP4Kc17v4VVdiXwdBuBWoC84XgRITzPo\r\nrNoTdJeRzmY9Gr2LRV6yK3AUHDrBvMSsS3o=\r\n=XPBI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"28f340d4aece9e5c5d1931c477248fe9b4989c68","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.22"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.22_1648672762522_0.6545532864268897","host":"s3://npm-registry-packages"}},"2.46.23":{"name":"@apollosproject/data-connector-postgres","version":"2.46.23","_id":"@apollosproject/data-connector-postgres@2.46.23","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6403b23a5039bed62726543752bde6e7e79a58a3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.23.tgz","fileCount":348,"integrity":"sha512-jYCag86uB1q1aAXg2WtJG7/qc3ZqRwcnfSw2z5piNVHsCKIqrPjjOzA9dJ/3ch2sf9IxV1NSVFNQ2hsrMfT1/Q==","signatures":[{"sig":"MEUCIFzBU6MC1QVUY9uykyMf62EApZu3FwrUB6zJmb2KLkmQAiEAsgO1GR4d2Ua5dac/jR8Isyw9QZ5o1BuXPCNvAiV1RgY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1102063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMDWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSeA/8DVJUpZiw5FfjyFpgfFeAOAbN+3jtI3CdWHhWFz23nlzWcl8n\r\n1JxPzTZ9axW5WqYXnEA/qWOyhf8SXb88U70qitgAehCfPXlAxxJ6ypTLkRy7\r\nF6PTfj9qunHGCLcbM7p5o9VvDOxBcA2mwLu4jR6PPHpZj0xpY5ch85P47+Hp\r\nDG9NCV5/TH6sL3A6UTPCaWhfseGsF1KllNw+WLAq0n/xitip9atBJeY+gkJi\r\nkIc/BV3NCNG9ZhADtskatyLuh9THdt4+5lEZfrNOFzU5wQvgxjoVeUaH+7RY\r\nTrj4jLCQGTkhXBAu4WX56Xr04RuWfXGdDzD7MTph77zAA+DOn2NXUMKmMelx\r\nIzy0Qdc8JjxaC/j23GyCoGVjPiYOGDCJ+v2sJCysoCm/av6I1JqPCrGFDwUY\r\nK/WrytUoJ2eGDY9/dALNGjFVtdHV2N7+kMW7mwzPlg+fIUNEsfRWXHkk8N4B\r\nIXGkSAlWn8TbLA2wNsOQoXW5GbveZDVGs4BurGOItDwryMaaquMWzU8hQqnr\r\nPBwaez3nI04+e4GaNe8CE3NIT8y/V7jgjjm+vpFLKOQ5tdfGOOi5wGs46pEt\r\nq+JEv9oSVnIRL+894XfLa4mXQgnc/SHq8/2ieOPpnmnDg4SL4ipX6yQ0EHP/\r\n8KZOJKMVA/497A+4YRM2GUGqjgBK9fFQMMU=\r\n=1D4t\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"815df524cba010a1b45917d1cdf98793361267aa","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.23"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.23_1648672982711_0.13654392246937208","host":"s3://npm-registry-packages"}},"2.46.24":{"name":"@apollosproject/data-connector-postgres","version":"2.46.24","_id":"@apollosproject/data-connector-postgres@2.46.24","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4cb089c6f5dfe5a0d041a53d6c897f4f8effd99b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.24.tgz","fileCount":348,"integrity":"sha512-JJmGlj8iP8woro0fO4WrvDDZABolcYR/w4WL6D8wY7Avr3Hbgq2XH9rjEa2OwPs5JEe+NbjqvrgGahF3J1VthA==","signatures":[{"sig":"MEUCIB8XXzZnIq0xi2c/Q0jeLO8wkdxu3tuZDETtsg2Efcp0AiEAvnkOX/PmWbPKwdmUB+S4wok3LGGMveyM+XVOzoiwlxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1102252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMF2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx1g//Wk+h4WwtRYDpRNcIWE1/Hgs2lmAOA98nnVtKZaVgfyCVR+yI\r\n1onEK6WEq2yH5SLLHIq0a4cF3vCLQMuTzj4LwBNBEKtnsPVM50USa6UvHJK1\r\nKqV4nUBaJ0ItBY4FvwUB4facn4+7xQy8l+dn+iJzbv06m22YjIixpoRLcQ/C\r\nnc/qmgEbWruKJ0aDwmzL68ElMYzTGCUcmMeXelLhgv8M8/JukWEe9EsHAIAw\r\n2rMea47WiaC2zQMzLDgAFNN+yBu/hP2AN0xKKCPc0HpoAPWWXT6hwpnJvwzx\r\njz++VTkfT5+J3VyGFnnnYX0VMzG9PVNFiwhukU7V5FS2G3IOHyF9AIWmS/RX\r\nyKaqt84pnstK0LBtB0MS2bRo6o7BHxKnU+tktkj7p/elbLmTsE52ogSD+sFs\r\nHPCoSPy55WeBF6wVx/3vd+IfjKD/IVPnFuIMqFoORnnZvY60FhZ5wPoECDjN\r\ns9fnbyggfZqRy4SP7Md9D/wf3FFtj9SEadS2sHZ2b3NgnXFB4Qoommui8lXs\r\ngWGV8fpWaSRn5z3DIyaI2hJEnQY0B2QgNFroZgpxR1g+Vm/Mfd9tqHhjqlpJ\r\n9fDWCit4HXEqwB+icn3xWYLZa9jA6iW4dogIwgu/LYAcHdD3em2xH7SDbBg7\r\nBc5j6RYMamcZcMc+3FyfWaMCCYk4SbSSQaA=\r\n=2/00\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"18407b6418215d2cd9ee12a2101a58aacdf441cb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.24"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.24_1648673142537_0.8954129970266798","host":"s3://npm-registry-packages"}},"2.46.25":{"name":"@apollosproject/data-connector-postgres","version":"2.46.25","_id":"@apollosproject/data-connector-postgres@2.46.25","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"123f1eeaaba127771c7060037b27ba5c41ab0404","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.25.tgz","fileCount":348,"integrity":"sha512-dDdKH5cqZgXhQsNNWP5YipGzbZH0iE459aUtNmDqbA6bhUbygAkdiSF4WonQrLi4eAi31RpianxCohk9KMcj/Q==","signatures":[{"sig":"MEQCIACRTVc3yRdH6e6s2uTMMhrpIFYyBjmYNup+aYI334MOAiA4iLyDc6sFwHcQ5Ymuc5cgTQdzRF3nKaRYa3KYjK/Dig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1102441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMIwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqP/w/+O+JtNGSyYI0x07pMq9hMyuhIDn7xuvcGa8Cv3TFU6a0xWa5n\r\nOHpKeSEto+PsYudMszDmKe5N7yuLb4bKoBX1vodXIGFGgtoCMg7FPABEx1aW\r\nKmeS84fk/k0A8zHPF+gIrr/gRDHpf9ofxFbuU04vBUmxUFw5f2aCY+pyJNdS\r\nto1/jy962TCZ8I5oMtg/c4C83sKQ04Fmw+6cyXzzjxTWlX7a36QjUmsTkTIN\r\nUnW7eXqVsbUqdHHyYuGdC5Bf3lSnWZLYGngSFMdOAcAEaoFyYzTOL5VmESL9\r\n1M3ZOA9/SdWaNRgjYAb2O2HL4Bokt0ErcWGWyq7pU639f1PeyhVycPztMflY\r\nt7NWRLpUoUnjMrUmf5hdDAfvpDGffiB8rsfbwp9cZnAGXUkapFUw5QJ0vn+6\r\nOjIDaazV1KhJ49twtYbTCchysXRLd1+UpRhLeCHxzKZRnYbsnz1cq2VYNN3b\r\npXZ5aD+mclqlPIY8qDhEzKmEJhkjggUdwvWpFiYvj5N58D1ArioBuPs//3fw\r\njIUAp+ggui94p5Rp15Wo+Cnx+FsfH+7VGaWet6N5asfctJ+z15bKKFBcrFt2\r\nYWicEJr544drwl82eYBPliqFaZmu7fXns6oN8DoKqLod/IYm3L/0XdS/Zirp\r\n+aP4lN0T89XA6zmyLifbhZpRK4UuyKxEmsI=\r\n=270x\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a89fa6e3fd3ba4a959a33f8733d9cc917654dfe5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.25"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.25_1648673328694_0.9087158199362715","host":"s3://npm-registry-packages"}},"2.46.26":{"name":"@apollosproject/data-connector-postgres","version":"2.46.26","_id":"@apollosproject/data-connector-postgres@2.46.26","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f90cd2bb4b5372cdb2b6c1caef5e1d441e78b683","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.26.tgz","fileCount":348,"integrity":"sha512-jGrotvjDsofkGmFdvSV2n0KntnBdxi9z7+HxfMoQ966bjUWdRQD5Y0bS92bfDjkO2bNhrravQz7VLpBFKHVFew==","signatures":[{"sig":"MEYCIQDf4Wwf35wtqB6nl4vYIqHyJKTcbwificGpgXMH/5GPtAIhAN3kbhGkoL7Ki6QSc4rFCjLeKlU2snlhsz3tsUJLpylq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1102630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRML1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqyNw//TNpeSsFyu8ksi+NgxiMzv3q8ifjeN7x86fzyLUZq1aloLb+H\r\nLzHf8HOto8BYP7gP8Lg0qOegy19Va70AHi/jDZFoABvQfFdCjsMsny7FIwjb\r\n/5XxzX9no184oFgoWZzfXrsiQMMvBFIqJXeKzIm4tAN4G4IHyvn/qVbSUt63\r\npSAEdE72q1+XFgb63Zx3bEo7pn2aoaAckd7dps0IrAl01U/o0WRKJ0LNIy1J\r\n578RNT90X4nw++auwsYfCdgawaX8Hr+fm50bUTDLQLA9ds/3mapw4U0rn3mv\r\nEbDkdufZo7eaQg3YQGwKdFvQclOGoCF93bYA5m3YW/pAzF7WtoKfw2cUg353\r\nmo5jcMYg5wMyAG9qn8lMFtNQlZVTWOT5NJVS5Yv/fv3gizsdBX9/Lz4ORgIQ\r\nPqj/J+2PAdOcnO/YW4x+MHYpHPGlVISxb4QWYv60s2A3t46thAP+Y4BXuQ7K\r\n83ZLZkwuGrqR5KiUoxrZLKP1T3Ak0WSXMoa+41z/yRorTMC9JvL4U60QV2qi\r\ne3hmKtJ0eRIXXbzABGLAf4bnVF1j+pcK9P0oIRUOt5HSYPPT39JNf8QcBg8M\r\nH5XNXplgtVPZDIDW2WH/x79DT6VctElKFfBafp9HVWFZicxrSKFT13w2/9Tz\r\nVpUsQHSVvgwtBtesWhfd2T4Ck3e1lgiDeaE=\r\n=4ySG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"12bf685484c50d48f34459f103546693ffb0e727","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.26"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.26_1648673524807_0.762380851212678","host":"s3://npm-registry-packages"}},"2.46.27":{"name":"@apollosproject/data-connector-postgres","version":"2.46.27","_id":"@apollosproject/data-connector-postgres@2.46.27","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"47bd7de3b6a528877d77f8454bb739f68cae78c7","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.27.tgz","fileCount":348,"integrity":"sha512-W4gNmzoOtwD/3roRGaxGrUF0f8W61OAShrZ8LiRYiQxJPfH2LVv33vZ1Nvz/0URrSNdcltoAmd6yZ/cC5Pue/g==","signatures":[{"sig":"MEQCIGoOVkFjphmHJ65yIzBiDkFSiwPikNgTrnLPanmjwxhcAiB7q84ann9EwEmjuFHT1dhvVICc9nSIToUVGzzCpBg/pQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1102819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMOfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYAQ//cYmUNF+TopDB5tgVCc1HP1sIwSCwtFXlx5ZLAKRGOPOGvbV7\r\nxheRjxZ6fEDjUtA1lQgknQYKqOLMO6D48a/XAhLuTVaEdJWQC6izCQOLUYnd\r\nO2NK09esMA9qBBVoXg3U0fGqIBKXQGkFq253wy+W65qSi6zf++v6Zc/T0XIS\r\n8q0G/5ln4ODw+SPn+5yXOodBcaFK3pAu2u7mq8swZ60Qjsa8JkycwqSdcDuH\r\nGf7NRHhMPOFw0WMQReQNZ9KvssssG1ZxCaomyfau7WMJWxQVgeF3QCcXQlkC\r\nJokBiYipTrNPbkg5hfcKVc4V0m5jWauXljiblQi6TU0560PKmmtzSScC31a1\r\nV7LyufB/DGsh21z0yc2YIFnW83GoX+H7fXZ/O4+wAtph3nP30amh/SZWbNOa\r\nuijWmiC+/+lzxxawh8pjjxlZ0WgIamVc7L/GqoOjcOTb1cypeKLpnyM3qlIs\r\nDXYh0ybcDHPpwN0poIw76qMbe2hllochn8wQLcfxN1DYNV/tXV1bXsSM23ou\r\nAwljFEUu1X8OeQlfzVfGsGr6aQerYNma8+N9Ts5J2DmWFV+SdjefMjNkYGwX\r\nSrZ3EZ+Livw97vHFV13iY05RCZShFx1zDhpzjKPoXWCL2Y08vL/bIOAW+qUL\r\nCOE6pCpvzhNJDIQhg9U3pUMauP6qvpAJoag=\r\n=CBzQ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"677abc77d680411d8c485c50f0ece97d2d032d80","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.27"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.27_1648673695346_0.7432128290256965","host":"s3://npm-registry-packages"}},"2.46.28":{"name":"@apollosproject/data-connector-postgres","version":"2.46.28","_id":"@apollosproject/data-connector-postgres@2.46.28","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0626a7676e1445753539980b592efc69fdf01b20","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.28.tgz","fileCount":348,"integrity":"sha512-5lcLb1mecxK1crUmKARxJ3FGvy6S8eau6X0DefFAn/QRaSkvcykxx+LYrrYR74VrAtL4BcZThvB4W7lUGcB/8g==","signatures":[{"sig":"MEUCIQDMpsA5//N0ewXKm04E767Sl18ORLgsivectsn8zOKE7gIgfyF9WKb+BVc6fw9y2ZM8S+pTB9o3hcpokvrTwSMm4JY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1103008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMSKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqeew/+JQWFIYfiB4CkJF5LT7CHgefu/CHbZLqJqv/boPjqAWBEHoi8\r\nYXTo6mi8/nBIvEB1gbsYQBQmumM5zj5CYac1sx6Aj7IB1sFKivWpr9cH60gO\r\n8DriNRxuGJ8YwBDqvU4PDmwWYvPgfnSkWzFbZFTmCoK7mjtPWMQQFCcfZGhm\r\nT5yM1OKNJngWiHVNceSpT26AZ0J1YFH4jMSrNO4NoxjTw1Qu8D945mkPnPlc\r\nwWXH78n/OBwaHM76wT8F2YeUToHXBkXMQ2lRSIkNLR6SyV4QKUyasQzpiGIA\r\np+8gdUKJOibimdHdif84cgBM9GBcZkZJduD1sUW1OqG+zzCSGmGb1z6Rr3+p\r\n9ZHdatcgF0pemzzGicaAZCSPjD7K2n+R/vcUUvO6zQfsG5PSwz4kYZKu/0Cz\r\nMzZW3woFGphmpS6F+SDokaZkoipsqhqqYFsAsd1zjj0+yw+koBO7f08lykVd\r\nVgiDsutJ4phDYOt/1TUgr3/DoNW0+SgY2iIEpbfXujUpQv9Reb21VNMffofZ\r\nfsTu3eQhT6blE6LT6ZdM12Afy41Apnv0J7tY54R7NowNYpZZLtdo/rlEcu4+\r\njsCI/WLztfsH8rVQbY7Gao+TJ7P3jLE8S8w+CUhVF3cvAjfAcoq8P0R2E8YL\r\n5LCT0/pKN11XbNYdMqu0K0vzqq2YskKNr8U=\r\n=GWlo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"5498b1c65bf9e78b54c04faf326fd513a0071417","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.28"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.28_1648673930778_0.5578092343811711","host":"s3://npm-registry-packages"}},"2.46.29":{"name":"@apollosproject/data-connector-postgres","version":"2.46.29","_id":"@apollosproject/data-connector-postgres@2.46.29","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a09c8682180b098a6f3e1fa5f10432d083268b6c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.29.tgz","fileCount":348,"integrity":"sha512-BVucVAtINopl8DdAh6W2OwBL7xbYrojscm6FrjEMclgAKJ+Xmnwefj4hDzGblWO+LzTFXp9AS1VP/hwbTu7n1Q==","signatures":[{"sig":"MEQCIHQmPl1yN/2ljoc7z0dw4zQCTRrMXlMVltTv4mXz7XugAiAhqhXxI/d/1MKbbW3s3PAH7LMfzf2jMHVOhRrgoh3q8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1103197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMUqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmps1Q/7BFZwmDOX7/Uymw7QvsvCDil+rMqJfLgktqv43BQzrB9iR59o\r\nGDfCrCYDS8BG8DHjxq3oHozC3h8In4g2cnqhjX4coFZhp6rtpE00RT4ifEl9\r\nRVN0rAeCCIGgnAGSggk2bLGCnCye1F8DQcsaL7mJPOIcrIsJFyC1oeq1dlJi\r\nirC426bNoin2NYmJxsbqq1/R46ReEWDeb/RsaBDeIEcXIRqsSPux9cHJf+W9\r\nFU763M+5idXVxlFs0FYSls0q6lvPrU9y2ZvJn+V1klR5kNb82Z6NzWnYt7Hp\r\njxAryhNdBbxwORLrmZcbTHerkYJJ9Py322qsiL7LgT4qvLYKL6x6wQcb3xUy\r\nRP7Civ5JH/8RBGdu6WIgJGsbeufJ0KYDeMZuVWd2vKjP5VYKMxajJUcetzn8\r\nAhE4/zxFhxNU1Lqj/XyrarV02jFsxdYWiFmNeW036J4ZGfL8sOdB98sejLX1\r\nPq/b3vfEtAHXnfyvzj0I5SXsl/CEl/8NwLvahfDgZWm0oKmr9WISgQPaPcE8\r\nMnfUSC2mMUGcOYsfV2FxqpLb6rX3Uk+fqYZLs7zx4V97Inijq5mmV8yeK+v+\r\nPzDYk/amtfaHXZfc711lKnej1hq6UvKk0cKWs1SSHyLbTj7lJCy5g3INUc8g\r\n8vA+0QZFNr9wzaN61tnfKT0X9Uzk6QpzRFU=\r\n=uHIG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"67f3603a7027e50135bdc89bde4336edfee7c487","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.29"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.29_1648674090356_0.4146789516341507","host":"s3://npm-registry-packages"}},"2.46.30":{"name":"@apollosproject/data-connector-postgres","version":"2.46.30","_id":"@apollosproject/data-connector-postgres@2.46.30","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cebd5ef76b4e4af3a4021b7dfa360870cf786733","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.30.tgz","fileCount":348,"integrity":"sha512-4+CrKmz5Absj2hUUSP3CNaAxpgbVWND/+AKoDOb0w3+R+NCDRl5P+A5+khjNLl/cozIeJLfJspoESpiuEBO3zg==","signatures":[{"sig":"MEUCIQC1gEzRkuB3oR4pJXbRZxIvltqsj/T+WHgfzycAlUoEowIgagUaH1zi/u/02ZWBETTSb+9SvlwUQSgnGptlDz1MjFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1103386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMX7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0Qw//Y0mIPGT8IY5CGoiE84nXIACQIxLPGR5Qj1RHEfr27nMpAWhm\r\nR8Hf6Hht6R6T3WrDJ8Bg/TIuwICduflWr2/FbiHu3u8DKDVsvqNU5QAKNaoj\r\nYZ7mmh+Eb7FCCnbj9fTceoO1rij3YVsArS0frflui66bfvDgZm0NfTA4BU1F\r\nTitUYCYaayn359Sc9BsnVs8BIuc+5aODYMr+P1MomX6Ja73FhgvUlmgkgEa+\r\nTDmOOpCcSKz4XJUvvNlR12pwsy+D89VLP2U+UDHJ+Ejwvu/SlPKXdfpCkCs9\r\nXlhjy/VBuzZAkNTPVZb/tOuqN1kQZZdiAFym3Ywav4cBbY0fjvi6L6KPdZW2\r\nThbCEEVHNZ6y8NlJRtPWRpxONlg5SEJ0BdhFbHepmZBjX6vYjqeCCeGq+ngE\r\nin1Wt6xOy5z9TWJ+kXWb1c3s2S3b9b2DSALEUgvdiQAgAzUr2IV1vkSO49f6\r\noexTt2W0o4fZyq531TfKLG1hLeT03uxa0B1rOjVRFqiDVmc2o/+OQXDf+HjH\r\ntrBFqvX6cLASb4ldVk1o6JHSlG1+vmqSAXHaZ/xErcODJgMvO9d1D+vsH0+B\r\nKT747BSA2bDMEZXRdqIArVyq68qltgN7U0nxMcOgZEEo79Hb/bZnG9So6SCP\r\ndFncgZfx+xEpDHaW6VWBGOqYI7x8vuYjyV8=\r\n=Ww3F\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"76a416503a2a9e4d1be745c82a2c0c93cb6331a4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.30"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.30_1648674298853_0.29973796910167505","host":"s3://npm-registry-packages"}},"2.46.31":{"name":"@apollosproject/data-connector-postgres","version":"2.46.31","_id":"@apollosproject/data-connector-postgres@2.46.31","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9e275280966fa018553ef92e3da770fce8b68741","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.31.tgz","fileCount":348,"integrity":"sha512-f4UcOsLNVdKht5fQYXGFShycefzSrchVZdwOgP3sMwnzEZQtoUOfqyi1pNgLnSAeVeXNVaFjLMdIgJp3lunFNQ==","signatures":[{"sig":"MEQCICrGln9HPIZtZkmHknOVThVbpM9vhu0myit6Pf5T7mLTAiA3jmlWwnZZPAkMgDCmx9HwBQfj4u7eCujAzoi3eVlESA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1103575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMa/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqW0BAAieDVqBmjhL4lneEFLFPntCpUPsa3bPGPVxMRsqaoeRxgfJ4j\r\ncXl32rRWPt1f3ziXiaTk+srsb4KglXwJYBIkvUTJGasg3XtKul0s4MXwSd+T\r\njPed+vE2rrXJZV0R6L4VAOD3HCt+0HmiBEuFaIcjnLBXQa3CKcsSQkmTP9QI\r\npSjhrsK/ChVOlfkee5/+nkdyYQM2Fy4hnVvkT3l5Wd2uGsEuW62K8Oft6HwZ\r\nkyGHMmDyHPgE0mCtv2AvCYLcT/Rh+VaB16nfk4aXGkKXCvwE9Rdo5rIchJl9\r\nzxSGYjMmg4xKm63P2shMfz5CO2DmsnrH6TIv4bLr1JEqvB9JWY64T6kVdyoX\r\nN885w05VB/HwCm0qIcf3AFVkSnERqzAab3jb3quT0Ru3umm3RrE62LwCX5pi\r\nJiM8qSkGsgSy/n0/3IowmCZlxXrERryPBCIm9VoOKZ+d9Pw459NXEN0ZL/U6\r\np1B2OlNoA55VwirWObTSiVtyJVEyASqny8xMgnxYcqrMM9fhyITXCeDAVne+\r\nNaOLM9tLXCZ9eJhmgkxZaRjRk3mG/MIcdwgAWkvVDLFmTTCWKM2A3zwFX8+U\r\n+hW5NP2qhXPr8NU9wDq1CztGYcQZ+Fyqnt/qnu57zx+gQqcu6omlgT0mn3ws\r\nP7t0dzlaILKYwKXUspl2S38OGFOZsQxq3Qs=\r\n=6bVp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2727038d90b0ccf5129ad2fa8d6b3cfaa57618c0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.31"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.31_1648674494795_0.7395910279054518","host":"s3://npm-registry-packages"}},"2.46.32":{"name":"@apollosproject/data-connector-postgres","version":"2.46.32","_id":"@apollosproject/data-connector-postgres@2.46.32","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0a080ef6567bcb4647730646ed4de5505e111d24","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.32.tgz","fileCount":348,"integrity":"sha512-40rAymYkKJrmf7xwM5BiIea70W8+GiyPDIZHRreUzEGuHRBUYofhJYLd7aq85JZFaXBoilVSvCfCX4jMvx3xIw==","signatures":[{"sig":"MEQCIF+V+pkQAPNqJAF8gGdp3HHjIuXOAzqfO8FPZYklCGFyAiAUWtoJU0RNIQK9XKY1gPLXwy2EBhjLNlcc3GgoOWyvBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1103764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMdeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmorlg/7B0B4fQ0K1MiKb7fs7KAPr1MwZWLsvkYJJxGlFJeK4bfcnsw+\r\nrLMzMR6JnCuXoqTgXUBxSaDL3XgqlS6WIM+X7aJ3L5l0M377fV9SifP2o+mx\r\nJzK290CLNXukadHeZmWnrzMIEvvHdZsIqE7KXBMdrTJv8fJlSDOo/6QQZ/AZ\r\nw+4bkSHr5mYLo8OVsBY3jppodHch7vxj8OK0Cz6U/yDImR1fhEeqgVO3K5Bb\r\nTLaoy/+qZgsJkDImgDtdRnwvgM7JaipeWFZ+ayu4GylknfsCRp0O82L2T7Aq\r\nprm2LBrD8rDEfTxQhTgLqqm3nbT3vd7eTcBNTZZ2Gq3GraGmxv5hDq+Y0lE4\r\n9Ww44bEW/Wxs4koMNw9jum9KnDsL5uIYrz3tv5efcHFTljBFsWOzxY0b7qjg\r\n27N7AtEfcCDJPUkZpXWkhL4MOUXEpkKFY+uaowWTlY+avVz85FWnOn3YqjEU\r\nK0/WUWcGlqFjmsomxe+CJMs5/zp7JeJkNJRU8/llQuCjWAhRp9PqOBR8o7TZ\r\nWyfnzvJr1ZxU7dE06DjAIbEDBuEBxJidr1Zclfnlp3uOWETvlbt3ytGn39xB\r\neh9JUPwNoyYdPpIPMt/IKPWIK1gwXmVhvfp+vm9ZIIw41PIpwCrRnoSKZznv\r\nJ97OIhiEEqZcntkNw962zVDgrfdO2TKF4pk=\r\n=j2pg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"79c3310a8c864af0a4a6e6f313453cc3b46e2ad2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.32"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.32_1648674654524_0.4267572534208046","host":"s3://npm-registry-packages"}},"2.46.33":{"name":"@apollosproject/data-connector-postgres","version":"2.46.33","_id":"@apollosproject/data-connector-postgres@2.46.33","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d0ac6e4646b7f119b94972e0d0cde700ad4af4c2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.33.tgz","fileCount":348,"integrity":"sha512-WameOxPPjtD/JblOg/54tV7irpeFAzul/G5j/Knb/0nSE7WzJYKtqoyOsabIbt9J1LQl7K4W6L9hiKCNtyu35w==","signatures":[{"sig":"MEUCIQDbJ3nHJEz/uC10/IcTwh7YwRfBgh11MKRQ1sgllyhP/QIga8zGtieJoXDY/miRK0Zx4wPfe5JecdIDBVEyrnLf6vs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1103953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMgZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo86A/7BjaaBVvmNNSxYB6jJ5peDVKROHP/UHReJn3Ux+DZB2xXQFa9\r\ndUSm2BuKMddYwpZSOvRBx/Zydi7tBC32bzT03P8speld+qvsngq1GtcTq2bW\r\nYCpayHNk0Dh4dv+DPTvXnCF68s9iq9wgwMIHjl1luymxcS/klwRUWd8w66yB\r\nfFN8VZVsZOecB6OiYxUcBG/3a16Gt6HzZ4nMSohzk8aPqqWSGfTSmvjMrdid\r\nuDd8r1WiHuEDwa+JzCAlfV91qd3qUAExHOnNbYWwGkjYN/RjQRMdT4u2nRZJ\r\ntW3mAlX/jPymff/v5Yo0VGKVY9gCkNAH0kZt0UiJoP9n4KKf+fqzwkfy3s3d\r\nYWSJqNDE7sV5DyCKi97gWb5NR1fB3YYB9sNORAIlwNsjtoD89ZTT7wTvwhfK\r\nUc68X1A8oUeZkurYrovn0oDQ8YqXP3+w9pZ4Hy+h7R2PPoeZLD8LNa2REgeL\r\nyiHFyPnyXgYGfhiG3rvsKnUVkA3BxiNzCj/vEgYsNBJ+RQOJRwA8vQoBAYr8\r\nzSTPrgYSGKa7+jOSuK7ZyD3wdmReqNPNnFClLMRtjby6BZMosBtw9032L/ql\r\nmnsfsHiMVYhucvwN96ZHor6CGYzxHv4SzcH2NQ03iOyux8+aLHs7VAW1dfej\r\nkCSgaqn0yYr0HykNIvT7/ulhXWV/8j6c9U0=\r\n=e7vj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"08351d253896511ef1565ea112a90a58eea7b46f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.33"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.33_1648674841198_0.8230769255524073","host":"s3://npm-registry-packages"}},"2.46.34":{"name":"@apollosproject/data-connector-postgres","version":"2.46.34","_id":"@apollosproject/data-connector-postgres@2.46.34","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8e1c126fa9f81a0101c14a3afd37e21377e6a456","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.34.tgz","fileCount":348,"integrity":"sha512-XMpvDVIHcWUe5iK2rM80HsbisF7yVEzwaYOCUsJNIdle0tMIZCNMoP/n2ddgXkvcyC6eR37gbi2SqPknCkacJA==","signatures":[{"sig":"MEYCIQDjsFolvKIjuPl0+WSlPpNBqcQOWsRtl9+5o3WXr92v5QIhANI/aOLiFQ05H929Cm6Xq1v9TBvaK54QRwOPb0w6SUOF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1104142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMj1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquCg//U/GQJCi4JVE3yBrhvftXwrriDqvthExCG/Rnn3R95mO5miV3\r\nSTRvY8Yz7s7msa5Do6atMCPLSfjtvqk4AAmxJQdb/0F4wxBfC7emq5QiQpVm\r\nUzyV929k5ZvNej6z70+iD4XmV7/3vksTR8ZhQpJK/Zln2wPY/ysF8BwS8Kf4\r\nDrVSD+B6nvj4pNrou7w/m9yoLQyVi52xmM505eIKiT7YpsKkDUkd1vlA+szO\r\nh+6sxNEpqt7uXiGQmLidc77y6oBqxIeh+yNRTLJKForMGTWzpKg0fB22Iq1m\r\nJEIZnZ+UNSLi7+meZ84uX90va5skJsoyAo0movLsFRtL6fNigcDZowtgpaOG\r\noLzKOobAxLTv9nLlFKS2Zkm2gAa3jXaOfpZUrSZCD88+kyExnpq2itVWVB6G\r\n5L38cZcKa470iI8VCPlOa/m4PcT6hu7gqRyJu7F8S8Z0O75LYQK4UCfHeXme\r\nGQalAa7y4c97jCxwoHRoYV/Gt59AndpbgCYhVJKCfgTR2oF9HyxTj2tA4Pcn\r\n6W2ZW3HA3EPoNzZOOPuQ7/ilupPU442wcUIhq4R6n8YGjZyj13ai9/LcsEkA\r\nAy9NnQZzhvq0G4L1zMQR5IGghnWrQB+gcpuxEQvzkfo9fzbSB0tv5H+1cifO\r\n9s61DBa4wIVVF2ouS5AUqGlg4+gYCuUCuIo=\r\n=RteK\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1009eea3b7cbeb492d8f4f336e55785e0562f151","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.34"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.34_1648675061503_0.8794151340229497","host":"s3://npm-registry-packages"}},"2.46.35":{"name":"@apollosproject/data-connector-postgres","version":"2.46.35","_id":"@apollosproject/data-connector-postgres@2.46.35","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"02064da6fc84d31237871d1873f1179783bd92ae","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.35.tgz","fileCount":348,"integrity":"sha512-JUWBv49SxHWTUrcBuMLmTGzxVmyarsSHVXfNylGIMt+0VFCrgsfHtquKT1mE1mVXXIO9tD3OtWv7nqC5Zr1Ngw==","signatures":[{"sig":"MEQCIBjjVsZ4gwVvygkRoUeY68iEtaHfcPkiJwIxmJ0Vg0TSAiBLw/yez1rv+wF7VUOchAg46wfOUpUQrerL8kbqJlVJNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1104331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMmvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4wQ//dXmyGjELpd6oYusEdphlh9ld9HX8vdI5JR1plqpXrpwn3Sj6\r\nhcJPlUOqx9o7f5FqDE3bqSjqlSSQCALe44hNQUqIHIliRgStNB3Y4yp3+a7t\r\nkEurTREnT28vCfvQaaQ/rJCjnDUmKsKDa1yce7fa7x1JDLhiuM6o7GPMyhck\r\nd9dksh2Uxz0yrN0780qETTArSDXWtMlU+w3+tetMh08wfVJnzh07Uji2/GwD\r\ntfQp0xFHM3CbScOxdeiIcKluQfumVsA+AGAcX6bICsQMSYcrC7/quTyKn7c6\r\n3D86VPQTWUVnS9AHKYVsQYhANVAo2CnwDjgcZs5+vFqdTf6nPbyNhnFN6IPR\r\nedUII7BmRmgs8dTr7zX++toso4VvyYkDBVhJNpP+updFODoRcKPNKW9TFYuX\r\n2r9Lcrt45MHCrHNY8UAyFwOJEKFfqucEbG1/x9UvrGAQ/ZmJPl+9njT4XP9/\r\nT7KI0klJHdy6H9+fNMFizdS1WASJUAZKu2qBM1pA9iqRen37SkC3oW4KVtZB\r\n4zo1CwPsSsobpw0Q0LZwdWyxRhiNXgXIk31mIZgM/iSXV9++gPAdeJmIcirU\r\nOASEE/QHxewFZzRmhVSj3CTtLoNwjIch21grH0uKxfDAb499j2JZVTj9xU7h\r\nw7bw8Wamscvj6Lv71NaDnctd1uTwlfdyXb0=\r\n=rBet\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"63f36eb8e530bfb2090fcb2c2362c46a830f4273","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.35"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.35_1648675247092_0.38471559734996363","host":"s3://npm-registry-packages"}},"2.46.36":{"name":"@apollosproject/data-connector-postgres","version":"2.46.36","_id":"@apollosproject/data-connector-postgres@2.46.36","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d2df1fe9b3d87607b7576ef6254e3a5f0c7735e8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.36.tgz","fileCount":348,"integrity":"sha512-zoZSImHAXdoz4kpU5paJvSoOZt3Y2nf1rAjU8VyWlE+OSVs/ikV1FucxleSs0KTSYadj6Rfdm/tGuJ1ZwIiqBg==","signatures":[{"sig":"MEUCICTWKxzOGO6BilMFu2Srto4LtADs1HHD4P1ru3FBOwOJAiEAzKW+EjIUX4Hxm89Qar8iqvSoCAoKCY2ZWUS2KPiRF00=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1104520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMpcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptyQ/9HUJGJWVZKgjuwcTVAoafkqdEbnmKVENZD64hHC1zRZLMok3Q\r\nGgpf6909FrrteppebJGtSGwIv5wSFLv/ynTVu7s5msxujl3s4BpRvBahSpNS\r\nL49bcvA3261wGtAtW5VQoZ/jwp6R1mE/6mOLRVLfHSToxM343URDBAqAshEI\r\nwoLahXKvlJNAdMbToaG9yjwy7iVlJAFDReIM1MwFJZIuvUYbgSWqDIJe2E2c\r\nQF1UApKXwAexX8++bMcvMD4HaWe8BUQo6J6TIhT6SrhvYu2vr2+d32Xvwslp\r\nmU4UXkf2gbboGSTM8CDP0Z6cTgAZ9FohMl9nowElEmbxN+BVfkSUM4c95gNp\r\nMZhOVvLIdJb5rCjpNfBP2N6OkE9Tm112p9Sh6QbIkIG1wcfpotE2yS+EdTUx\r\nQnMI3pwFngKDxDxGWAJKyzOcL8aSYYkRjNVogFmFIsk5hI8qeklnn+5FXj+C\r\n3yhJ+Jvizp3QrMY8Wuivdw8zvT3lE4UTokSKSpoeWfP+HnyitQfJULBsnqHz\r\nFDNbchHZBR04mH3SrqLBkdMAWXEuB9jswSWRBhDXCCGeXxe2QA/Js9FHjZ98\r\n6CtxlaQWbUUvUBvR/k7sDs151Ph5rLY16ZrG+BrbpJ11rlw7uwdhyrEWUqGu\r\n/Cp5vIJplV3goHh/mgh5gyOBbVbDt8pBOi4=\r\n=f0q0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"533dd57052edb17351d94e21d9be7b8dd3decaff","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.36"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.36_1648675419884_0.3720737886469976","host":"s3://npm-registry-packages"}},"2.46.37":{"name":"@apollosproject/data-connector-postgres","version":"2.46.37","_id":"@apollosproject/data-connector-postgres@2.46.37","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d3857914fbdfbf62829869701e9af5a3f18e4c27","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.37.tgz","fileCount":348,"integrity":"sha512-RbCNX3JP7ahh0lFm6MLQIYzqCtQfpR36VfNbLHkxqs+fQU0ukYZOFOOCUTHhSzjtVC7doQTo9vHMUyDdUqhMTg==","signatures":[{"sig":"MEQCIHSJtpLwEnNsmOuRXo7inyIFl5ZEEl5swuwPjZ0ZlYZuAiAxGNbw4oSPIcyQeos+kz1k2N9cVr+OSpNYubbX9If3GA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1104709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMs9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquwQ//WZIZzbmJRuReYIYe48XDbt/mICOUZzEYv6BwCOIyin8xlcjJ\r\nsMfgUeJsdDMkVK7fuqqOw4gQNv8i8RoZA7M/VJQC8I4oYjEqaFM00U0rUxGU\r\nbjNfKcPI3oumyJDKCbh7cusy9Xgz+VZjExUGWhGuGi9REUOmXIHlXOsaGfYI\r\nmWdOyighCoL3cmVWg0QUoVASXepFj9BOgpuDUdQesouoNjE8H+dY7KNZIyKf\r\nFbajaA2eEboNBH+sC46VenOdqI5izZu4QrCMaL9uhG1cURcFoeezwGUW6YNJ\r\n/W2UlUyR2i1DgnDurxUpNF6bRWoauG8s7eLKpgqROkfU+rsdk5Keq5c4C4Xv\r\n0CtpaIz6VgQfFhEDj9MCt8cY5mbXVgWsypSlG4djwN3+zVh6Gh7AlOuZBGz9\r\nqhm6OyEiinGKD4kccJ0VvYKKbokTkM8aihoz7NdzrwhcEpileTmpJS2o41cX\r\nMK3a/j5HZ7pOPm3hRuG4p7/TtRWDDQoeMNlc/bcVgSpoDUNOnweN7X8saY4F\r\n/s4vt01ARX9fwBPtF+CIaH287+fejoPT8ZM41gt6phPQTSGFiKWSjm2A0XNE\r\nB5u/eMaiCzAVwkrL2Hh5S57HXHtGR/b4nyLvCmfU1V8tzGdN073fisFBeh4E\r\n9debR9iHSnHSxUvcP0/hzKIGvny/WnvcAQs=\r\n=+yXO\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a95a5c7b8aba07d54c7f20238c294fa33aaa35b9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.37"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.37_1648675644702_0.9724317165549787","host":"s3://npm-registry-packages"}},"2.46.38":{"name":"@apollosproject/data-connector-postgres","version":"2.46.38","_id":"@apollosproject/data-connector-postgres@2.46.38","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6bd3b52d88a6bf628f16d45b858358f8afc3ef26","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.38.tgz","fileCount":348,"integrity":"sha512-I71q0Z51DywXmMmnEEse8w9LR1naifXKDMRjAfiq4AMSo5RmprTLbRwAchojmd1QxP6b+vAoQEiY2KIU+FI9Xg==","signatures":[{"sig":"MEYCIQC0TxDQLFwaJiydJrg9DGeD2JK43ljbBOCpUeNqnFMKWQIhAMlG2/ed/8hNaj/zFV/ZxXlAZuXAbKX43ZDA+HvjuIk/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1104898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMvYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4mg/+PaVQ5CF2SEcFro43p2RpBdmzs5ai6t9/IpjcbaJJs+AlVBjQ\r\nxYNZECjyCENH75FfexXOJphkuByP7iGzDYVgR2DH0dF1INFfCmbYDmqmmhjA\r\nZcc2wU5Hkq4M6yKkuRheA02bicvwLpKpGBFIC5vI8MfpjFDLDYolaNJRfCm5\r\nkUk5RbTayjpPu6msPLWUS05KDYfKJEEUTOwIK1xKZtnvG6jPY5/UE+yH092r\r\nV1TeA7/GMQPS28YwH9yNWH6CjPshbw3Ve5jDMWpbLrQr9h/DXdSf19UIPwlH\r\nSEEvkj5G9xdFI2Qz3xk3AUhtUU3/uOpYSaMyT00fXLacexKvSLPDeAOfBP9i\r\nCfeV2Ef4JqxVt7bILWbAk5Zq+u+3ss1nnnM/gPOhs0vvVFGl1yu3CGTzwe9M\r\n1Ws3dXEKzDly9kV+O7zKh9f8xuOP2lNRgWERC9yg4HWymxnwbEV4B4U1AW3N\r\nOtBcOpkNPpJjj2xJVDNS6LnEqFhCPnxZxx7ZrfzTAZts/Bm0pRiq1E9XFS4c\r\naN5eIG8Fx+csqOlxqpRTac8jd5aEzgQSnlweRcBodnOVqHIDMkpvO2iuYYYu\r\nZGUe8iej6UDyvkD7eEVVbjdr309562Xg+DVjHaBy7B0VeNqMjVsm43/OggXY\r\nD0X89YC/4t4RlSRjVXrmMfhRIdTUugSydZw=\r\n=uG7l\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2fb42a6898cba3470c2be091fc479487afa0855d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.38"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.38_1648675800163_0.43669447881562284","host":"s3://npm-registry-packages"}},"2.46.39":{"name":"@apollosproject/data-connector-postgres","version":"2.46.39","_id":"@apollosproject/data-connector-postgres@2.46.39","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"47a9b0466a97311d9eddc5438b134f34a899ba97","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.39.tgz","fileCount":348,"integrity":"sha512-3eMIc3APZ9JbbBRgnpVUKMrox1nL+uax6IxoNVRn4pYsP3wJwXIJBykPJPOrDRNMk98Gdyo8pyljmNK6I9UiTw==","signatures":[{"sig":"MEYCIQD7t44peSbWZA2iOoL3u4IoEegP6LlfCJO2fuGyWGOSeAIhAJnFH184oUmebVkKjTt0RX9MV7k42eRhLdYJuwxBKvTt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1105087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMzJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Kg//QJ82kHWoochDhksg2O2xRC/TwnHnQTYZVaK1nZMND9bbpLvF\r\nQe2q71BeWKMo9YKgt/j2h/Yf96pI6gHPvfNIk/ByE4gkJdSkd3fPTeVf15QI\r\nw3SDVvsV2ZV6CkwyHgzHr6ANO66k1T5UOeqUCvUwJu4V2YbuSLUWmYziSJLw\r\nF+YG7VVzvvdMKA9TqTH81kx1lQ7AcY+9N1qvJKA/gpXPGFPRFLHsAfqriVUw\r\nWouO054dbMNTkOkCEv1qxlbqHLQL1sLu7T9M3zQvPgfn2D9FXhKWU9DLvci1\r\nGrBBR4WoZIychf9Q1kuZoJSqNI+0aADAhS5OBVG51/dl2zFeQQBhCGDtJiMa\r\nPybPdaozh/MEsfGsRYQKfdvMtYgh+I5weOhIV/t3spCjOcmk4wSyGdGI9pg/\r\npEUhYFogzKQd3DyEuJTLK/JyWpXRnTeOREJjX5S4qrOKYKfLe633S1OgIcUT\r\ngkLHmgROxHeIBEh+9Vab7DicJOTEz7mgZIipgKJSiA210gP0s9wyOaixTgO7\r\nhVDK3E6Foevo9T/A4Tbc6yqyRnzsQpw63WLlZ3OnOcFFoHlobLE57w2aFm8l\r\n6y4nz/VcZvDkUkbi2vHAnjlrJTRGw/aqxY/dtXygtlsNdjsvc2o78Ecfhxkr\r\nwyoOxoHUnRo9QMhKZMYt+d/hSiZ9/gvHDdg=\r\n=ZYIL\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6980ddd4bc39474d1d6bc00173d7f8f8a496a94f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.39"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.39_1648676041297_0.3845666807397916","host":"s3://npm-registry-packages"}},"2.46.40":{"name":"@apollosproject/data-connector-postgres","version":"2.46.40","_id":"@apollosproject/data-connector-postgres@2.46.40","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a8eefe93edce88334f60ca0b5ed94077a1c11619","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.40.tgz","fileCount":348,"integrity":"sha512-k689koKuiGSURz2+IOoT3AzjZc5TNDFSg7G1Ek+PO7nuMCtMBFbWWNoyHeKp+q24MunPAEfylCVrj/3aMkNiFQ==","signatures":[{"sig":"MEUCIEXfFhhxtt559IK3yrLRn+2EDBCu6aunNJB/iwlOPQxMAiEA4jzueJoDLn7MfuOWxfCJiJ2QJ1ylUh/BCx/IajXAAwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1105276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRM2yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXGQ//VQOqQzn1pqFQPv6KuMAHtnQIW1uY/Am/72sXoPhXZ83W0Y3Q\r\n/6n0QV0iHWcUIQcfDfqZAjTWTf5RnEYZ+YyYTpSwUJkEBLDF7q3zMwFbLapd\r\nWuiFNrTD3WUsMhZPt5sgLmt5PJas01S0TfjcEgyscrDYUEM6vKzkB+NfNnQp\r\nG2cypQP3SfUNA5Yf3jSXAlucrDzRLGj3Xm0Uilbsa4OdbwlC067SCnaAsdG9\r\nq/Y2EcawXSVpg7zyYuV8bWty21HHb5G72BX4V/JVXiB7f6rLyB8s41lKdY5C\r\n6sz1WUfoowbAVnh2MWYEDMs2MHbIcl7p+1zsiT3tOLvwK4FuvuxlJJ9x1+aD\r\n1mZEBE8EKDoY6R6AxeOZLEbPsxOnVk2ZXHxnSdDBGghZfqw1H2OsJtM8cZYF\r\n+EtOB8EqedQTBZBfSY8Lg2t8lK33PjeoZNNuiY5wnpGtjyCwuBmRpPzrIGqW\r\n1QNIsY92YlF0lrQYpe/DnyPf4XpR5jSSJlI3di1W1disZC+lVQ+jYkadGsbO\r\nd56guUiS2/R6nF/eN4mOI7vkgtOyCk3frJTSgEBAwRV6wAXsXqiaK0qEi4sg\r\nt2SFDipBf+6uwpoOfJFgSgns2MVaG7oHYmfw3N/Vk0oUmO0Vm7BYgsjjtgJQ\r\n662JQu6OTf7jjyv+0aXjn22QSrI2oNBLeG8=\r\n=z/bV\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"5dbb5052bafb16451f4380c4a65fb8365c2c24f4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.40"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.40_1648676274666_0.29820835497090536","host":"s3://npm-registry-packages"}},"2.46.41":{"name":"@apollosproject/data-connector-postgres","version":"2.46.41","_id":"@apollosproject/data-connector-postgres@2.46.41","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fa17d13746287f74b17cbb2e1a69db1457e6db4b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.41.tgz","fileCount":348,"integrity":"sha512-L5QL3cGRtNVsFXI9HD6T6jlR/H7myYaUPtzNg7nXafiJcOuGh9jswpLe3CWkrp/mvJBXXM/9IgTc7yF3WSZJaw==","signatures":[{"sig":"MEUCIHyvJ2YULzR10ytjqdq1tA5CvMnAmBX1oclPNQ06Iq+OAiEA4BYImFJ0YYYkF/xp+WCDvsdi+sspt236WlK8ZEqHy1Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1105465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRM5iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmox8xAAmZtovff/xu++RL5Hm2IcbajodryDQipDm1bNW1LqW2pH8IVv\r\nv3OYQq0Gz+bQ9evlyu10hKg6eRTizo2NurNuOWY7nVwyDIrBdjCYz7bmUYm5\r\n0IKPuSY4sV+jf91IRRIwhWTqjNkHDbjDfjpuaM0iGzs0cAtbx+EqOY6wrQX0\r\nrOtd5TOqFOIyirZsI0IppdajcLxw4LD5mOIF40cG/b6fbbJy4moBjfxqxXlL\r\n/lekZAh/9I8Mn6bxCGdFMcYWNHE6kCFlo2nPK1N90NjPeOqygRICHMBNNfXn\r\n61S0sxh9xa/wr7mBZ96sCaROzuPaJ1CyzaZk8u/OvjrP48fF3p3v5uFAk2dY\r\nxYlo53ZGELNisNKCIpty7UlCKLksLj926xLErag7MY+Ja+00P0l6dN5gHq3D\r\nUEa94W/bp6p0agtaoprp6fIl/e1Pvl+UW0acAVSJtZp/uyZFeVSgBs50RxjK\r\nXE7m9dhHr51B3sczBnsUMRliZtWe+4mP9DCjL6G2r1hUzjcQPdGH2jniL9oz\r\n6RVo0BvGWgB3n2TVvKfR9U7OGGWrmexYO2D/X7oHxdwo5nfdafaGR/Mslm0C\r\n/FTvcP32r6mxBI7Ul4Ku5TIBUc2R94u9CMkgwve6XGcUish+WL3S7co0PNdE\r\nD9i+eRyRC5ZU2giezL8R375dUbPZwJLzjdI=\r\n=HxfZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8eaeda1c25dea6cc84de3bec91891665b5f469b4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.41"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.41_1648676450692_0.2320426213250233","host":"s3://npm-registry-packages"}},"2.46.42":{"name":"@apollosproject/data-connector-postgres","version":"2.46.42","_id":"@apollosproject/data-connector-postgres@2.46.42","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"15ca0f2cf7dbc3696911d5be16ec4bd523525525","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.42.tgz","fileCount":348,"integrity":"sha512-dSqn47zc2X3aFh3tn5v3pLc9fHqtTQyOqNtG363qkM3vVhxnShhEwBc0IH1MovN2cyLRfffN9Ku7Au9n96+Edg==","signatures":[{"sig":"MEYCIQD+taTQOb0wFzmWoEeGOmkFidWrXqcenBcQ8tuZ4238SAIhANa4A7F6YjzkEp5DqfsGNWa2GhuMzusphUoKTwq3iMY9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1105654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRM8eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoiLw/7B3EeYd1ryoxuZFsxNSUg6NixrbUYDbolRJ6lmuulLzkBYleF\r\nvuJVa3PQAnqiVeuIzAfqWH0qop0qJDnJmuK11FLI3DPsL+x+ptn0vY1rzp+I\r\nycUUw9shMZSyUfs4O1F1d6U4LAAosjL3KQSqwtaf3KNind7dn9wCJAEydoaj\r\nnYfK+5LCMohzuOMe3z0z56w1/y95/SutlxdR9cejRM5MXE7u5rSy9Jb3xw1z\r\nQe6TNpRCkSvxRRWPF1zkhNv8DuHAf7c9rASc/sz5EkOTYLzfFb3VMqFuquuT\r\nLh8/QKDBDy7rYxwU5i3lGP7ccZlkdhpyyVi885vNCgtqQaz34eEtfeksDZBM\r\n3KOhsmDIDJIUr17qDFaGc4AezkuFFCkAzuwZyG8lv/emeAjgBl0ewES5z/4w\r\nt9qXqLo9CoHf84zrqTFIypvJQIF1T6Q+pIU9ji35D8VV0g1hTVk8rG6l1l1c\r\nIenzQ0E8dcICLPzZ6Q96YdZoRevgyNPmAqQJIo95dDsotweLkxKd6yBfPFbs\r\nTcGRb89P2Go739MfUo4NTfiXYc0kaAvfvUJXxzII8UDxgz64VyRUTgfD/17C\r\npew46T4lXNh3gUNd37EX8J88hKTIQjkRDQwOVVz8CIUbvQQiB0g7vSxdLIOu\r\nuQA5z2n++uvsMrIWULon8R3i9gRQquMHW9s=\r\n=6hPO\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e4011da83ee83db1f53b89d7cbe859b71b5353d6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.42"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.42_1648676637787_0.3208489308815379","host":"s3://npm-registry-packages"}},"2.46.43":{"name":"@apollosproject/data-connector-postgres","version":"2.46.43","_id":"@apollosproject/data-connector-postgres@2.46.43","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8a7e950f0857053449f6e0d1692603cefdfec969","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.43.tgz","fileCount":348,"integrity":"sha512-VlCwt9vh9dcN/xp3RwP78R6zevtKPrNQ/94dq7aO5RwrWARdmWU0r1+vy9ddObRXjnS/n3ZIQcmZloruAlwK9Q==","signatures":[{"sig":"MEYCIQDR35J05XvUDHv806wH9HZjXWpseLyP93m2hR4oCBl56gIhAIW6KRaJ2Bz+pib/tluS3UOrOWaYs37aCrqK0oHRDPJg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1105843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRM/dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/ew//fiMyKvAFhc3xoO7a0Wbc37OX5oIJQ3ddW73mezJqwcyvyIjx\r\nxANncZkieEcQonUvdQ8wDAH7OqnEJKxp09quLkDi/TrAA0CSmPPbpDdFWMsa\r\nDv8EgzfTMBBUNi/rlpd0E64tX9m1sA+wC8wJa8569M9QLJS0vQiD5c81zNqa\r\nHREa/HPGzcB+9bfhIymMKl8smDAbWnjpkJr79Nk+KyHt1vz6Ne6nfeGFYC9p\r\nty2Ym878LahRrJSZEGUzrY2Kr4aAPCHFGXidZqHmbaAs73zIFf8S7V8+fcgg\r\niqTVsju4r4cu7mXdeJM7aQHImn3niQlFsq5bVPTj1X+r5CwXtXmgzHSS7eWu\r\ndvxCMQN8fWyLidZKLyHyfr9ymBLR9Uxi2GMzVKPxvAZpsnPe9p4lnKv0iqGK\r\nndHZPN2zCPkYV7fZmkq2vZTyffg4hc0PoEoDyA6U6HtayQdllgNhKZYEXGgO\r\nLmwBJdYZhkIHNffOxfOmAZ8TNNmp56WVbIE7Vyl0DyjxQxZ8/h4ZUWJqrRgz\r\ny2RPN+CFrIwmWr2KHWGONpj6dVA4EJiOLUohgbP+n4PThygrj7XRt9SPvJON\r\n5sCSImn5xKTbAmbPPC1hUHQGvoopB1adiFmLYI7D9Mv1dX9eXOewN4Bjfqz9\r\nnmL94nc/1g7CVH+lkj63lJx0Lq9n//sr8oI=\r\n=Lj5Q\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a0878bcdb71a90212ecc9d35f9178f1e5d5371a9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.43"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.43_1648676828887_0.7630732951590069","host":"s3://npm-registry-packages"}},"2.46.44":{"name":"@apollosproject/data-connector-postgres","version":"2.46.44","_id":"@apollosproject/data-connector-postgres@2.46.44","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d15104a89cf0aa546f45e22e819effdfe5ad7ee4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.44.tgz","fileCount":348,"integrity":"sha512-3ovqkJkx3i7oJkgSfW3v6P8dVh+qIRnsimedHXEaZM8csrPgSJDIYN4P+rXbyXGwQdmsXnUJ8w07tbuYBY7fUg==","signatures":[{"sig":"MEYCIQCqrt2JzLm8EHCkejjNQ8xGCa5mu9NUW0/vFJp9mle7hwIhALuUCFD2gnFBgQJw7HIvatFnKz4mV7vCRpREVXwIKHJL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1106032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNDnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6+Q//arwhDudt36nJO9Kjp89FrIirCBPszL4RRL8DTlobV5BKptkh\r\n2GxZraj7qJXf8vquT7vA71wgW+OkCa/jUsOH3OfXFSWREs0/+ZeTmVj9IhVM\r\nKfEmN4a2/tqkjSlwyMh0KMSS5SBerH0gP8OzalS9uCCHOcRRY7WXvgt/+g8B\r\n0jrInUgOFB329tJ+/KBcpw7aPzSodp2mjCK4Edkhorio1i4ibFDm7cEGpp8G\r\nn4wBSnky0bgNnhndklq1kH30YtUhMEJMHcw8tTnlAJs4W1us1NZmfAdEYY9S\r\nw3sJ+/I538AyBAs8DjKha9jinR7UQrqApUH//T3QrYs45TUln/hHVwLk9COO\r\n7elfuiG4/QDgb6lxbJwECEmq99QGpt7PJWVd6H31L0cf5KvUj5buK5vHeqE+\r\negH58zRtUzV39+olLq3jorBuRm3mqAMBI4mG60tpeSQTjjQLy/6DqrB4AwGV\r\n5YHT1zaTM08AUz3ej6z2Oxw5vdRZM2uNyjFeIOsCcPngwFgJBbWzvX7rRxQO\r\n6wi36Qm1yazqGQZvxJ0oOmGjaIpT9PM6uRWArmkKpg6fMAXODAGWhVsrexqe\r\nYGlhjJV4c6Tj9paxWEt2RLHjaBBHrKF76C2YFXGOYF7uIEAxxPjIL1V0qwoh\r\n5kFS6dxCPTUAaXgraw13uueFtnBInW6pdtc=\r\n=jtJx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d6d7b7b59a5aa8acaeb9bba44e6ecc24753bfb4c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.44"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.44_1648677095245_0.7044254131644445","host":"s3://npm-registry-packages"}},"2.46.45":{"name":"@apollosproject/data-connector-postgres","version":"2.46.45","_id":"@apollosproject/data-connector-postgres@2.46.45","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"303e8178d3983553ca3407cb2b0bec4b5f5d0490","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.45.tgz","fileCount":348,"integrity":"sha512-Ytdbdv6IIX8HVN8+HBJdvybxuXq40qiUa2SPVdbWs9MmQG2zO98IxectX7+jOmwNxUKiW+Q7p+hRAfem7XTqIw==","signatures":[{"sig":"MEUCIBtGIna1byEgSTnm2+COfhPIqIl87da8tZSRcnfV1ysNAiEAobO4/GgeTcL+yHo3AjHUxNA7VhcloaxU4Rj9hZXKTdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1106221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNHLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDjQ//d2YdtdfcEy2EWFqHvotA4+db5zWBldNGIP5cuZRCQb7U/n3S\r\ng3Y1p9sq4kfPNuA4UtsSWYByaln+YW5XYdJshxCk7X1O//NGVm3idhxtuZf4\r\nuQn7l5xL3Kbeen717sTmgUDAxTYe0VhWolURpNoxmOTCiaxYzYFciUtafnvs\r\nb3pEaBDFACOoLUifxLvNZJXq6qPHD9mhU7uPkTV+By4K+UzdmXJa+gTIp/r6\r\nPS4XLTX8x0lzYJHIutKBcSuOs/yUYGPmIQaWKnvEPm9yW69etk4ASxkIeOou\r\nTW60sjuZyUJM2JQzkoTCmG2EchUJD3Q3UC1VquP/5LLksq9DiiB1tJ0HXxbt\r\n9Ro+W6Uyuk4XHaZyJxkhaGNhIsRm15HmDp8aoX+qIfyYtMXrc2PNKEAcOiMi\r\nLZti2UZmnfdiXL2UYzWPRT7jpl744kGNc8jpDTrUx8sTSSpDZfmMF31xh4fS\r\n3wXlMrcqdVkZmQp8B2Ogg5xXO61q4/48UmSB3S1pIFJHUnJMVmJyGkCbeSkF\r\nZIuZC9PpGBaA4biL/2G8ZVuheCFHHjV0Ae50XsIZr1+3XShU64cdP6klyfys\r\nRjybxUbT064eXUvYLeAmePwZisTuYyEhrd/PrIW87kc1AjDlpPd/jm6dogry\r\n+OZoXSHXQ004Ykk6BwYR850l+kP6iVFMMh4=\r\n=sqBW\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"972a304e7afc4c67bae790ac8052abfe24caf79d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.45"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.45_1648677323224_0.5907851029080318","host":"s3://npm-registry-packages"}},"2.46.46":{"name":"@apollosproject/data-connector-postgres","version":"2.46.46","_id":"@apollosproject/data-connector-postgres@2.46.46","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8cc9c9a86f5da5a6b9f7ebd361939704a65b5c29","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.46.tgz","fileCount":348,"integrity":"sha512-MLanVIhVHl7Yk+HivWZa3NM/rm3916gSczWIBZBn3XCP+WYn7tJta1OKYBIUo1Qql+bWbmoMzsLNFjUtVe86BQ==","signatures":[{"sig":"MEUCIHkL0dw7bKcxlFW3NLTO4Hh1x6XFdNEpPapKzVDqTFO1AiEAgbx5I45sbMjMTz4m/OptNDYwifFh9pTCtcgJZZsmYpU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1106410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNJnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoC4Q//Su6umrtV4KN/r0agBY/HCkXD3ImHQUFm0c1+bDr0OANmDEjp\r\nOkhHrseH8RJVa00KIgXca2oWmjkZPiklevWgdMtMBz/0KklTfnAZ8buyB8gR\r\n1UFPq55M/VxEmctrEIhanXsYODbS1z/nHmjCuqL9P8kRK6GTnii0aTDj6jsw\r\nz6Tzk2M7xEBfxIuCBaKKS7dL2PptZbtYkGQOhJvTaJOpNZ3mbbEsxyNbNNkL\r\nam3XSd7ox/VuoUMQbg6+LyJsIDnh6AQQ5NR9zweBil95df1VzBGrRT8y0lYN\r\nUPQuau8Jtq25VTzkYf3uvYz+mSbcdaJjvLsfAy/OLeAlQbiaEOavAw67cIB/\r\njNJmxWA8v03uw93FWq6WS07oqCv1YZblWnKpyr/G7SJJ/iEpl+3p8I5T7XZN\r\ns1oM4lbyu+p4iMEzwaisYkjx77JV/T7VLjXwqsk35BX+dt1Oy9qB3BQvMiCa\r\nN0Kf4GBz3+fW9hx62kJKAvbVfFzjiUcNtUeNLdtd3znYwhqKsHiVPwK3M5TJ\r\nta4a4rCBfA/qvDTrKTpbTR8oG8yiXfxBuABDgXZnTqIkvuR3znKDkmzudkC1\r\nnWm5REY/jjhwavP01trBE2xYp8wVISlIFOAKD5wU9/EPN90vbgBLVKxM1cq6\r\ntq36Mx7w7oXnf835g0GlSu3xorjVt2s8tz0=\r\n=R1oT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cc1afa30076883f77d159c0a884520d4fe642ecc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.46"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.46_1648677479433_0.7045060502416336","host":"s3://npm-registry-packages"}},"2.46.47":{"name":"@apollosproject/data-connector-postgres","version":"2.46.47","_id":"@apollosproject/data-connector-postgres@2.46.47","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c8032813b1252e5768a3563d2c96d086cfeed163","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.47.tgz","fileCount":348,"integrity":"sha512-85tcRumvUtMFbGLeIUn9OTgEC5ZH5+twkpxF65xLxsMn/iXoHsCObirujHC2DL3J9H3L4aHjdwgUAdTJc16JCA==","signatures":[{"sig":"MEYCIQDRS7I8BXfgl13gb4ut6NgJflIaSPoDIamXO6UhDgSakQIhAKJtXMvLwTtWlD7HIXYHcI4SxXpbAz9c/N2mSuaClDBG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1106599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNNMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2fg/9HatxbZXgKL711wO8CHtY78mB8OFWwkjz2vaoKEdY7EzaI8LG\r\nMnjT9hF5GndM5wD9Q0yWK4ui5iklkr9VoG0vAnzOgAUJr5r9SpPfLxOsmjsK\r\nGnZy+u5oO7jsRJHepv1u991isvVeoSZ+Mm+cqVJVMGCV7uKvc3jYpc7bkSkn\r\nYozc5nJTIF3kNLL1QVmEKZmHkvv6+mSKfyjtyYRxKwqm6M/X/ahvi2PCoAL/\r\nJ22YcJ4ky43PDMys2166PwvECgIZ80BAIpU0cgd6HtTNLgo0akiTDqkccNnh\r\nqqOVzk+xejkzFJiF6HQELQk4nLTndoQCAx3Ui74rgxFMSaZ3vAhFpLFu8OlM\r\n+HR2IqgN/905oknjnmFki+RC4sfSHhlvvICBBFMJ7AWiAGxr6U09f2zvQgqu\r\n13KFjdHMYM/AXRZADNDmbaSYA1IhHSL3xbPAGwolKJRmSbblI22+pV5/nqsX\r\n0NZVgqhQOWOm3w+c3bBMgh8C77gahz6faBnG3+o1G5ElxgdNPejyZNj7Kku1\r\nXf4wylRm3PWdEKXUjKSBOTTYlTW1znTLwgd7xjeju6ej31elBDm6vZpGpkaj\r\n8mtpuH+ZYDa8DhCOSzkWA7zJoqH7Le2eGfZOpQH93BFUrWNH9mjaTZIv+SZe\r\n7A1KUWKTv4zujto1hrRqZaT4wEf0FHp9SO8=\r\n=VHcQ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"715bd8456371a80add4f6654bf6350c9d19f7a5a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.47"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.47_1648677708735_0.3187093608010856","host":"s3://npm-registry-packages"}},"2.46.48":{"name":"@apollosproject/data-connector-postgres","version":"2.46.48","_id":"@apollosproject/data-connector-postgres@2.46.48","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"21a25202ba967a8aa11e9ab2b2e3483780752eb8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.48.tgz","fileCount":348,"integrity":"sha512-+ocTHEyLrG+8r88HA/MpWHNuppjYbjQtNixKGE/uPN/SKGyg/QaJwcaQTsvnIvhE1fH4yUokXm4sDVAsmcM7Vw==","signatures":[{"sig":"MEUCIQD2VtxQpRtxZYGvVMymysYjJ195MtmSyxAoCrj9JBdGxwIgcUAC2oEPj81JGF59IgydIuVDNLK1aRn9a9avfHYrKv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1106788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNPeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqK4w//aUIbQxQdIl0dVuwnlyYDolMoq86vRqMSobhdjHNrUjnQ23Av\r\nePHHSMMhHPPwz6fMbrDiejg7kcYKxsVyBrfMhbkj/MSOO4M7HQK5DdwmmaCA\r\nMTPuBfnfYtUwbjN242AvqNUYeElLhnZqXQSZtGBZQwZXOt90y/ErPGIe42k4\r\nZRBKjAwQ+L4w/3JdOYwe/jXWs/Ey1KK9B90DetB40Fz4/5UctzB8CNSA2Rpm\r\nYtnJKviNx2GVZRnLyAlJb2uWpwWyGSuUJl9jVpjQu+Q9/K9zlImX0D8DfldL\r\nn8oKe6um258rUXu5Q8WKW1F1gEE1pQ2/ef5hOcXGgsTDrp0lLG77kdr2u2Bi\r\nKxhKXUvk467wZiAxioleCwKg8LNnC8jJa2G6Z9fydPDwzFI2OtIFzkAMOqZ2\r\nJ4kjmZF696ODazokMBSi1W8T2YKXUORPjjyfpojCIc9rr4liJCILn9s6Wljd\r\nY8CeM7dUxQEf7KbktpIazq52fbOkIff4zqLEZFrGxcl91fUyuEkkuuwgL9FO\r\n8ZA5IMPu0iyKXh/g3IViLXGTFnr8I2XUDcbpIfl38kiOffNxIDFei548kr3l\r\nycigYb31cAa+Uzf09eT+97ptUZt5QFbh/yO+5TmMFlo9tQT4ZqNWgIzB9quc\r\nUDo0IVTJO2gozYUUf9p0eSv972ZyyozVWbU=\r\n=xfQR\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"723a74dc1579bf5a8face23d3defca96ed3ad19b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.48"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.48_1648677854127_0.761851711764268","host":"s3://npm-registry-packages"}},"2.46.49":{"name":"@apollosproject/data-connector-postgres","version":"2.46.49","_id":"@apollosproject/data-connector-postgres@2.46.49","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"de71472eac6d36c328f1989f97e58224d9643a33","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.49.tgz","fileCount":348,"integrity":"sha512-r2NfHTSar1f5z61s3Lpi+YpzSAK4DX/XJ07ib3Z67XhhdfdKZJQ6oHo+3VNAnimmaGW3z+te+K4KOeiUQ4NJFA==","signatures":[{"sig":"MEUCIHrlsqe6v+uQ46lSKW/jROFnq8uy5q+4TDmQTGRBdxKSAiEArQ34ZwezDGWWA0jcqaW4ejInxk+3vr4BIdZ9QzLNbxw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1106977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNS+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2NA/+LC6m5gcUSx0OoodWHqENyCpSwi0NOjARTysqE8CxCn0yUo1j\r\nfHBr8tLX8HfKIOqCmiCPvq78hfKsAl2wO/bfAg8QdyEknAd6q7zDx4Mhz2cK\r\neB7fRn2EtqB5b2G1l6Bj46fDxVV7wJXly5yqgUlwLOz9Tyo3Rjd/DhlbZFI5\r\nbkDW/BECX6QoAtHe52+0EOaArHChkUHBUCO88IaOjsRkwcBHx9QXEDVsAbeH\r\n5ln8AWqM9DaJ3biGw1ZD9vbRHgdmFoVEgS849xRs0JA2uBCrUNM9YzJtV9jj\r\nupKbKqRKRn/VN23EnA0jaNF8g/wusAoL2ROzTX0c9AG9SebtsGH1lN1x6xaW\r\ntCvaIaeF7rAsnYLGCrRm68H3iQssSSsMd39bfWvxddsp8EiL+zlVcDESubou\r\nOdJFuerVyeIGuRPnlIzMcF9p0vmYOZemj7BuPviXwlRNLYAreXHXLpc94rgT\r\nTGCBtrlv78GZoCMqJOs/udfCW+kaoQcH80yYFkKJ7RGRbvO8BHsMc1nKQkJf\r\nJyNiCev2gRoOFNY3nFQom+jpYZpztrxqBxOh/zdjwnpB0Nuyt/pYA07OO73I\r\npOo13XquHabSmRtVvFvKBxUPyH2wJnGPeMExA5B3n6HQTtxeoM2MBTQ9rD2c\r\nVAYq1P/Glm0ksOJYBEaQzrnq9fRiTpFKDsQ=\r\n=0E3d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b8d8030a2ec92228ae99b94d7421d2fd3ce995af","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.49"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.49_1648678077972_0.6825714449423532","host":"s3://npm-registry-packages"}},"2.46.50":{"name":"@apollosproject/data-connector-postgres","version":"2.46.50","_id":"@apollosproject/data-connector-postgres@2.46.50","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7c0fefa3b4b83000575d0eeb416f6d9302b1ed37","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.50.tgz","fileCount":348,"integrity":"sha512-fT2V931IPtAwKFfrzpZB3r90pO5nGyafRIaPMe9xzy4jsvWeI/AUXvK0cSSH/yvLpPy3LGkN4mCD2hRqFUyi+A==","signatures":[{"sig":"MEUCIQDKB6qwettT1/R/NF1atWvQvKa1wNwykCnLrs7j9eaTgQIgHKgAa0/YuIhodG4jAQwI0MmIaWdlqIZ5aCrZRBSb8yE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1107166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNWRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtNQ//ZX6NTLjS+ISXAVV2+WhmIQOHa50qtwuNVOuO8odtHnmM7UF7\r\niCeaXzQ4mMC60b+V+cymaN6GrIgRlewg5MxygvoahUeJm95MkBvvrIvq3Ebl\r\nD2LDka3kzx3qG574H9GkvyJe6RMomSOdu5XWVge/5KefaBlpqtIt2pRSXI+x\r\nfDz18Mg9pujLf3TqG4BYlHLcqgHCdf7/3Xd9if1KV+RDY3T9TfKDCYyhJLQ4\r\nflUeKzayXBdq0Dm+SIKx4I6ZQIT8zzudgph/KIZgJJaGqW42Uryu97Gb4DhK\r\nUGfRgiSf1NVxpvjb5jgP4Slckj7XpW3ssJcp48+X+lMfWGnBvGkQsbOAQcIH\r\n1Xd8DsHsNMmanAb01auym77Y145l9GS9Q55/5p2ttmNie3IvnSohbASe1oH1\r\nlZ5RoHho3ubROanHyA/0jfi3PfYoH9PrSfWTimmOXGhbAy83diZ8xu5Y6bWy\r\nPGbPPXkA3ywncpkKZQ8j+eHvixGniNuOT2FOAyuTZL9dJruaXsCwIvnr3Nmk\r\nvPt3l4295zNaLxVBKQw6S+4c3ukhJcwdkDKrFg8+IikuxgexASFkqxArvz3j\r\n+smupU5VcC5tb0dFHhuM/fJKFZfs7eokg57VbM7MCBU17z6lhTcv/EZ4YTbG\r\nKN1ywTEtXEpYlYWYH2NThVxAmp4q7LsfBwU=\r\n=ldqB\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"027524ea827abd921e94a6115f172da35720ffe9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.50"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.50_1648678289532_0.48553916713796297","host":"s3://npm-registry-packages"}},"2.46.51":{"name":"@apollosproject/data-connector-postgres","version":"2.46.51","_id":"@apollosproject/data-connector-postgres@2.46.51","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e0457b2df9e64e167448ff44c0518aef89e39cce","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.51.tgz","fileCount":348,"integrity":"sha512-JsPj7W8mo7X2+2x1ceuJ9RcahcPjXPetvSrwkkqk3WrIKzUYwInnBZtuRcc9tkNkTy2+stp/MWIvkwxkGMCABg==","signatures":[{"sig":"MEUCIHxX8negPYC09T3lxtHkc9VVn+bedg95nMkr2X9heFetAiEA9uS44oF33kfr/hO5yjj+EeiVWNG5iQJ6TtlW8LtikB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1107355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNYqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5zg/9EyCt6gYonIPhDDw6ZOifS/0cKGDbgLkWoIGNBwRqqRrlPUeC\r\nerCAUYsGekPbF2vqqCb9BO4wX0VtVUzQY5P5QdT1stUsNePepClhmDw4MHJw\r\nYkVbEFqAzXlcPPzq+N9IfuerJmA90uwrc80mcYbRw5fwW4kwUPHh1ykrG7F/\r\nLLLgkyzmJZgrV8IoZUU5ij5UKS1VTFx6lbb/X7im51WooJNcInyoUpdsnoXi\r\nfN7SGtlewa51hkO7fKOCIyzANCF80xHM4qJ/9/u22UzOWInoPoAy4F8tIomJ\r\nliW8rzE1KtlPv5u5jHFJISiVlB1u0S7RJAp4gDyRg7btGljPPUn3g3F2fWnz\r\nhBVMmQJ65l/WPpsMZLWOp6I+HLhBM5l0IvSKRqmpzm0kghIPjdOX5b9FyyZP\r\nRqw66ppRGrGV/Yvsth02ltF1cGDGDoQ28bsj23Oo5I50NqARi20OKXVm9doI\r\nmsnnBYfjeL0sli8FC5hj9B4lVpHAkUkOQG5DJzQt0JeTYNAQ82t1+ZFIqkhU\r\nll5mQs24WfOYb4exDPnKbVf/9YRp9yxeprghRv+LicCw3sCnfqje0OwfZHh8\r\nxD5OMQCF4kE2WNAGImoHbKxUpkIF6zmy1qUBgXXgDQF1t6FCLTH5ytseg30Q\r\n+cL2Ayeq8BKzX9EBLs+qgJKqcX5TgajgZo0=\r\n=f3rP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e547302a92af97fc8f674260340d659357b47f2b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.51"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.51_1648678442484_0.23122971132278858","host":"s3://npm-registry-packages"}},"2.46.52":{"name":"@apollosproject/data-connector-postgres","version":"2.46.52","_id":"@apollosproject/data-connector-postgres@2.46.52","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5a31eb5af127168029046291d2c9c98ae2ed5430","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.52.tgz","fileCount":348,"integrity":"sha512-/h7yhmv0IQks+Sb6/2z9ETqMBgRl3hmVUxSvTDTjD7JVSOVB4xwE6KljPZh2qTmX22ejA6C4oWfTLOfWkdIM8A==","signatures":[{"sig":"MEQCIGav1BKHIymgjJ5jXrlB66IYWqxKG1s5Zcv8owlPAwalAiAV/jD/OFU4xkTB0HwuZQ5m0iknYBH50emCjSTpFz2vUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1107544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNb/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmWA/8D+oDMxuPMOuwHai2kDENvDp7yby9zFCgSzc+NCEYpA8xcXoJ\r\njxw7Oa2hTc2t5YcypIqJg7x09lM8kso5dDw1Q225o+Hyp7DwEfhi88e4T/zg\r\n7AvQp/Ks0CBnPF91eSKzCj0Uj0SbJhIzTvAJU6frF8neSmLPt8GLC+eLbOMM\r\ne6vbIJttInTpzXHqymxnDD75cj+2ScHKERkn5Wsx+AaWkJic4p99DiY0Tx20\r\n09q2z6TkmA03QKvozbZit5Vz78yaAhMYf2pJ6TQ450GY3CU/wK0oevj7XWOl\r\neIu9QRuXoIjKOYyyaptbYU7+9FIdo4tM1pTX8DfSwIVu5bniDa5z4+yA8wpd\r\ncPCiAuy6ioOP8erRiY5KOliVQk2aVsA+el6p0SJRzp6HyrpHeYuEfEzPUDcC\r\nbu1/+SzTmGOLbohgZKHDr6r71s8TlsKEwmb5cnSVMmpA2P1Oc3dAHRV8FF04\r\nr+kPE9RCF5RQabohjLF2n9SXfOGs/qXSneeUiTHKdlxEbjN7UezdOlqLdgS6\r\nwFwoVgt9cvER3j2nnHartOH7I3shof4GyapGT375W0IEMxQPCVxBgQxz/HJh\r\nU1G8aedtMOirZ0Zp/bWQu169u1H3RazyIWdUn4xfxsil74EDCuR8bqaRZJqs\r\nR5jffXGvIXVMTUYh5MyG6OCyuYywknlhaz0=\r\n=6Sph\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"49a498f7b8ece38a2dd91503b362a199495273f1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.52"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.52_1648678655074_0.5753358055019528","host":"s3://npm-registry-packages"}},"2.46.53":{"name":"@apollosproject/data-connector-postgres","version":"2.46.53","_id":"@apollosproject/data-connector-postgres@2.46.53","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"317942c5cafda4275aad8b852386821ab755b193","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.53.tgz","fileCount":348,"integrity":"sha512-CTleP444XhGt5gi4o0fqmz8ZVgU1eh+lGhbnE0NlG1SOwtgptdYwMqve1e3hJMrvhpYdKZJesM7/vQSMCCEFUQ==","signatures":[{"sig":"MEYCIQCjYjr8Oe5dbbt6dN01DtDPrIkczvyI/UDgdlGo73uLqQIhAKaSUnEdYqo6Z5sN195spO7xvIcQ9OsQfl8HXWs4CqKy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1107733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNehACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxkQ//a1horJHeZGoeJFnL2ZkfTteKLLjmZT+bpqA5S55LU7HfNzfc\r\nO7iGo5RMIRDdTlnk0bLHT3NTf97qY2+eSg1l5bq3seYiUycCtskmR1qjZSLo\r\nkQL5r5G4YRnG57Y1BvpO5NhkFflAdLLS06+xmPeTB+Nd0ooHZOFak3bYT4+y\r\nHImqIEGeaRkfGzQ4k60YSR1ej+m331J89dxevLiYp5481v1pXX1sTHbxyADc\r\nnzAagdZttkTyCw9EnkZpplJDjZz41WjNWt/lJtQJ+bAQWCyOo3dmAq06JcJZ\r\nbllQBJ7qDw0hrs0lPGRlickkxq8K/vxSHT8MVRrzT+XHSJ1KKocv2HT1dj1g\r\nPP7Jb2tAomlyauSZnjPdIWx12dE5wnPhtiC6wLuNAxDVteK3f5QI3dMQDO1o\r\nwwMGVaZbo4DUJjBoHURsZe3ITACEMH95SVkBecaNz//zqooq0nW2Z7Sts8SV\r\n0ghyvufl3LLQMsA/dZ2R4EXLTzSpfunkx99vPDTKPam8+VNFtZsdxboLpmZc\r\nualJ9TNGB18b4QVqB9gcKvDb0+AogKkZ7lQxnMfVuWKxdLLFQI9sfxHm4LT8\r\nUUs96oKWQurVmfNZjaQ7oeXQ0xrkBf+jLNjt92X+KGuupb+voLEghxvRIax4\r\nRb3L9aSuujCnU9Y5lyRhGMtH1Ngv17OXZ9A=\r\n=1YII\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"111eb7272afd17acef59ae25c1c9ee491099f57d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.53"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.53_1648678817218_0.13110132629364757","host":"s3://npm-registry-packages"}},"2.46.54":{"name":"@apollosproject/data-connector-postgres","version":"2.46.54","_id":"@apollosproject/data-connector-postgres@2.46.54","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"106eddef1f3cb7efc998b7b9de96a636c8b2d6c6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.54.tgz","fileCount":348,"integrity":"sha512-kEKy9WtHKXBXRJ8gdyvth2WfQ5Dq4I39B6Z3azoefOsUqBow4ciY/llnZl19qW18giZGKtD8zhkj5XK6QdXrxA==","signatures":[{"sig":"MEUCIQCO9VlRtNIsRfqgqJ/fC+dDSZXISycfFQfnbV3KPWNfdAIgBcU/2pbfbgYRs11vc8N2FGAH2oml0LYJYil3DrLgG+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1107922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNh8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoevA/9FCHEXjwG5T+wOlp0evNC1cRftQzj7uL26Kmk7lS/q3t+1RWN\r\nrLsvCf/WfeqrFzMaJWTeo+eSmXH00AspsbWc6Jncj40UPOOhOjjAxSGAO2xz\r\n/V8AEfSvtXrDs6jT0NpH5V4j99GXScnVagGisc9pv7NMTh59u5LcqYFbbOZs\r\nb/NwUp0DSgvQUnPAl3vhF1qxqowfLQuoiERTSDuBEKHybRqM2C4kjO9F6NJm\r\nDpw/Z/uNvOJFvAHDucIQiLfNa5E5oID2XsK5JN5LNd/uroD6/OT/miWguRw9\r\n08KNWlORMChzbPIvfzQ1Bfy0HyfFtWGpU1N+taZzMuFlAuzcl/Sr/UfTJa/M\r\n23ZIC0QCeBXyZEoKzyJLXXc1dZw60lS9xq1fJZXKmv81xpD0+LXraQ4sEWPa\r\nRnJIfu7sb0dlUIdnx0jRgeET2B7BiKLqUFvx91jdahLkLtVgWzuuFtvIhrM7\r\nnfC2p88JJ7K1zFqJbCsN9IwiVRiu9qu+kqLtfVLNeRwWq+FZxvlT4WZNz+MN\r\nsjYuS3l7xUaGdTTNbvdgEyaP93VlyAMk8FV/CCgO253YY6b6NGFi4OFS3b8G\r\nmVrvet+prcTpoLFsNEIKUPmzBqSuLUh3BobpOcqA3N6GBMIU+OFChZBSWOa0\r\nvCGHVrCzYPVTDmLUB7VnOG+fIVPWkxrRnzY=\r\n=WMix\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"82fb8e8f0799966593882a6b9265404cb426b39c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.54"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.54_1648679036581_0.10247232196489198","host":"s3://npm-registry-packages"}},"2.46.55":{"name":"@apollosproject/data-connector-postgres","version":"2.46.55","_id":"@apollosproject/data-connector-postgres@2.46.55","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d74ada357d3ee639df25c074ad5bca3a6f9122c2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.55.tgz","fileCount":348,"integrity":"sha512-HMJ1kLSwYQg/6azGIvnqnEq/cGj3yPiKZu+kL1NvaiH77wJuhDAUrmfR9odPGuXxClynAFy5a935RqnxK/SGMw==","signatures":[{"sig":"MEQCIGzKD1TiL8hYozexZcIOvP5C8ffmv9yKo7l4GP3SEsLhAiBBKH5otIPNEuHN67XaQroPhpSvTbCFH2CkAdC4AZ9TSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1108111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNlLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonqxAAlxr2T01RUFAvmGTXT5EtVHdugimE9sfOSriXvdX1NWW0TmXI\r\n3dgB0S7DLKgfIwhKYUSlM2s394xrDs7yI3qdAquhGudsC4gsWYQYqfD/joPP\r\n5m/0Lj67js2n9S57swlojWRyuJKV9vtRSYlWC2+pDKuZvjErjmde4PgbAvXi\r\n8WoSzSgwVifkfRsGfJwT3slEmikSkCRl4k4vlRIufqch8+5uMh/N4EPh3XXx\r\nlXMaJc0AdG+dLmHyqR6eUPa+OSC4O9OvC8FhktQtnRkbuRYN9xxM/lP6OKmV\r\nNr2t04ofayqaztL4IGJxFJISNKhW/P7urDlKlQKByFuGsfkJR7/r2BxsiZkl\r\nXWYNBg/kNLY/z5/okrgmAah2OJTMv15G9wJJjLWn2jYK87DrrQ+BT868skvT\r\nQiD/Ye5ch0CQUaxqPVJvlk+PoIBhzt25WgEH+V7o79SBPcgEeSoHduW6ylfy\r\nxjOC5eWsd7xa7cVo9aa3Pv79jn5ejiGlxXRxAVZsZt8zrwdYZDuCKxO4PhZM\r\nZoL5e1UJOcC9URPqu4UigCiVnEbajNKiRfN45znuDmcRUHzOszO8+v0dWLKd\r\nISpqB7Sw2h5BRbaAKlQ7HhWcTuX1dpfwHPJBd1jj4TGbmscXakNCY1VX5g80\r\nfpz0GpzeGyM6GqZm2wM5bZHdWsbaKujYZJQ=\r\n=BdPz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"19ba89015b71a9ca8b2e3dc5b92e205f5b7c732b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.55"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.55_1648679242762_0.7704193764538139","host":"s3://npm-registry-packages"}},"2.46.56":{"name":"@apollosproject/data-connector-postgres","version":"2.46.56","_id":"@apollosproject/data-connector-postgres@2.46.56","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c1db6d7193f84ccd86acb64dd5a7ad419e5cdc7a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.56.tgz","fileCount":348,"integrity":"sha512-xfh9dI9edxoU2MD+AdpnUBxaEI1XY9FdJLYdZzOb/4h2UBTHPnr7psRjb+yNOHRXkmQoeAiDpR281O1bgejhkQ==","signatures":[{"sig":"MEUCIDaasmrCxYoKPEwBkRq0Ax4m58hsvlljCKaw8+P1wTKYAiEAmkCyYGulEUR+pkpxpPTSDVIdF+AOmoJpgXrvTY8rrD8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1108300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNoIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovxg//VzY5hz8mvTlSrqKXnAUakcYdQhfTAhQS59EEVmc+fmIGas3Q\r\nigi1UgQZPGmSmBdyLtMMB062jyUCNQoG7LWi5OYTkbv6pDsz6hxvF072dwK8\r\nPpwdKsMS85vb704Wpwv4wFEJTTNQl0atJ9NL4ed4r2AAFSUkXX3iQRbh5CoB\r\nNIYF6oE8wuUjeh2SdtirwGSt0b1nU2bANNvuLsi0Uccow0uZhjQyOAVWmBsC\r\n62BVadOQb4QlUkYAuJkiXeiu/whrYE/In+BCv+TjdhCY6sMfcjUCNSgVMNtK\r\nSTlMVkmKpC/80BG2k0JmEFE898RuaoFVsSuY81knkYIuqj5noOePKRU8cNzD\r\neVYcSS6FOlHtxP5iR/z6a7NxQggexE0XjUMs7j9f5VFxszwaycT8SFwBC9Nx\r\nYRsbjX5umImI4rOtI18LrRq0dqToiqW49jMyLPcmxBsbS0ugCCxma7V7Hfoo\r\n2ocNK5wj3ngh8yFo7NNk7CZDplMz+lmykPhxJmRTkDAMdZmbfhsfJCpiNfbW\r\nrd7ffHcpPXvXp7AzQTnHfpcTbRVZo7tOH5UZE2mJyn6R5O1x4lIUlLk+4yYM\r\nprKgkrVDfqqf6Kqd541RSpl7sTd13ILL3CIMy/a9HTHhUJ6WLN+m5Lg60OJl\r\nVTHFQe1cY9N+JrMYKk04JOWV59i3AKUN6TM=\r\n=Dd7q\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cc962daac0337cb566ce8384c436feef3a017d61","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.56"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.56_1648679432777_0.6828143982236123","host":"s3://npm-registry-packages"}},"2.46.57":{"name":"@apollosproject/data-connector-postgres","version":"2.46.57","_id":"@apollosproject/data-connector-postgres@2.46.57","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"395fb0c9503be10a3fd61dcc40fd6bfba732af8d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.57.tgz","fileCount":348,"integrity":"sha512-yLgAmZULl7WaRPT6EJ0MM26RT5sCcFXDJg9AwcBUW7MGxdJ6gVYAnvMCZvw+H+s35829CgFD6rjSWMxlNthrFQ==","signatures":[{"sig":"MEYCIQDEz3d1/lFAcsWDMM3DAN5aixUY+opII/k+YjT7mDCXAwIhAIqv9PiFrgQJ2wFz3Pin1z8HZqJV7Lj3HIeE5JJzN+GO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1108489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNrVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2fA//X5ZRhajnvnS8cJPfz5sDtKVss2Th+EfNMfntZtmi1e1VYUQo\r\ner5u1VLFyU9L2DyU0QIKXFuUn4dzcETI/PXmD9m8VDGUNX842C3auV2YZq5F\r\n3BaWTcI5twCU9tRohWPyT0RlHlPG1P7S8EurHIdE5Le0vWmXyIncijGkd/sl\r\nMs/vSwNxbONNshzEnHdqTlbdHGYy9+/SWxl29rVeb0LNhyEheSFv+Vt5kbVH\r\ncbQyZs67ipTqo7kf2D0DDjJXvTAP6ecZt9sk7sLWt3HufPJDkhV0x4PE5jn1\r\nJhSThNhz6zKlnYxnrWlT7zvpVlXRInqM+sqlPxHQE7peOKVTyCMgCFuCmccB\r\nZsXxxtdijbeLmMXosunAGHrBKB9+eWqlsghkZD4s+pUpE5ObDWQ2J1glNEQC\r\nEvm927BPG9EeaPUbUjunuBZ/8ObmQPnQFKc+uvcvJ/pPCpRYMH8+snp2RSMM\r\nir+OFPLi3eqr8jQMEsnLeHp0lQuVABgIlRlcNT9hnBB8K+7sjRrcnVlNzqqh\r\nOBlxnQvjENnn/fWQlrKChG+SkDhY4X4S4R/zep9Y8zajEiklNRUjWnaM8Zch\r\nxdrdfJDH8ZCX4l0Y4E12ta45OYChDp+Q+uQiPthBpxFnCwzq4tE8uUNsXC54\r\nYVKuL9onEaFsPqrVxU+sHGQ3b2Ws/hBDTdw=\r\n=T0ad\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"739d92eed45a2f3d60f6a5614741969a306c11b4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.57"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.57_1648679637590_0.15153259674588648","host":"s3://npm-registry-packages"}},"2.46.58":{"name":"@apollosproject/data-connector-postgres","version":"2.46.58","_id":"@apollosproject/data-connector-postgres@2.46.58","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0d5c56c9f2755f6f916bc937ebe70ded975ec14b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.58.tgz","fileCount":348,"integrity":"sha512-56eI+c3Hh4NJ5LWOYjA442wjWtaaK4vbwE9RNQCNLB2S1Bw5jRfuA5zK5weK/JKejh+Q6YPoZvbobueafmfEuQ==","signatures":[{"sig":"MEYCIQCUvdsJB7qfrcRhdoVm8req7eectnlqZECoi3cHDf81JAIhAJY2odjz1y5V8VExmAEtczLIkLC4sEz+zaoHjTaue+oU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1108678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNtuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqizQ//XxjkLgto0JqDg/9evEbAvsDW3lXSfT0ltVQRqfdfLe/Cz+lG\r\nPVdrgOZm9ZGOBR/R/EH7oBu9vNFtH2pW11lb+O8o+gVeJNr3HgwxzVnFDEMC\r\nO95s7cHdP9cOTTcO053SjACcHu8T/i+nG71eoXjbxmnxOg+K75OqiG9cfx9o\r\nnETJDjtkGeJ9w0IPdxj5ZGmxeLGBBtfh8XVoHFIKR2t4pSd7UkfSFsuKD3wQ\r\nskUKlpWxL+9+QIy1q1OmFiEA4nqUlCsjWe/brmtNAR9klG5EOROswPWJmxK+\r\n/AuVaGUVghmyF0D6RYISNXgIX4nScRdbeTulCpdpg/wdQsGVV3oTus0Jxpi4\r\nCBj0lK5ubMpsJNt6HiIjlpGd+RDOKkQHX7RymUWW4b4W7wjV0w4p+blvquTf\r\nG8rg6iX5//25cY8wfDrv02cdc8MiuFo7CICWo3RCiYx0RzthOJbspqMy2+DJ\r\nPB9JMDqr4s+Ya70VVJ1x+Js0zkSf5XsPjypl4AEBIlUm/1Lk1iKpKQCdJjf7\r\n46bCNSRf+Kzde4ZHIsKSGuc//7W1vxoMN8RlW3XIDwZeG3/nwdeumS3Ka4vc\r\nAwcFS8VEmjQvg41XpCbNlEOBH7LWSkh8bw2B2rv5uh4/RKBfQhuAyWUUkzTt\r\n7Fv5y5cfO66CBtQSNdtNYBOxjS1Qeb/25QQ=\r\n=PLgx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"06b89ed1100b587ffed022637f1695dcfb7b538b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.58"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.58_1648679790582_0.014739114672910114","host":"s3://npm-registry-packages"}},"2.46.59":{"name":"@apollosproject/data-connector-postgres","version":"2.46.59","_id":"@apollosproject/data-connector-postgres@2.46.59","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9d5efe31176f9c15ab6f08b2cf4dfde91052ce8d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.59.tgz","fileCount":348,"integrity":"sha512-qz/wAUGIFWmdvcnliwj2Q3+CKr/pnw6Cl883vMgnPXsoI9wFYc3qGHjp7OOVF1gX4fvGGrQvt6xY1HBDLtk6uw==","signatures":[{"sig":"MEUCIQDMdlFKjxWf2xy81TJqP/0btPs42TlYWTRDtkrbxbWoSQIgfaRzfFdDscDc3uBDySxD6Vy2jnB1eYOg4y6nGZlMGgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1108867,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRNxWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUqhAAisniGfRr2FWMw1JQavyI/Xi5Imya0PUoXOty8R/5sMsKljqO\r\njqQ/N2+1yvqcv1JwztLracBJuyfP04c1g4qPcHneGF/U/bMk3N2jcbuMTsRv\r\n2kYW0CaLfadZvwxiHTCKjprw2f+ye7DlbClmu0ILb1SySOzdRcLMSm/5W8/T\r\nfR+NRonNj0Sn7vb2L+VWEsLxS78JGlkzpxr80TbQqae8znMtISPzIdqyC3gs\r\n/yzwVozM11NV/cgNsQk/1mePM2TK/BCRbrn870daQhI6nqw471rD5FLJYpq6\r\nwmrx6MnCHgzbJ0rTibHDEtGtsNzhObozF6lIOAjTaZWQ7t4zx7/FyIMtHvwC\r\nIgLH0hHPRXm/mbvW2hnsSereDn9gxVUCFFfoSwNeEVrMIAxbum8JBhSjtGQv\r\nUHc1bUgeDrLA8J1c71NriNx3zzlYIhOHr5IEXYkQZrNwHE63fMA80Oohn/t8\r\nSNIa4i149qUL+jzL1ZUMVyvaHssrqJ49QCYTKombE9Nnlse4NrPj3YQ/SfC1\r\nrvXG/3DzVr+TXS+qvndXkiUs1d11beaYJik3QVf2RlvccIhszV6sVQxa33TE\r\nTYm8UWQwqg12OqCiS8xdy0A2uZjCtKrQxTLgJAmww5/IlM1nw9s46g2UXIhe\r\nQTRNz+bZtTAVqi3IEU5uTqbsZL/C1afhlfw=\r\n=Tn0I\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"59847b348bab05c7916ae803e783e8259fa876ad","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.59"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.59_1648680022166_0.19973391301004062","host":"s3://npm-registry-packages"}},"2.46.60":{"name":"@apollosproject/data-connector-postgres","version":"2.46.60","_id":"@apollosproject/data-connector-postgres@2.46.60","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"64e0eac49f16c2edddf47c2e704223ef17952878","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.60.tgz","fileCount":348,"integrity":"sha512-fZIk1APAfxzSsahoGSa0sH72MCa3kSWS5hHZzqtao6mhiTda5N3xtpEcIHW/6osDCDjckGJbBk4UhmrokS+9Bg==","signatures":[{"sig":"MEQCIGivHawgrAE2LiTy4bXfbGKdgy5LKej6QEP2CkFqQXkbAiAJDIep2hUm5MdhE8hAYmETU7m7tWlvWxAEtbZo14iMHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1109056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRN0LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoU8w/+MXyMbyUi05Nu2gAwbdImPIfsEkmaQ+aqcpb5fjAaflaC/InP\r\nrZpfHKbGiexfRVKAMRpHDanD1pGEZmim3OXh+YUAADLieJLlxV781wcgFrQa\r\nUJzfO/u3EBUCMh+LdakMDVZOhdyNjeHiDCE9lJfLhlX8NPQUpvt7GPiYjfFF\r\n1154fE0/Zj4aewnVK0Nbx/fkEOjCH0h/lhpbCvAf2hrJelP3boX+UBl5xQGy\r\nVQ5TQuMy6tkf4wiLupFnUAtrKuiFtyvRfsbbbv9pYce2zmXC21BqVXJjpB0O\r\nrnKQjiOUuC4jTdTOa7vXKenuPRUiGZyv0yOSmlB5bPNX6b4F0Ltn7lLhg06b\r\nVWDoF/Fmq/E1QPogLvU8bmbVreCoOpqBOy/hjUc2piEY6cZuwCFc03g/TwyI\r\n6C6SxMmMjUmzaqQOH6uXNi2vtiybhYGPf5s0P3mkoN+CudeeT1WgKa9gHmqD\r\nwvVXR/CZHqx/IDj+QaXBWKBWZbTHNl+oI1agvRtHloQQ30K5RjG2gSqe45wl\r\nzVaP40dTz+kJpSOYDKmlSWg4eCDUDaGEtGP0Qr27ja62rbBUNWV992jW3LRi\r\n5jHdOrP7SXFiVuKQnt+E1dR1CKVpEjEdMbw5dad5mphb/2BSSxjSDvR/kBJv\r\nwKVCYVaLmSjzEf8F2KkXdPlonRhyU+DS6x0=\r\n=yt2w\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"050a3f57fef19a48044a62d0803d1b0c7b4f1ce9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.60"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.60_1648680203616_0.3339591450320383","host":"s3://npm-registry-packages"}},"2.46.61":{"name":"@apollosproject/data-connector-postgres","version":"2.46.61","_id":"@apollosproject/data-connector-postgres@2.46.61","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"04cb897419536acb241fa19a08bab06abfa9aab8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.61.tgz","fileCount":348,"integrity":"sha512-T5QsLNdEi/WmyXBoQAAjjIIM4oR19kqAk1fltHVVEsDmx54BZarZC3m3CYdZ0C/Yw/pUVvCKsUAlHTmKzr2XCg==","signatures":[{"sig":"MEUCIQCYpP88z9xic5fdhF9LrQna7FmqJDKLEoin8z32fLjBWgIgF0w1sHHoiZ/aLP6RHvR39+f9sOLjTYAmk5G/weZ/gOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1109245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRN26ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqD1A/+M0fBJG2EPgZwm3TZpUGsRoak26h9JQp7XaFNjsqLv6r031ra\r\ngg70Wk/GUfL0W2dOdJmTNtn8B9aFuWUq6SQuMCcSHKAqM1LCy/6Bc92XknBk\r\ngxJoiI8Txg5b7R1zgqmvETc1qEVk4/Kp0knkD/WVMxY8oW95iqzF1v601fBc\r\nFofenyN7WVb2SImGl3ner6vpSrz+p2YTyvFnfFmadrgnKySYVUJT3zlSL2NQ\r\nkb5QWMGFexCphmcqnuV7fgXxNSKT+0sfvImww8oB1kZPNV7iGXDp3Yp2l6i+\r\nQBVFGJnrh5gcruKh1ilDEv89A5D2tXt/GFKi8XXCg3R7E1GP65Rf0cmRlhxa\r\nKJr2g9uCwarvk3je4vwUtO5WJnhEEFA4ceV9/J4gzj2jql9hWVqdh993mF7w\r\no51gkgOilyB379sO+HxxEQbKNttMc6CMhblILy7XamZsE8bGWY1J6h/x85zx\r\nWExIRliIepPRi/FsNrCxYjgITBbZqJ0OjD6/Zt6qqSWnPSxWtkezkg/NV/VB\r\nf8F4nEG+s8uDy0DlWdBfXNVlJMpHM0yGhTefHg8a1TxQaFsy81fRRkWzajQd\r\nGJxx9fzoqVUihS7Dpp6cwA4aLbvRptHuX9Z52mAOOo71qiberhOX8uSdth+r\r\n4rTmLBR7gnXJIHkLSvQmUGZz7VrsHbJfq+w=\r\n=FxCu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6c4ef822ea09370fdaf19b90ded0fd4b359eed78","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.61"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.61_1648680378041_0.34916720341824403","host":"s3://npm-registry-packages"}},"2.46.62":{"name":"@apollosproject/data-connector-postgres","version":"2.46.62","_id":"@apollosproject/data-connector-postgres@2.46.62","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a4d4ea9770f6eeaff49d3f9aed2a4f8d2573d7ed","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.62.tgz","fileCount":348,"integrity":"sha512-1VouDdrAxRJe+zuWEboStmMK96BL/CoDO3wRhyWLP6XWFCQgynTy3O3MowKP7KLTGxLbf0wxTqEbSpZhO5ktkQ==","signatures":[{"sig":"MEQCIA19T5X+MD6Do8nWC90jKLVZC+CL38EIOKg5TALWYJthAiBaeDgc/ixjxr3sKWwPm2fEr4EpFpzz0lGGpm24ds6WoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1109434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRN5VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrU3g//QgLuAvhpooMvH4jVcP5Gc8enCp95V1tnnpg8aNOka3NuMf4m\r\n06AIeRficpgcYG5ixbkrhmTwggZNC8TRPNwKcNu2EBh1fjCfiM+MJJCGcysK\r\nMETubz+nbAffjGVZDnK1HTghJHx4UwAFB10IOnh3pkFYlpT+Sqcpav3W681u\r\nSGtPFVWGRNMA554S6rpOd3Hul4voMcnLYX3NFpSKbf7Op0bYSXNjbAta7ciI\r\nkFqWhmzoN8CqFeqbh68M+yupRTquL3Vk9ym2uw90uHkTPdwtHY/aMJzCoXmH\r\n2gZOn16r9rkfV0HAWCbTZlhR/KZ/ONXTRdtEiQHjHLl2Cy9IvJnst00F1/6m\r\nLYcKihz7nx7QdV7z+Om4Xj2snpfMaKbZGtAkanc7rfMuIWVdu+9Z3cQMC1eP\r\njEeJADu1YMnyHShaVgEJbz+IPFrnIMgB5LrmCBmZOMZDpYkqdRiNCzg5OOU7\r\n7/HXS23049BBnPpZU6OVqC2S/nG74P31neooZKbOd9qYI2YuBpyQzvgJCw7Y\r\n4qslSFQwaiBekSbvyGo3aPNvGdpcDfIupC/Cs7HiupgqQpDoUaJBq3xDAz84\r\n1w5sUV9m3jgVq5Cvj8hENlTLBq7aiPavq0KbSy0duivELHk8eUS23RwRu9I+\r\nZmSWHKJx/dpPHxaUnU0jD0Z5eBLYrQyDSCc=\r\n=gGIR\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"12886bc38d722934aa5739f2090e7ff9bf936ed7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.62"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.62_1648680533725_0.6331594550423911","host":"s3://npm-registry-packages"}},"2.46.63":{"name":"@apollosproject/data-connector-postgres","version":"2.46.63","_id":"@apollosproject/data-connector-postgres@2.46.63","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3f3feadd51f9b908b3f19a651deb25867092519b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.63.tgz","fileCount":348,"integrity":"sha512-dT1Rd2P8qOg/3rvrTGWLZNjubqIY5vO+3Qp/Mb30oE7D9IMOeEPbh4vpfXNYTCyjvDXYUqOaDH1nRewhhFXCyQ==","signatures":[{"sig":"MEQCIFbiiWbtK1He6hwsPYUcJ8egT0hQ59c9gOl/T4mXgbVrAiBJlFLN/W4OJC0ZqA+Dw3kX0jw4leRMDd1SFv7i4zWGvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1109623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRN73ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrO/g//VIltnU1+hxGCgwORtIl1YaYUdOGpz0mSx7SeXmH2kwSIceQZ\r\npHAxmqCd9Qq1SA55OkGvY90OEoRpzRSE9jv7fWBITSmv+BQH8ZeQ1WkH3jWi\r\ntorYvHpXvhu5+uT/EUMFThaCLd2MP2jjrwm3ZnEX6C6qPYxnhF9FDcbx6BDk\r\nalMY8TX3oMm8adl9QUw0Cm3Npl29e+zfIwICtxYzUZ1ZkHMNVgSolviCWo3/\r\ntInHCAbGG+/0oufP7ITeh73V8zcNgZsm6A7ULjhWGJJ5MtbgzuloIBslu9TZ\r\n2V1ZYGeePUG9DydgwimHsE4TmT1ny45ssVDP6NVePAJA+nd5hqRzdlmWWIke\r\nFSco1Kf+EpfWs8Btj7zLLWNbs4xdkBhusJ4WcP9eGaZfVLxSlFIghOmj8g71\r\nahDFRHfk9DhDnpL5vbzdpb/WwgaEpS6Lf6YnhhISVrEXxhZkNNfWSs8euoJ+\r\njJnldh8PWF9w5KtVI+ZOdNlkLzBWbFrLQJ8RpYuNzubhoGYx1gKHIOAofPMt\r\nqVKFgMeUf6tDz4i8vfhRb5F41kfp2b9JoD+uCemm6ld2eJ4GVMLPA3nTcxex\r\nLATiALtvoUwGRaQhTBm+osqmXMC5ws3F+BYv5ggEeYBTmsioLwrvI+TpQav1\r\nVrC6mzV8HOh6Dpgf+IrgjbQl7roKRvmQavQ=\r\n=Z7B+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9eeccf69d2b34823f6e946ccf9e75dd472192d63","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.63"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.63_1648680694682_0.08041767769581143","host":"s3://npm-registry-packages"}},"2.46.64":{"name":"@apollosproject/data-connector-postgres","version":"2.46.64","_id":"@apollosproject/data-connector-postgres@2.46.64","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0a24c9a033aefd64e1ad21ba57fa03eb34b249c5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.64.tgz","fileCount":348,"integrity":"sha512-899g/Lk+Gv3jnCrx67fKp7KlDPuYLOh8ZluJ02iSNLCK3DlXvnSzXmod5Y4ETMdx+NPe3F0Ji7LS9FbC57IKGQ==","signatures":[{"sig":"MEUCIQCymNOg4kQxDGH/EG85erh7eLlyTTnoDTI0Z/c8TTymIAIgVViXK6Pj+kT9/hlzOjsmvz1naoH9HTJvIF7eb+c1Pec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1109812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRN+jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpR8BAAnMY6QJ8vcWtUpE6qrTo6l18k/9pY0yvYvuQqNfyyfC/10yk6\r\n/keaPCV0fPD5XMkYnLBr14AvRXFVEALA7cG1kM9Tp38lDACX/XUgC41cld08\r\nhW8S/A3XZI7VIUNOcxBi8O7fgw0f0og9gUQWsLLA5C6uFPlXo9hQekxLs5NW\r\nA6Hn/QiIrx9UR4WEGmgisJ55ls+RGwzjQ2kz14Voa2VbSes2WWgIfHWk7VmJ\r\n9nRJW0LOf9nKQkdCjdkxwn3y1PJKhsoT4bCUp0p6WEmROVSfc2U5/AG1SJhd\r\nZe6NTaGrPiQhsfjD5Th+wevkSopNP7xX/jy/6uxaIDqojsQAwQzbqB2gw1TO\r\nLBiKes4XuZD4kO3DXeTWbuW4XHLF/6bBcnTorIYZrB9VaQi4yl5aPOSU0I+J\r\nuMwz4kLYIvTSwCPhvS0g0dpA2YJ2Xs8eV1baaoIeMn7QNIIiB9mk6dSLgPo3\r\nWlFMIRQhAFl4pBiJYKS9pL2daWobx1q30FiuA65NeliGxDjg6vBwXCkLYsoU\r\nwXyK0YHciK58hYHsH8ZaZt8D0/9oDZEmBUHwG+DrD7xuLSov4NEE6WY5Rwoq\r\nvAMSTXvneYiL+X//aNF9hBeXyQMBrUc4FFeTlgsCz3ZEfTfFp+LGhbThNqVF\r\n7ZOdl4yfpmO8nzdXC5G/mDSN7zcbXvCkKyk=\r\n=wTm2\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"55669d22400dc362a438e03c2ce35d76d0d2e883","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.64"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.64_1648680867432_0.004159760442881799","host":"s3://npm-registry-packages"}},"2.46.65":{"name":"@apollosproject/data-connector-postgres","version":"2.46.65","_id":"@apollosproject/data-connector-postgres@2.46.65","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8285c65fe26af40146e5297dcfa914f75d2fcd81","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.65.tgz","fileCount":348,"integrity":"sha512-u5mQ1n2QucbJAso3Fc1lbLynS5RXVNZpJaIu+q6OakRTQmwx2JawPb9Z0eoFluxhZS1lhMHq/i4ONPHwLnF4bQ==","signatures":[{"sig":"MEYCIQDZA6GXcsRNrIAaMrMKE3so37ES1c/K0Hk+I/X4flT+pQIhANokwT7A+77A3Ki2xfZ13140I+WeifYqbohjAKs+HOAy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1110001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROA+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2SA/9FA19cG7iim+3CiJzM4eAOEcmY2kcX0ORpHvTJwvci/jj0mfo\r\nlqwYFGvIsEi8Kx2hwt6XvzbWa+Fz5mo3MG2h7VYGwSXd/V6SR6VeFWbHrl8I\r\n0gQOnbqAjvifRMb+5PgxfZxzAj8BpPnhsLXFfLrHt+QhFaQZyH2U2+X3eHN6\r\ngrW1j3sCrW7Q/l8SFXCYr63cJK7YfuvfGprdV5JkzriZYdDC+b4/NaQ0nwRN\r\n1iP5CONQYLRCyONbEX4eAlo7e3IPvH8W6K8ybd7J9rTVBX2xCYHYZa2C6lUS\r\nhfQaXpzoAVXX5onKybnD9XI03jQqHsXtXZ5SOv7g42ZP+Sx1uVkPCFU1oE4n\r\nJu15O0FsCRCtD7ABXzSQG0TpJFNEpWqZUqieZ3pMXB81rvcDAdnIGq++KaxW\r\nvJt3eJ2Hesm080Z1d0sRmg8bM8eWlJFHIY73LSA5ocvW9Ih5+UjH5AflYK0B\r\nIwnvdH08QVxhYSPQavlPG4fPt3BgBDuuVDDSTKT3LKXAAlS0+xo+4XcFn1YK\r\n7KX1Yq35we57bfY1np6INH66jYHzpbg7ShZKk4TG70LAktM6++jtKTMVU34L\r\nAyIURNdgAUnp3fBjO0XxyFYbS6egQoBNXBbNmZ2vZEZaEAvgNhyQWoW88fG1\r\nlfipT57LKXo/240hBrg4P2JDNCQe5pygVM0=\r\n=LIPp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"028b76b4d66a7ec1d21fbccb07e7f56949194939","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.65"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.65_1648681021999_0.39634575105774994","host":"s3://npm-registry-packages"}},"2.46.66":{"name":"@apollosproject/data-connector-postgres","version":"2.46.66","_id":"@apollosproject/data-connector-postgres@2.46.66","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c9b00a1e8d9971b56866f6c7ea8956c310a6f970","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.66.tgz","fileCount":348,"integrity":"sha512-4UcwX3IYQuJE71HVfHaIjGAfVJ6h01hzfLcktr2I06zHM16Nyodvk8QhLiwvXqKCLUrUzm9z6KVfkCkzNmQtNg==","signatures":[{"sig":"MEQCICkPsxx4XwJFtq4g7TsA4EnITE2dPx8M9L7KeIxnHcaCAiB2vi7PZcuIVa1ml5iuQ1FKCoCpDW4swhVbthMBLKURBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1110190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRODdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJcRAAnwYL/+RYBxrk3GMamqdvCe/OQuCBU2CcWwbC/nDR9beaeJ9b\r\nY6j0jHerd04Q+UtKYVg6dHwJ3kdJ4TEZGbVY85xbH1tUxQXDHYpxgUavL6H6\r\nrdy9pfs0k9q6a9/fzy1oyWWaTuHqi8IXdeQPgZONrJv6FjuymnWRxb6350tB\r\nELc2KjL6y5iN34b7fqUCDAgKLhRoG9jF1ca7M3dIf/0TSaeDBECrB0CNjIcu\r\n4yIDg+1s8qph9SvtTDk/GDtPxhycdISzl4dlWUun+Hv3MRI5LgvaSmt6z9QU\r\nPQK3a3B+XPdx0HXHmCha2Yt70ac5EEv0w7wtGaJAsyKWTuniOsUjVF0vhod0\r\n1DWs4ZsLqNFICF3zSBd+60gsICO+bt1RIBGFIx2KI/yvbRubeDTwit9tsU1r\r\nbW/59pcq2JZHJ0o88YT8v1AKqCTbC2QxvZDwi9P/EPTja3Bnm9ADCOdQA99x\r\nB8B/gdPhYr0j5VDhigu3fLaqlosNpE/M7iADDi4Z97aIqRwJZdJ7wz4LyQR5\r\nFa5FUuEs6kTE+9rD8BHTW8omNZmkJt3iOGCQWW1L43Bozbc6nIInGZJtPVsD\r\nX2OdttlzjRxfapxvX892FLZL/BvqgRtt3NoxN2o3vN0K4fvqsDchbHPiolR7\r\nj8o5lZti6i5JEo4CGQ+S2QEvde3PajIFJGE=\r\n=8jbI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"bda733e498aac0dde8a210dc065f0941b75aa2f9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.66"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.66_1648681180971_0.12387217302923315","host":"s3://npm-registry-packages"}},"2.46.67":{"name":"@apollosproject/data-connector-postgres","version":"2.46.67","_id":"@apollosproject/data-connector-postgres@2.46.67","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0b1894760a989d26348bcb39ea4c851badbc8d80","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.67.tgz","fileCount":348,"integrity":"sha512-HlHVT0nHWw6Ta1Q1Hq1yGeHBDH2+9I1ohZCstB+ir9rHjCOKIf/pV1V6JdAmSBDmXy3DDAOoVvL/RAiknuW0xw==","signatures":[{"sig":"MEUCIQD3bXJz9A5Ee36Z82KUOG4nsflpSQSqiYFMxf23MijPmwIgNTlQhzP24zju+IIBbIrgV38emmvQSqayAOxOZVr2y0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1110379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROGgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/Pw/8DwAeB9YBH8dV/2RQ1CR/VTAHAkWRkct7c3fCTG7+J5s59/Dw\r\naCnLxPcT7tJ16Ry0kCt5VxkwzpbO4aJxXKGIPSIO0RjBBNPiLPrHKKuNUw3V\r\nzTLaqE+buBhuBp460ed+bq+1Ws3ZU6BZn2i5zhHsbVdlk6OPJSzC7Ty0HEW1\r\ncmhBu5QgQgLmZQGRVFx2swT5IvnCjrKNbeF4JxZVo0DAq5ewxZ3j5wl/BdhV\r\nqu9WA0ySbGZOkt8QP7f6EHm6uKcINi7GDirxIkBVZdmIHjMZALkyFpvvrqQH\r\njH+JPooTy99fdGpqVnfvaiXUAHiu4JZkP9+Bvji5e4L8E+zaLBPf68uzU+Eq\r\nv31Ggo2gQoDew6PQcF+lj7BoRE+iH+UzbhA7uV3wECGaJVv7vWj2EnoGriP9\r\nWZDKZ3bCYhii4zeZ5H7zK8QoRgs8fIu733sStx7NNUqAXXkO01vfyJ+56kKs\r\nhcMib9sg+xQUvu9qwXmkAzRwa9yaq89G5uw7I2lKzLjSPOQrWMIM/3c0VjeV\r\n506BohICaTQu9EJJL9D8bY2tHNaBOQU0oDbHJU1B7U2glc3d/hrDUQmn1B6Y\r\nqKL65y0TatjGs6J3RbI5SSsyskU9zejXNUpZd07n6hwOZyGekyZfgZPpmH1j\r\nu5RIlsFhLJRw6OFnIPKeuv09dqozCivgbdo=\r\n=elIC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"fc2f7b4875b1dad439d96ff316b95bb6df934719","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.67"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.67_1648681376226_0.312362959686842","host":"s3://npm-registry-packages"}},"2.46.68":{"name":"@apollosproject/data-connector-postgres","version":"2.46.68","_id":"@apollosproject/data-connector-postgres@2.46.68","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"74bb633de091de2dbee8b43bfaafd1a679ba48cd","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.68.tgz","fileCount":348,"integrity":"sha512-WLX41mTfaQQWC/lwPG5ujpYcmvLKhoYOmkApLTNLbYsK+Te1cMCiBGxcJ8L0SvBEnQkEju12nDFHwE+cWcZzpQ==","signatures":[{"sig":"MEUCICfJhZFuumP5rQSYMsCLmWZiwvPLwlJs/TDM+tiZ50mlAiEAn2820/zix6oDk5DUMAej82qph6jlM3FqTsph25Af49Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1110568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROJqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2bw/9FBSuBxUQxgd8Gr35aqkAhsLVkh3sVrm5qZo2dyT4cuBCGsTl\r\njo/yf3RqjSXE+AhbS8fDmiHSPcO49tkIJAeY35yOfst9yiViFKb0v+7SRQke\r\nKvtJVMlAVFIltlPamF3P+iaPRjZcIfIAb6OumknJ0izYdlNAYYoKtCsv8wfV\r\nUQUKF/ePW+lg2J8UX0BRvZskHkbNLk0sAAPYNRim5xzPbD0wMtNPwbMZeRe3\r\nkAs77uVqH/Suc1gOeTFj6VyiBU0ORdVb6k99McdqRph971tavrT1h/wQkIkp\r\n0OpIgo9851w5irSNRN45fH0+Q2WYuIKT4Pkl5+eN9pbTNCo/KDjVdeu2LtlB\r\nAN5Q5LbqJv2E0YpRmW08GV1nEsF57H5sKBMMHEFelhpjazSbx46ss/ZG1H95\r\n+5yFfSBOKsJgmurzC/cIS/rtMvLMdv9vBo7ntrkt+vVxQbHkkLII8a4mCzXd\r\nhGKTXwivxWc8/m2Wi75itbvLk7CWPnFvt6HQNUyCh7Y3umaJhiVMk/+ridNu\r\nVWyIuIVxkBg6nOdTWpdeIGt3je6g1R4jcOxGzpLyMT63vpCl0zO7Df00W9jz\r\nyHMEOtr888wplc1a+VGLsiIppegeZP8x7AmReR312v/67ehOCoiUBDedBYgr\r\noc2CWEb9Fl9eSTpOqOOCNIcQU10PUgPzxqs=\r\n=SdVs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"de18872fa2058cb48dacd4b036eb361ea4ec201c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.68"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.68_1648681578633_0.7192000332235113","host":"s3://npm-registry-packages"}},"2.46.69":{"name":"@apollosproject/data-connector-postgres","version":"2.46.69","_id":"@apollosproject/data-connector-postgres@2.46.69","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"853cfdd8c708fc5252242e7bc63ec3fed2d86f07","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.69.tgz","fileCount":348,"integrity":"sha512-lfSE9ca+iAZV4puIeZ8ERVP6CAj6Cyxq63UOeZObFVos5/Lg3+D2QmWP0U89yKOIGdbR1uXzjfWRfpLzuVaPVQ==","signatures":[{"sig":"MEYCIQCBMHSiGvursdHy6MV1TZ5okqK6AjOzF6EmyNVvpSbRqwIhANJUwnxynNqlH3Nf+ZrMkhZx9GZ4cVRzvpNV+W58y8eW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1110757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRONlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcrBAAjlR8IlKZgxxLRqLPUVdXFUwxGvZq5gPtFD1P6Le/fertukSU\r\nzNRhNaEpBbMt6rp+Xakm+D7MfrFTEGJXTCpwk78OwQuHY3/qQeSCip9+RW7H\r\nHsmWvptd2sFH77F4OkfEb6pzBme5vF17Khndp7vP20OV5a1i/JB9HYXgzCyS\r\nMskYez3UYJq5hNAf05PE8XCt2OrCGXaz9sQff8igvIxTKeUHfx21BPjjAg46\r\nPUfuCg8EPLYhLcMBX0IC5M9Y+a0TMEMATfpnmVOhCD9rA4gE9tNlimFMk2eY\r\nBnTesNmJkcR7qebemjYWMlazwHuXGJLwZch4yv9ZKng2Uagt+2FbEAZWmRri\r\nOq0cq48cbYoVbJ/UrCyr4qWzFKw1Ag67qN3BY/BHxDk6/fWLCznVFtY07elh\r\n+6IIScGcbXI2eXLw2Wyx+Jzvddi8hCmbCeyIcLzxP5/HHTwfE7QWKgRK3TZk\r\nuTtMZIb/CJn6sgaM+mFGyKNMoj67GPgyrkmUMaRxp873ClLDb9uWoMK0pAma\r\nkIsQjPhcKcd4LZHpxjqJflY29gxzcLBuEwihiFZr5U0e8afpxFo1lZ2/esNW\r\naW39/6gJc0XcSImbm2bLnUtwSURsC7C2X6jw5j0g82o7z2qjFqYPzEGQWdog\r\n3wt/WEPjE8maGSvvSzOZ8h1Ttl6w1UJFBV8=\r\n=1SFb\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"56dfc4ea9245a5a7f62b17186356159ceaef9274","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.69"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.69_1648681829592_0.6241289792067626","host":"s3://npm-registry-packages"}},"2.46.70":{"name":"@apollosproject/data-connector-postgres","version":"2.46.70","_id":"@apollosproject/data-connector-postgres@2.46.70","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0169017de4ea5d71164e0f013bf6af6a19a13aee","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.70.tgz","fileCount":348,"integrity":"sha512-mMtRzHNYpP7gmwJt0xU3t4X8F7340c36Ytwafl/MAABgsdyqcGSbakBnmyCfbiANb9KgifLzjVAGUKvy9Q6RJg==","signatures":[{"sig":"MEYCIQCsC9FqsNtr35IQO304Ua6wD+qXj4hgnxWm4xGayddh6AIhAPi12snBWwHmBsk8TQfEI4IgSGUCL8xcek51UJl5Owz5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1110946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROQ5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQ3RAAjedT8iChioDPaHhhuEeby2wrjouIRDdJz130yIrQQe3RvlsQ\r\nZ9i34LPSJazlvbDZ0QRMRDuQk/Tw+eexErbESSxfxr/eSg9Mv9C/2Tuxy+rs\r\nR55ALwj8hZxsD4Xjc3cZEfV23sHiVcTPORNcfzB74ozdVOapyRC1bt1Eyzp6\r\nmoKdgVC8c/FRNqA8I5EOe+cS9sTzqolkIEUr2P63BVSVB5wwqWAk19Xm+Nhg\r\nzfbEW3QBQa+WyWf0EPHzHOycZj/dU569juXicCllajrSTq0sIBby9DwPG3Lj\r\nr3frEiKdhBuu2EnUiTwSSC/c6vTpNGYCGveStk/5JkE5Ptx7KB7/YK4hUtO4\r\n/Z8Ey05AZSmRpWHyi1bAwQhKjckc2n88uOKPOK+hXySrVwJYhR22Tj0dvyn7\r\nB2QlCx41tDF1tW6/jbXzY9O13Oj/HUzGM9wjwyL0egpsp4hLoPKMJLzGXSx/\r\nvucxczAm45b3K+YPULSIWxIwSfzioKl+Y48TsSMsunhtrRDGijUEnGzS1FTL\r\n38XGqpF3bH2Iaa0Xhc+gr6e7OdSsXso/ezY9SfNo+4008UQZud0MIjaH4KT+\r\n4wyhb6Lc5nspv6OdGkLilyb6pC3UG1OFty003Ori8vtNyP4A13cFxMzLn0++\r\nbVLBmlxme7JrFen8xfm5D5zDasrgPVzWtG4=\r\n=I+Nc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f09b3afe5fb345950cc9820563011fbdaae4008a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.70"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.70_1648682040925_0.37987019278357415","host":"s3://npm-registry-packages"}},"2.46.71":{"name":"@apollosproject/data-connector-postgres","version":"2.46.71","_id":"@apollosproject/data-connector-postgres@2.46.71","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fd51d108342b50bec2ada24ba23774741cf57b70","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.71.tgz","fileCount":348,"integrity":"sha512-5ZvON91uTZl56Imdq/5oW/p5d65d7VgnBHsOr5hmnQotR9FIj3fWo5umd808/hTIOOQtJlGJ5bCCoHe4PacJmQ==","signatures":[{"sig":"MEQCIHDzBPITGKyfu9MxkN/QfqHJdEciqB3pWIvZ7wnJ3xZlAiBxpXkhwIRrjI98HIm+Pt7jHCkbm6L/bW3MEv41zY2U8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1111135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROTfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowSQ//Zpw+ZXIPWak+hnX9H8wpnPwjLUJ52hJuGfU5+odtPYrBEPcE\r\nC28eAA5l3Ttt204pDBA2jfvWm7LYLxWxkiYq4KyI+QYQgzIpFNyGq+NuNe0r\r\nhUUVRxROw+rOb7Osul4AJcVoUfnE6o5n4zCiQ4ibTT3+8moa7mYeoPGSKot4\r\ngCZ/cVka8v5LMHxOKOjxhBgV36pRs6u6i+EbFE0WlRXUooWmt3U5sf+X+CvG\r\nszqtA8mUtuCcve2WP0RIPHEX6/LuuMi6j112B7xJLvMI8bSYqiThltvXIVwG\r\njC4067X+JMhonWV/Fipqa2CW7Kn/l6nonywEMOvBI6bhobUgwWIa7OLe0RdD\r\nkU+qYbiXaDSxj9AEi+d1oQhAOS0UAwJk5s0mQKWFBIa2CBJC/6mhLSc31uDd\r\nUUY+sen3ZuK5VxU2BnEUF2DLXpupnGmvxmB95igZPNKBHCpEsjByM/fiSEgi\r\ndn5vZ1QlZOn2VuIKeDKY7bLtN9r5bxOvQq7c7HOq2dncZE/6M50chgqXIhlz\r\nIlndfa2fVNB24MHW/rNISlu9GrAxdj4jiwu81t+zalMEiVeKU4uoMsjsYsFz\r\n4gUyGpyjOPEdPlmEGvZ9N7gezP3gewRBi+kofTpSChALkXm/QkuqriAqz1ZZ\r\n5IsxJ/7JVOWWXYi5Csempl97DXWBPW5n/ig=\r\n=k27P\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"bdd217f24e842848fb8c712e4bdbc6030d846b1b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.71"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.71_1648682207391_0.2942530362195248","host":"s3://npm-registry-packages"}},"2.46.72":{"name":"@apollosproject/data-connector-postgres","version":"2.46.72","_id":"@apollosproject/data-connector-postgres@2.46.72","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d820f2a44e1fbe3192b4184e5daa7a97c8f56174","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.72.tgz","fileCount":348,"integrity":"sha512-bL2URau6aEmIoXQG8KHeCw8/+C9JieJ+FlIxTQNb5hSnfqtk5gTfAgYXNBH1gI8jKMaNp7GKxejnwAPVK6q5og==","signatures":[{"sig":"MEYCIQD9SNtADyZdZsfu09wV4+KEAL2BpAA3hl1k3fQxHoP7sgIhAJDAMF3E+Kc/RDgB46zoA4w67/B105szFwz3zxcvEa3G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1111324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROWfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov7BAAjP3uKNBFyKT5igMayzNzqrKx5ifCD2zHYHsjSRcgbx1NUHlO\r\nhmhQDcEtU/P1zgsLrIGcGNlGu5znRddiR3mkFgiKlT3v5pxHxhiHLloqGlEK\r\nOAhl14gdYy+tJpG4h3nTbzBUZoSdek++Ihf8LWsZG44n7Ikf5IsKCk4nKBsh\r\n8FicZrIWrqydmC3R6MGVrSTfufzyXXjy8KtMvtCW6QA7DSiV0q8YNT53UdJf\r\nNOIRzCAlyksPcI2mvo7MBX7qj0u64JYPmg0Uai9UJsLpMC4P57BrPeU3y096\r\nBqnAmBRtZiDWvitvNqZydXuOWOi/DG/VznGJdgp++s5me/9sZkgOUeCont7z\r\nmg2M+W1cDUq+CT9V+235ktKaU1BhWz0U68BjofflAcvcfm066ad2aoTcF/NG\r\nKWRuILRyOADHLMC0TrofoXaeUWjat0rBtmX8BYWkXKFUioWjqnDw+8ayfpTg\r\nNXhhXvLF/uCWwVYXB1NPlezmxs4hiKRR1buYeY6mnM4p3Chz+vCf4DsmrXl6\r\n8fNR97ySnNl6V6n/D3FwbZDb13RwqyQV9w4XVZx93T8VatdyGlxDL7n07WPq\r\naWOfaDdClXfTYgQQQZFdX3x2RZ5qTNYQG1/Yst/AWjk0LLT6sD8ayhbX9jJi\r\nRJlIayCfxlcfdGaQQNhQhZ8KMvSIK7gXj7A=\r\n=Gu6c\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"402fa1a293ee8169f7f9b158f75c8d669d8c6fbf","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.72"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.72_1648682399328_0.6416561396445679","host":"s3://npm-registry-packages"}},"2.46.73":{"name":"@apollosproject/data-connector-postgres","version":"2.46.73","_id":"@apollosproject/data-connector-postgres@2.46.73","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c6724de8a33580dca19aed644d2b3eae6c7aeb8c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.73.tgz","fileCount":348,"integrity":"sha512-9lJXTHvh6uFHzaTLZvRnGnie2hOPzTYJpbNUT4CChYKIJhTQlznbD4myhTu6AI5RAb+lnQa4sOBMd29cz7Lc4A==","signatures":[{"sig":"MEUCIBpQdlAtvoIDHaAa9hA1VnxohN+0K6dN+yFzFeXgBYqbAiEAkxwaQUDNtUtMJYw7V7d+6kYo/ME2BkpUNzKgUdFiz5A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1111513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROaCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoS1A//eFoXRIeDXCkvbZsnMPNi6Xi4QbqLRX8rGQfS9bDFNoUKAz2T\r\nc7Q0/agoM4Nskzi6/9AQADnQ8UbW0JJgCK2fYWUaxFEyyfYkCsDqzLNJjWIJ\r\n01RN8PAEwIYLDIAwWKOtz7Hj5p2VYtaNG3kDJyuOlJ5zv/gza9xzMLwqHtoV\r\nk+B+w79Lqouwt1WxXF5VoXep3FSmGgbQowMVyyYUUgwxx0hRoIPc9tjPZ+OT\r\ntXMHCY/A8jMXW2Z0nFpR2LTcenWy6eqiZmUlq0nhAnLME/pwkzFZFAj4w9X2\r\nszvPcg9RGtsoL2CXUMY7vLGzUu7fSVxwMkLy4sxJ6ryHQND4wx3FSyni9iud\r\nzGzxaLhn1rOLSRxITtE5OJDd21+nh/G+i/w4cFJd0cyO5DPZoFolIt4xIBse\r\n5MTo56tz87EJexSBkQQyefU/Bx/S8nlnBsz85pRmQPFaOLUOFvrAgti0KFoZ\r\nhnZ8Vh5diAFaMzU1xXGmHz6gHCiWN6WQHmmkoOEciR+LPLlppxRlcL8lyz6H\r\nNlztyVriFVUTvMpSS5+BYOgbVxa0dw7GBluM02Y5qIuV66iluqMuvSgFBRSP\r\nXPNpIfka/hoJrxQ5SXzGOIHhW3NqTIpp0OU6SME/rhwCG8Sn50ANGpXzoeQV\r\nGGOwizSMYTOIHpE1hLzauOgHoca1lLPHYsc=\r\n=xSDu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"63a0cd22d3615cc83fda57521f6bb735ea2cb1c1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.73"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.73_1648682625799_0.5749004058712017","host":"s3://npm-registry-packages"}},"2.46.74":{"name":"@apollosproject/data-connector-postgres","version":"2.46.74","_id":"@apollosproject/data-connector-postgres@2.46.74","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"df27a266bfe7bb518643e7bcf4cd23626426d21b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.74.tgz","fileCount":348,"integrity":"sha512-YhYe4MGpMC7gj+IQ7AuGGPLLBLmYV+sHC1BIv7yFoszHcR1yYkfEIJltthr8yCOGEzX3DmqzzWYLeSR84odqmw==","signatures":[{"sig":"MEUCIGchgxxd3TvNbKH9G96bwJ0Dvvt3MlKZoYUcwV3EEAesAiEA0UPY7LLBcQXupsqraxXQVJHqfQzh667W/ALbpZ5Opz8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1111702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROdPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVqQ/+NtntZ64QVrb8EGDkrpNgp7xq+m0+tmSK/8788zrXYgXhSpOL\r\nWumhoCiLlvyt9a/L6xfSooebCU0zsEIFD90BNrPVaNhtuIds35EtV3/Y0ls+\r\n+n6wz5ORvEDtxSS+lYZbBW6GPCWaFTU1EesC+0eOvmmUvAPxBirlbi+VjkCh\r\nyhLQS+fin+o+eByfeycC1nBYEksMM3yDjLz1xKqoWnqq+A+fFx+FB/AKVlV6\r\nst729GNGyHU/ZWE33wPulyYIt26ze2uVCWbiirXu6j+4cf2P2vMhyI00fe/K\r\nxocFgL3DLypIfRcby/M/ww8Scsq3gCr5IeWZAi8bgqEwM8cSzOnMdTTb4D/C\r\nXP3CqR0fNlbger/JRihaMysHzfWP2NT81sVBAHtoTJTNl7RaUsiJ9sGI7ViL\r\nn+BBaQoe5cl7ygLuCIvVEhxQYpnoTJDCvqUEpoWvrB1f4p3E79rKfSPHUYKQ\r\ncsrV+tJO6/llh4ZIzPAlNTcVgQdDVIK8umxZbA75r6gGV0DWJ+EIdTDrn49e\r\nYZfqaTXYusuFgl3tDtlh2rld4b7NgdFrvaPDIN2Vnzeb/rmRGqadTDUZbyP0\r\nZDs+fn5JAfQrOkiX67QsjTcGtN/ZFi6/pu1YIwHbfHKpfMNHu3/PuxE7moEa\r\nFVfJ48ToUmljYDf6nl3P1sjUe20aGCulDLM=\r\n=Uznx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0cdb1a8a5642eab53593b984a21237ee4dbbda04","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.74"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.74_1648682831753_0.7217738946424763","host":"s3://npm-registry-packages"}},"2.46.75":{"name":"@apollosproject/data-connector-postgres","version":"2.46.75","_id":"@apollosproject/data-connector-postgres@2.46.75","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"17a0e2abb46ff4e9a3d9b8595c28ab2d9203efae","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.75.tgz","fileCount":348,"integrity":"sha512-9c7EJLUk1i7GW2R2Z9SL9MdQjKtC8f9Fm6cnfglMWlLnvpS6NWg9qA/cT0MribbwOGberuE4U+vz79zsmuoLjQ==","signatures":[{"sig":"MEYCIQDEMU6Mnbwm15DhORoFZbIZX4c7irgxQ88Cnu4uzHgCQAIhAOSxD4/JaYFKRG9V8upkMzRRzzCdTBOpJETANK8hFKL0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1111891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROf3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDow//esqHLpyUDVvfbSwXCi2YW5Ocial4Uq/omFW++CzNG2XxP5Eu\r\ni3qDidAyKOaPX5Yw1S6PiDb5+alsDVY+p5Qm3OrtYKLhyOjx1vuOLi9D/MUg\r\n7f0xxJJNVF6cKY8enzcjTVrsHJsYl+f5bisQqlTMxHiUKODtovslE4QKI31b\r\n2SJNeUCnTZL/v6pE+UinKKYz5j0aw/mmLvk502UkmhBhO1aaAIY/fCR1c0KD\r\n2Rw2seLG1MHr30tSBaqXg3eSZxMqk5Uuooos5Xxz25Cz06AMwKMk8jqGIwiG\r\nEIUYFZbl7FV2WTn83bu3zznmiuqHUovMDUvVqaveVTw6DVZl3NxBFMIwu3XH\r\nDc1s9Yq4dXTxujpBAcVD+ULcFAE4CzbN2Rrky5Y4bzPrhj40qfy7MKi9r9zm\r\nnJG6EtrcTBq2A6AtCccEbzUz0DZdo/pkjcSNnhEztQqaZpvUFmQKAmM7c6Kf\r\nwr0gN6BzKzdFvoxRArJbER+JROrkKRIBKtC4Epc+Efb4pJShUg5dC3+CV3WX\r\nHXJ4K76f0CAlsWbgLG9SDczRciOTTnFcjkRgGQofsef+10nFVH4+BW673AKH\r\nPlZnCzG1KWYTtsHQfjyYpQbvFsU5yH98fpnQ1inl0t74NyC885ZDK6Kf1wV2\r\nNoBhDbX1F/GWShu31S5SYBhKxG68Gaw/yd0=\r\n=SNKx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c8d734662c96a919650f03988db510b36b0825b6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.75"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.75_1648682998070_0.06652443582426315","host":"s3://npm-registry-packages"}},"2.46.76":{"name":"@apollosproject/data-connector-postgres","version":"2.46.76","_id":"@apollosproject/data-connector-postgres@2.46.76","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4f1d543f6405b93db3e0dcce5b04304bc10b635f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.76.tgz","fileCount":348,"integrity":"sha512-95kVDAzuCg63iCOdmRvvGxn42icCxAIxjyfhmyNR3w/+TGlvx3iCxB9fNXb0B8KoDzZ5H8ykWqfPKsDj3jCsIA==","signatures":[{"sig":"MEYCIQDx5AdvM8qS3cr6nZzn9qXo3FaE/WoCxMNUGzWTQVoM2QIhALdg2QgN+AOigJNJzbNl6b64sqb6ELyMuwj1BkqU5gLX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1112080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROjiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpM6BAAnUKSA2Ipy0maXZbubEhTQ4WgF6qxgbo0xj+E07n/D93OImtV\r\nO+WKZW/A2eBPzPcAkxjqXH6/yanghUaPvBi9RzdIIr2Z0+pBzZC7jXAcFVbC\r\neCOPrY4JFuKUc6aPw2UVIfVAIGDZfNJoua7JSE8qpCB0+JixIDz3pq//dKhM\r\nOfyAkUKrHCu1Sb/e455EXTTG9G7Mz3SCIMY+GKURnHpViNmiEna8Y/87WL5+\r\nyn38iKoNjC1YIhkbbu6fSdPDRoe/9AvpiVoa9nD8rBP/ikTwm0g8eemNcz8g\r\n8K9J7YtRdlibR9ZFdNXTZOUcqUDQ4KQhZlN9zTaAt99y8bWUPIniOw9bKFqu\r\nnQ6GzOgUalhqoSaAG+W4fJs1vctO/B31ymb8vjkC3aiu5kyRW8X232TaqQBW\r\nTAVq6cuyiEXgtJhSjuZOkWIy7zGkRvelSf8rtq1AMnNfVJsjN6Bv71qGU7IH\r\nQjJOUH6YDulhs31CHxYJflPIRyIEG4W52qATnqGpDXqBBdCpRfMWW/oHj89d\r\np0WeAsc0mviFxNplownLL5nKbPfxl+ROMAMfBXDExZPC3Exnm5LEumJBVaNQ\r\n0VGz3ScKZDDzR2P8IZr+bhDt7l0nUc+HHdlVHCk8mSt1NibsL/ukOCqmoEw7\r\nJQKP2E0VZlE5TeTWPiB4vSrRoL9BF8sfybA=\r\n=R7ye\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"79f110ca99501290ce30bd97018d77ddff6c23c5","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.76"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.76_1648683234274_0.9218187873874499","host":"s3://npm-registry-packages"}},"2.46.77":{"name":"@apollosproject/data-connector-postgres","version":"2.46.77","_id":"@apollosproject/data-connector-postgres@2.46.77","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cf211933ba9715105f832109e7b95178c0a8a5f4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.77.tgz","fileCount":348,"integrity":"sha512-WVJ7q7YYjXrT+h5/LQuhBc7L3VNIWEUPJJC+wDKXNLB8iWi1UhQniBNq50NXyUeY4ssbnEaG0dPunPnZ042Ang==","signatures":[{"sig":"MEUCIQD4sOCygkB9RY8BFgrMfl+/tEChirk9W7SiCaO8cnVNxAIge1i8L6YObhbAJQAB5No8MLcWaUDxpoelJTbOJLYlKqI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1112269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROmfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2tRAAn+hjcn7aQSrHxmwC9PBZJMmOlKaQCf63p/OE+nmSrUNCeG7Q\r\n7a7pKCcvVIoDSEUrAnIYFgZTnn7dH0k2OrcJIjW7ubbQAY+Kf1qN1BuRaJnR\r\nMng0Z50iHsqlCgoVMwBE6vCknvSxc7zAKHv8RREDIITERHPdOy2bxTaU+PNl\r\nKGywkrbHzhO4ZulktZSCND7NIEHpNk55QGnY3QVhmkBBxt7JB4MHugIpzHor\r\n3GdhS18CnexilO+8Yqs865vDy7ENv9SDcZQXyMo3/nOwtin7DrbYuvbCpwkE\r\nEj4M7pa7UeBVho0i5yY24mt1PY6yBy3ldIKF5GOO2bFaZryVUgIqnON8jaZl\r\neFFmjT0Rv9QptGwZIY+8c+aZHm+u7xA2NI8/HEmJZYzWqPrnGN/WFuspy7Tj\r\nl1OgRaf6bUf0kqFO5nJ3UhpmJKodgyCBP+qLh0o27sfSrYwLqIoCwvc3YBeU\r\nPM7tUGCCSxqioSHV16Oyg5xfO5GrvwlOWXEWzyBQimfZrr9rfo0lOviaJzDG\r\nfEjR1duRSy/Zj8ldM0NlM1TYGzVSnnWxyONYXdD4Z0IMVulXsvmInZrBsaYb\r\nUEcsZv9DyJVlOEvLSsqim/oQz2I+RbNDKusroNNVfPE3ugknluZ4764UbtDS\r\ndfOhZOh9L4SjxL2wJss5nWMSjbkk1MiTpqs=\r\n=ImUR\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"274814d9cbc01fd32daae9ccbdd2cc3484a35f49","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.77"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.77_1648683422994_0.1140645932152522","host":"s3://npm-registry-packages"}},"2.46.78":{"name":"@apollosproject/data-connector-postgres","version":"2.46.78","_id":"@apollosproject/data-connector-postgres@2.46.78","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"99fe1ad2592f0135805f31810c1af59c6629a5ba","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.78.tgz","fileCount":348,"integrity":"sha512-RldXgoR+alneHTmZGKe+JG2oZqMCxcsNafEsonbOM8a2IqK3Cz6OefkpMFEyGTfafR3xcepmQuZnYrhdrysQ/g==","signatures":[{"sig":"MEYCIQCvdPd1XccbnWJOG5DHwFrTzn91Rb2nrIrFox2epRZTkQIhAJlQcOP2oUCIlrSz3Gy0tF0HgmpZavtzNpXR4YbH6i1j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1112458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROo9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVyxAAi/NIHZR7xiTz6RAd582tp14AD9VjDMDh4iDuD3QHzf2y4bcJ\r\nKURkCo+8nrKo0Tt6k3OPTQOy0nMgN750syc+LktC5+8eV+tVdmTQgwXDW4pH\r\nee+ljaKBEkQzECEFXRYaG+jYxw6gA5rCCvvLiQoKcNQ5oiaoBXgSZiVTkpTs\r\n0IPimPLmjiPKFdQEUQzzwMX0db3QtiIUlA0LAfblLILljukJ8fW7bQWR+XXR\r\nWRIQInY2nQXl9l5jmuCUvlqINbQw1XFkJFUKnR6v1Zi6kgaf1NCc3yyk84mJ\r\nZdLs7PlKCdE55Eg/SX1qHLKTLkhLU60ryeRCPLbZmbsaTxeoTuE5FH+aw2Pr\r\ncUZwlujgIPe/BKUDbE2ad/wd8eqbVzGKFRhUBvj1ocuPwvw/UbDUkso8IXA5\r\nmVtBmJmtX2tuptzQHZBFsTGhKeRnHfRaAeGkC0Sc0LGpUwyKcg08Qpy1d5j3\r\n3bdLvfxagei9TY5RR0QLCoDJnkd1dB6MKWlJ6YSCjQgvQFSRDSU+0OO0xC5P\r\nkOT6DnxoMgpWr3PIJ089Dq9mxN0/YSjFE8+08GunYKsHUYqQRSMFxay5PjGc\r\nOwkWwfBZtjJFSV86HMEE7eNKudO/3MsOIVF/hIFOw5vmawTZ+t13N3VgiwNw\r\n9bOQ774vmCuvcVyzlXSQsfN5uEnnHXoZqNk=\r\n=GUWT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"58727343df5034232bc9d11ba4877e472e2c8608","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.78"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.78_1648683580829_0.4525900004283179","host":"s3://npm-registry-packages"}},"2.46.79":{"name":"@apollosproject/data-connector-postgres","version":"2.46.79","_id":"@apollosproject/data-connector-postgres@2.46.79","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"323061ad347dcd2bf9246fabca9c03db07951960","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.79.tgz","fileCount":348,"integrity":"sha512-w5GHifdrw7Knjgbq3/QTZeyUr6IlJPbOU0jIKtLYKBBTqX1x9IZe9p/zMv3s4kMTvjhZLk27BInnJlsuiGxkww==","signatures":[{"sig":"MEUCIDedzTuReKMyvHQxVxdA2NsDWKa1ADHUhAxWZUTeec6YAiEArWrx38NC0iqMYuPfwiceIeMlBcotgNJK6MMRP4mHRPc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1112647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROrxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeMQ/+LgCfGWaXCbG24FJyLcwUAKaRKPlu2EbJGbaqaKikcKOItgL7\r\nwRptLNagVTuSZG7qBnAltxclEzPuDWjIniKwtXnCNi86ozW6iHsFzhfNmu7V\r\nLawcLqA8EHcACN/Ilm8nm727KWyvMPJYIQVEzel+x6P8JQNj59+TkBuyk6w8\r\nj7QM4ie7oewlgFCIeCKQYMgVZ20ziAttXHxjyOb7V1px4Gzn4HMetSo7Iytc\r\ntR4FhIc1V4K7/TUhEnKHzwMi1bvD+m4tZEgx3uokKGF8hbz27hdHXNJ6BLwT\r\n0droFmpFp+CIulgvpWlboBMDvgVjrsuYOf8ZbLyRdXTRYmVZ1a+0fUZQloPi\r\n4+XdWMg0mXTypbrBI81hfCBCEaPQGuJUae4pC+KWegF3adXGgv/kKdkGOCfS\r\nSxdM0QDYvmarngmNV3YfPoQBxD72bfnkdJ4rg3aaqNd7LcS0ybTUB6VCHWSc\r\ni61xnFYkINVbebHj6ROKs0Xgxa6sDTuJalXCSMwgZJ2+KLyrV5WNmQ7xM8Jc\r\nrSShdlhjd7OD6RqXieGkc906k/BPE9I2i9Vx1aSFxPWRg6d/trPjt2UWxv7i\r\nxBh9l0+ppsNGv6jC2XcX/80a9PILb2MBF9DDj4vn8iv8Uv8WvW1/j1iRmTsg\r\nLhBKUOc2A0vzlx6wWPStZX70Nn+MQuFyz3I=\r\n=KC7y\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d82ec90f6f2ead46895676508a0cfaaee7843147","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.79"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.79_1648683761512_0.7743430731449903","host":"s3://npm-registry-packages"}},"2.46.80":{"name":"@apollosproject/data-connector-postgres","version":"2.46.80","_id":"@apollosproject/data-connector-postgres@2.46.80","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7b47e4899bf528dd8e07450034d02c0ab39b005e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.80.tgz","fileCount":348,"integrity":"sha512-APbaXGbTDlsxWtikSg0YFhzDgyRN8cBB9WLsXtqoQEiahv4Ojw8IdWdqiBQGvlIRliyXU4XSITalhxbPR0mGRA==","signatures":[{"sig":"MEUCIQDGB5VhuOETFZgYV8YtV3s4+IqqxhkArTHQNJCdGMcCeAIgBij84Pl08SLN6dTRjfV5a//0z1qFDN8IyEssQfNsFUI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1112836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROvdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxPw/+Ohl7h2eFNYZbvig7ynryhYNbzu96YZ6RFHACyA3ciu4Xfcxz\r\nTKyqYuFh8CHNXtRSTY8TyQny3/ZdIQJgc1d1CbyXvZrC20trCZHSEzhBbth9\r\nnkpFy1lR1/HXP8AQhjMGSU0T0rh+rOdW4vaaYniu6gKJGaSXxV7OYmUoQlHL\r\npa6LhukWqdD+xXpHiaaAGufWo0eNRo2h7cMzdibR1TlygKHFRAJm3boZi+X9\r\niUvQ/L8sx2UvMEHqOtp/o96irlxpKHRc0gZmZCPM4QoXQABa7FNqBABR6H2q\r\nQ8e3a0VEYKC3+nXncmYxhx2wRmL++fhm/O+AsaxBKqquZDhr2lxfRKrnSucw\r\nOSoWeIIDopFh8ekFDDGKH416eBDRkuppWbiKuWLnVfbkn1FLa0AxGzF/hV1x\r\nc42VxuxD2TFdgAmhXoU6o0uLAmmPwLQy7XnCUwEDlalCqxgQeJtzIzhbxHaU\r\nlLGT46sTHuG2aWzx4lMJghmILJHmYa5ocPJxR63+0DHwtZ+I0n7TStoyhP9J\r\ntWbBd/E8cGY8yG34GBTjRb482vQ/5Tm/UaeiJl/kkd0L6FdCZEFNU/Z9MSMX\r\nr9XaH/Xk+jzVUJBTyZIxBaMHdp/mTuwEDaQ1cBqZ9nXVuE8OI2ESqVbVCP5K\r\nh/hTVFs2yjoTR9wh8ZaP/jK4fzOHBX17GJY=\r\n=MCzI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"80c23f6f44bf0120b5c526627fbd51626c7148e0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.80"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.80_1648683996947_0.19056443433983783","host":"s3://npm-registry-packages"}},"2.46.81":{"name":"@apollosproject/data-connector-postgres","version":"2.46.81","_id":"@apollosproject/data-connector-postgres@2.46.81","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dd18c4582af8d2242c5c06406dbd8d072ebc8fb1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.81.tgz","fileCount":348,"integrity":"sha512-Cq1mOZXXU4zVTB6mocjjGXcrbp+HqCFGzikcBbYO/Z6zDOiyfMaLiZsoDebU6GmuJUgAqkf/K+BY4Yq8eNYoXg==","signatures":[{"sig":"MEQCIC0sv6Pa4NBbJ8M8KZFPwCYSbV6HVVIGcL1FVceKdFK6AiBDBjK5/LDSb9g2pFA02El/9WFqb1iw3vFEKTEtwXE/MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1113025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiROzAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCuA//d/0v7b+oRFeNtt3hYk4epy4QoYWa3MjEs5uFkbA1oJ8xSIGH\r\nQVpST6/AXr0vOgL+fmaiM7rcduR5bJlUuEWwmohvRwLPF8dmJzvMgxZerCTn\r\nx+j4G8jsWc5CI4si64EZWbWYbK8bepNo3CyD0cZxACIRRPsyvCEjvOpRgcxj\r\npZ8kdgPlq97GRmfO2UD3fMpBxD8zslKnZb3TC/dX4CvZW9+nvcQCtXyPOh50\r\n0OJvEta3KxTEtUVJEH5PSWtDmx1rv0+Rv7In61w8gGAUDkFC0Zb0H4/Aoi2H\r\nTASQfdWqIVg5GHM8rkdw6WELx3izt6unOgMRCzfTCjKaPwtrb0J3345zd2hZ\r\nBmcx5CY+Uhuz2VRBa2hr7vmzUlRCsHV1prpg2slVXdAb/wLUy2i24V7nEuIK\r\nyM0hPhKuNEk1jYLxeyyuwbPXd9CicWLntlqWDr7N1MZmNzkBFw1C4wufl3e/\r\npLnrkN8D+VYPoN+PonXFBhoXiYPRQiFQ8Nm3qoA4TJbmHQWv7C1N1RnzUpvi\r\nbtBHeGD95JN2fdrxy3cw6AQUiwsqV1fVLKGgxMo2+WoBGqJGc3thH7m4A3h6\r\nLibNUutEHsg2koZ3/TNLqCdRBnUv/KLvNI6Tt2P8nQro1AO2wyHnrrMKn1FA\r\nAGPy6WY9xBR9co/V0IyB37MigHw23KPW8A8=\r\n=wdvH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c6b3ed4f0c6f42f509f4995fa1515c232671c2e9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.81"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.81_1648684224219_0.7469601547572262","host":"s3://npm-registry-packages"}},"2.46.82":{"name":"@apollosproject/data-connector-postgres","version":"2.46.82","_id":"@apollosproject/data-connector-postgres@2.46.82","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"407cb4b14d37366fa7359d3917bd4f60f799018a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.82.tgz","fileCount":348,"integrity":"sha512-//pb/cCJrQXruZWB76ml/x3MVc549EcW9hV94Z8e1t7jzs2h4vopEWZBbc12WjVgOUNwmzvyHWDSPl+83W/8xQ==","signatures":[{"sig":"MEQCIFCj/Kj0i8R7lVdbJQMtXsZDlixOxlPwN5m/20wmf16rAiACxjrZRLD9EPo3hYd6JVqRA94W1LQRTXwaq5MTmGmKbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1113214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRO2XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEeg/+OXpfQRMazencWqjGaPipNnGba8dn3zAEK+kEAZVkLLqfuxDc\r\nNMxiTGn/ilOid6SSrG64NnXnjfteJV4HoAafwJ9AbWEKohyZ5yQGPl045aIy\r\n2koqJk1y2T4+upP1iZwAHm5FNSQwLP+eWYabGCk5xAfNsY8P/k656LzryFkn\r\n4F9wq9EgKP3ceQVLqmG9QUxsECc0zTsPdftglH0DMCAMRtQLcod/aBF9QuoG\r\nTWaaf6BzYiiNujgScWj6ri001s8IMmupdspcgMlrjxDhYpCYVGVEC/U5zOfc\r\n+IRQAk1C1wO963XGp7Rh2BZSFD7xLghYB4Lc36z0rBVg3ZRHLTQbJ4AYw7+Z\r\nFkwGE+ZPrZspRLitxPkJt9QK384Xkju7m+Vg1N1oY6feZsOvgWxrfX/hFIHP\r\nfwOLJqACRpVejIW0uKSnQkoxeZt0kYeS2g2rzxqorBTdoK1/mD6IwtTV5JWy\r\nF33GWeQIQoDuVEk77qLHHEEbA4KZffbrJpO1/cb4wGWBUafk8v7UAchZizZk\r\nET6kLqzIeIw7dYVXsZQ7YcspWVyMkZTu3F5QZeox2vdpu+Ya+ckNogdD9B2p\r\nM2wouf6fTcZphSf96U3Ym8R1aE5qndF1K1xPDngyZ9rO2hREqCAviMTDKdLq\r\nMJsRIb6r00CFIdINijdr0AacEnutiOZtXqM=\r\n=Apzj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d832670e217cebe0f5a881976cd729ca06ee76ef","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.82"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.82_1648684439040_0.10171154431284068","host":"s3://npm-registry-packages"}},"2.46.83":{"name":"@apollosproject/data-connector-postgres","version":"2.46.83","_id":"@apollosproject/data-connector-postgres@2.46.83","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"17606fb79fe73df45c4cb35586f9903451c2276a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.83.tgz","fileCount":348,"integrity":"sha512-PO4aVMDQf1tpz5wcBn2xOLNIVBw3MZXv9p87wS/s98GIrawP013rotQMmjSvMArBEt5ZkVKqH7zdulnSadaZgg==","signatures":[{"sig":"MEQCIG3XdlK/OOn7/qKVMqJhr0Ev+yTMfRw8S7g0+R3g3hYXAiBx4qqNPgYrFa/yBdxI2HZiXAMZR+ITQJOlgS+kPmFJMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1113403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRO5UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppqBAAoT812I8lHBQJZATXlbUiXK9Dcy4T3G3GHUOncHSlQG80f/iL\r\nO94fy05NEpP5hNAPQWr8eam/CBa7+zE1k9XC4yNwW3KIlxzFRlvuwvMqnlkr\r\nR7oJFqD6o/48rBvEHe/WJwmiJUyNV6tKIB1pIDUTxGhIBW63ZUTKTXAIX7Vl\r\nTWYTZ8OZre/n3HGtrLm+Eah2iRbutDTiwoL6t3eUaTUga/geqMy8VMgOo3j2\r\n4tzYTDz4vMA/fxvDa0OK7ofPfvl/KWGpaoUrYi8QYDRRk37t5wYkG0p0VAUr\r\nu8sxxzR2c2lt5BPhDvWhBJP5fzL6MkYlGsjr7gdeI3emxQ1LgvmClbzvyj4Q\r\nly2zlBFjBU97+/67ywqiq0FeQNRGZu8MC106iKbCLqhUPHwj9nL09qOEPNvH\r\n6CcFGjKUVAG0/sTyG+r2u+7tl8Rk1eY1oMwp2w2YFTi1Mh8yMJuEpYRAC55X\r\nxUjRXO9DE1e9fZ3u4/jTyBgH6AKotIrbHsdopNW9UvRJtE0oYLVzJFS8Evk0\r\nChmu6LW5Q9PJCza4osfxQ6eyRSVCRgYbWnlyuGoIdXsGq8t+RmT3ths672xo\r\nwXsJ0qGDnTtrgUw7FF4wkCyaAWf6HYpZsdfK3iLJx5JcvckV90oLP2IpxZuO\r\n6jitxGqifo0tdpXGK5H0Hr5e3JfkyDGZnQc=\r\n=D39I\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f8762d4682079974d170b34902068f5c0ca3e574","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.83"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.83_1648684627785_0.2165545319965516","host":"s3://npm-registry-packages"}},"2.46.84":{"name":"@apollosproject/data-connector-postgres","version":"2.46.84","_id":"@apollosproject/data-connector-postgres@2.46.84","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"260420e2c6bcd46038e157b18e0703b1a4b1a693","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.84.tgz","fileCount":348,"integrity":"sha512-fFbENVogjtz0Uss0Waf/4+XUzEykCmDeSTbd/FoC2vHBfMrKN2c72637BJ7k3pfnVpil4Pa/C+DntavnP1QOug==","signatures":[{"sig":"MEUCIQDgGIwc193RyuKYu71TZ4ybHloFWD7wBKYQ0Cnv7S69WQIgdLPMo8NKB8F8XxNkYwjHhwMEkyS68I4/1qewE03VdoY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1113592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRO7uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriTA/7BywoThctoqdtnNIreg9F6MtkCHTzDvoixK3yRHhEpbd0MG3u\r\n4hVEtwtchbmsi3/Uj/erzixzwKvoN83+8Fu1DqYJE3QAFMxwU2PAzon6BLGj\r\nnsnKCLAXVx1TIpxfTGLt88Ywi/ljTQGdreaMxxxuRkL/S3BDFOif7CCAeupF\r\nuzYMotOWP8wvHGOjCmtdGjgTza2PlcrWym0Qf4SAEkeMWwbhfGjsXV9ubYhf\r\nStvpD/RbN2G3Ac33J7rHC1PLYvvongiSJ+zNF2Tr8bI4eLSAv3onNhODQKRc\r\nLZLpK8RemxtSemd7L/5IAGnUHk07acgYHWZZebFvGmto5Sndk9ZEcU5m82g8\r\nH8qoI0oe80dQz4n2bfv881EH6pKRNGuCn8i0YbPmBwnOGPQAV7iJ48UUxoLv\r\nGefoL9rsquep+7rLztbA9q/Q4Dz3l1LLeJCezmOdCPC4AMgU4UQABqxQMMBk\r\nH6+qCDbMlhFnkeK0sPA8uARTIEHJrYuIJJMwj4V2kcZzrbnDPz9nIYUPRATD\r\nlI4UAcbvdthbz7PzXyZWENU9oQz9wvW0ouE/zvhN11y1LJG77NYbnBnmynp4\r\nExHy91pUXm5rq99mxfttHEBj3f4S8AFg2hkFWgWGgxW8qrB/OYCcyWq5SPkj\r\nMjaExNMV/9W36Ll3YqXQBlM6Zx9m0plfwa8=\r\n=/Upn\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6fdeb4cf4cfb09bc57a26f370e27ba1b07053ae3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.84"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.84_1648684782134_0.6538788284658867","host":"s3://npm-registry-packages"}},"2.46.85":{"name":"@apollosproject/data-connector-postgres","version":"2.46.85","_id":"@apollosproject/data-connector-postgres@2.46.85","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6a996af21488149348d3ca0fe3f09125bedc1ab0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.85.tgz","fileCount":348,"integrity":"sha512-ChsdQKRneBcDAjRoIXBC9C6lsGzbx17aWYEYVRQpIpfwGeTNVN9Nu+PEJf2J/PO2iFn7r6fCRTvZ0NPga0pBzw==","signatures":[{"sig":"MEUCIQCZrZQ829nF6BBQJbASasGeVlYyBwE9IVzWsAOB3iHmhwIgX6ufFd9m4xFngvSWU2Mfl/c78qO9+jKMTxjEC849CPU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1113781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRO/SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUEw//bvzC4t8klzkSLgCg0tAPDRdeXoFo20YISqwb94fHS+9PCj/3\r\nSY8L0oOc3m9hWzdARK7i23jX44St7WB6/I0iuIp5HExZfePWacFHI6dH+4lV\r\nRKoEkXbUYMoJ7PH+zWa4DL2qM59R3eygOY45iJZwYLVsOS0dn70D7lTH4BXP\r\nNyahrNMtyi8YtSxeSSdh62U34R2EYlys8zPzdfs3uNMeD3VGVandF+uc240K\r\nL2U0pnNE+imUpqRyzTFtqmTxMXLIyoDRmj3XaS42QwjJORRXtTsV/WYWyUdP\r\nidN4ojC0UjhtndOe2gs7PvF721A1r+QFXcf+i6B2H3PNRiiLPDSCzaBjvqiR\r\nu1dKx3p6D4JG06ufY7NMr46vlU2zw7vYU1AgLNofjS6+cuWzzxurOBbvDtXW\r\naqLdV50NnBdru9tfscHLo8e58MWt+zYPl+VJHvWE6AtfyHpntXb+oQ39h8WK\r\nCoycUZjDW3hgGp1lr6OqMLbhMxVzykb6gv6lnCy/PYiznj2oSN/1aneZmvSQ\r\nxniXwdD9t5WWPC8jITR9d+1pH6bqfnUACD/ywJUewHPAf6F+kIYN2mxhoRnV\r\nTJE9mVazO8GtMBObeQThNjIRiZBKFW0rh7LnWXwHJ2gprL7nP0K0ZePSjmDI\r\nON27OQbnT9L47uK4ME/i3Z+mXb+yXb4yip4=\r\n=hv7l\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c1e07b33645d88f776eb3b6d9e272a4e952a487b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.85"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.85_1648685009960_0.9161643494828655","host":"s3://npm-registry-packages"}},"2.46.86":{"name":"@apollosproject/data-connector-postgres","version":"2.46.86","_id":"@apollosproject/data-connector-postgres@2.46.86","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f4fd3590e843366225af108244c87b33913bbe73","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.86.tgz","fileCount":348,"integrity":"sha512-uZdPUWZVOW6G9LFA8FsrjYyaYj+NS56Cd6Yasywh6po49dtI34Uah+xUS9lYTNqndCjSgwCJyGuCl14lVzYVsQ==","signatures":[{"sig":"MEUCIQDgYc0JtrW+wg3rH1PTFkBBPsUeotPXLe8cdbD6VCF1kwIgeiq8L5uwS3/wOuplWDhaBcOng7smw1SmUV/28bE4SJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1113970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPBrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsHw//TAeX5+7eOXOGDZd9g+bx7yO7yYGJy4F7ZLVNzO1jOyeORVSM\r\nFIN38LRZ3PVjKdqMYBkxfm4QOorg23kC1kPiHhjUaeNe9+6nf4wlyDBp4XTt\r\n+2FzFDaVr/PFbqwR55QNxUhPzyDsKaZ3xhSfQ/W4ffPNk6F16VvZBWIp728K\r\nG5QvMxmUcH0NFPTlUpbeK7r0qVsmMBJ76MoBhSlNVYGE96OsQy8l9HMJLlNp\r\nRMtryNQx9sMJ62PpMMU1mZrBuWwko9lSBcKZF1ZbXpy17lkQre8vfkIUH0Iu\r\nIct/3oEuNtXQRncuw0dIKaxbl+tZWRIFYUlERcEpoSADX10YBNy3t2f79QG8\r\n99ZXFCwL4o7SHrNAiqSWa/IiMKxeZ7bmneKBz6Z1kTy5kYCP2Qcb8aGd2SkI\r\nIAgkLVMJhiH1F+Fx8ljNC/HGCgEWHJMfxBKpGNvgmUJJ0maRfNHPW3DGpSdE\r\nB+ALhqDYtAocyJDAfMQimuvVadXnkFUvWA3zj9jFTI+OvyEr112nA2WiAh2g\r\nljcx1+Hnkm0Zhi0la1jd0yPHhP6aS0da/Ywa7Nx8n/6J7X8/GeV5Y4H/Yt5g\r\nLdC+GmSJhBOrF8LGRCEhrpP+HGtOFmra6sCfaMlBGSdwBRJUmRedwhA5qA7G\r\nz6iHubtQIi3RU890GSNotcor47mv/vmfbEU=\r\n=PqxH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c9ef94015b9e3b77cb139f33638dc97c7a25cf74","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.86"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.86_1648685163281_0.7526413909585572","host":"s3://npm-registry-packages"}},"2.46.87":{"name":"@apollosproject/data-connector-postgres","version":"2.46.87","_id":"@apollosproject/data-connector-postgres@2.46.87","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0006953f3d31fa3c1ac813dbb9656bde334dbf01","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.87.tgz","fileCount":348,"integrity":"sha512-+1lUaln1ob2MO4u98nCNLrSPfpoN06XM1nLE8cd6qTt2myqF86BvivVF17pMNI8tQmru2DriGvkQogOFL/71fw==","signatures":[{"sig":"MEUCIQCebGEDgHD1JXLym0f9I4uVHMhc9tIPw911KIGGXOOrtwIgXK1tWn+MOupXQOFOWhFeg7tw31qlK5w/3Nn3eNFR+co=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1114159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPFpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpw2A/8CP5CYNsDDXOglleffyg3jtAzHyMZmVePNZiRuXmiZaInKQKz\r\n8EUeh61c7gZ3BL/t5Ozoh+J/FgcgMiA3gi+Ri45OIo1v1pVExinxHPSbLIYE\r\nh3q83PBD/t425y58aMN0RByuuPyxfd41cc9lV2iRWOf/8CNB0+j+OHFcVOa1\r\nt2kLu8mh3dzQRyk30EJ2eq14E7ERPsdfcE4/dHJbjFj/CskYqBvR7qSItVpJ\r\niMun2wxvMSebnJ1pGgZUdZsUxQqH3sU4QfbJRs84q+1miPCW7IuIN4V00TVs\r\nnv/JBl3/djiHnWm9nBwcvZ/uwf8ywbps8bJgWgwD601cr7692nlhl27ivHSx\r\nsIdZTC5BhAl36AM6Dn9IybGVZkwzqOzxQS5C+bw/Uvq8qxt7IMTAEQtAyf7a\r\n1E2LBr4xLKAsSf3lrVKhP2FwiMjGNvhJLEV0Uh0y/yww0zv6gfsoY+FXMUfy\r\n77HsLCNZd60y4f7UB0tFYzv9v5Tvs8m0V0Wxq6ySzC/zNBoznUu9Pnfk1JoV\r\nZSbqc12A0QKp76f0JFV/yWsAlB7NW/X1qmSwao8fMNMwkgJY/hfOuze1Fpnm\r\nCANlcgaq+RRHQo59BUcVyBUOFITULPMD87PmIXFKHnssCdKNV2kBT9ggLIWC\r\n88G3J4W8p9jO5h6WCITAcuDG9HuJj8YCJZA=\r\n=T4IS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ec45f8559f1e4b86c45b15955d031baf64e92a7c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.87"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.87_1648685417638_0.6935084096655804","host":"s3://npm-registry-packages"}},"2.46.88":{"name":"@apollosproject/data-connector-postgres","version":"2.46.88","_id":"@apollosproject/data-connector-postgres@2.46.88","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"77f05386721ec5c329e617c594a64a64cf340d56","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.88.tgz","fileCount":348,"integrity":"sha512-zUbjkzEiohWi+u37xCw0dYWNpefyKpWH4DSRqebQ2103DaU8pPzfMOyAWQZDJaAMUUowKnMm4xc+p64dz5Qy7w==","signatures":[{"sig":"MEUCIQCBmDFgp/WMhKybleY7qncVFYHNIUx+9iwqpa39MkRqhwIgCHS7yJFV8FWE2wL0pjIr2a91vbnB1sIO1+peKSAAw6o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1114348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPJJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZsQ/+KkmBblfUueAe2maq+KcfjWw4XvKZWEkHvCvNjjWnLLZkjM6w\r\n7GkyO0EqAcrq0Lj8VaJrQNbahz0suQkhV/ef+x9mlkVptzDRYvltqhQ2M63E\r\nazcjvBgUoZD3vvs9pgrsN+Oz5v6NWfTJ8sQo4FDD4cRsqxbVL0wAFNlAroWj\r\nEeUBdzRduBan6ViHh4ZCmb7Z3MbuUrpr0SRtomHO02aw2NZSt58dqx6STqf/\r\nVDmgH7NtK8AwrO4ZuUMyq0gBPN5rLcMxaUWUEJsI4g6G/ng0sBqyHdMG1lXv\r\nC57rpOHKuOki+i6XwkyCAiKiK3C0XCHn8fixZP7R9DKGFNyAx/M3cYC4+opu\r\nb+1kGg7baSNKmEbVVKMsqDHyBcr1GyT7S+t6Sc/jHvbie4FuBT0SuqyLMJan\r\nQDJmaulmPDoNaazQfKeluzXaDYR4MAsnQGvX3TwL3BZrbzVgWoAwaTa+4X0s\r\nMcwtwPThylsG1HgmQNdnzy7tyCCUfPaPifD1Xaq/7mx3ArCZYGeL+kt4b94s\r\n9b1jU59Lq0mEK9uNuwuc5xD8qNzOHTnQJec45yt0V8LftYGPX2RLHSw95v7v\r\n2RcI0kiFxwsXVtLWmSm6iBKD3SDmyg7uwp77veVhTYXSnZV1cOF3zuNUDUrC\r\n/c+xAPBufOyf01pbwLhz8Iwa5O1bSTwTagg=\r\n=SwA0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0f18ead3d3541c288630e10deece6d6b5827c8b1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.88"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.88_1648685641235_0.16077566297558898","host":"s3://npm-registry-packages"}},"2.46.89":{"name":"@apollosproject/data-connector-postgres","version":"2.46.89","_id":"@apollosproject/data-connector-postgres@2.46.89","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5e94ab62f4d6a1e832f446d6cad018f7ffd0f128","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.89.tgz","fileCount":348,"integrity":"sha512-sW9JhIB8dD/FMj9Ou7YyMWRIpmZw8dfCE5f+CBJYV7q4t4lBDMyT8qwElV5ze19q2WzO15VgEIYbLTho3lDIwg==","signatures":[{"sig":"MEQCIB/7XHVrCfdqEm8qHJ3PJtLeRd8Y6kIV8vFQ5cRHrzTNAiAEB2tSPbejYwkKA6AHUH9sG3kUKCIHTZRrzVIiizuwSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1114537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPMaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4NA/8CBFAOD9Uz0ytLWVzpgnO/MKT+Q7tDaRc6mvwsAZtEF2CHkHH\r\nfN3IWJmlwUumXQ4bQIxtDiG/Gi3mfFePOX+oMuZR54ohOlT/LTWBomEWe7nu\r\n6m4Al28eNipz1Cdf6SPWLH91epZifV2F8EiZrqFj74FY/2+1E1Wi36/2qxNJ\r\nIvQGGvBRBZTGVSKQ7rzrwXdouLC8XiGELE0ROOd1cmba5etqPiJxNwMi8WbE\r\nMuixN0vfdDLSDQ18cWfYWtyg47LMiq2BFc79Yd73bpiGyJtgn3S2daYvaZVu\r\nLjN7Oq1gQqrepIGa1g5oCpBARDOGUx8BzKA7paASVb0jIf1UgSn7GkMIteUw\r\nZiTrN/Yniy0wBVbhxkrbO+2hrwrHsyVvWB0uaiJNQQqyhYOF9PJo07o6bn1s\r\n5svQc8DEIEt5wtx7gaBwxM8jMsO6dUJlZdojIHdrjTxhIGCWIDEKnhZpO1jG\r\nVEWRRoq1509pemBplnpYLAWvsDa5B/zqxiYeyjimko2diIfygMhM97gE+tT5\r\nWpS6Jnofs8OklFZDIGSlv59IfwJHxGq4mmfePRRsz1qUsU010bWeNtUPUqA9\r\nshmhll/APzCZB6/rlRxtBTulnqeF/iuGxPkXv52xYx+v1CDs4o7D3Gph9qxk\r\nb0Tb3rr05CeqxnLDaz52tR5RlDV4RmydwjM=\r\n=1VY/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8b56fc0d8ef506867467465a69eb959a5ce7462b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.89"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.89_1648685849949_0.1432294494553843","host":"s3://npm-registry-packages"}},"2.46.90":{"name":"@apollosproject/data-connector-postgres","version":"2.46.90","_id":"@apollosproject/data-connector-postgres@2.46.90","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d347c054304f50360132640928b6de31a66d34db","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.90.tgz","fileCount":348,"integrity":"sha512-GmmSOztXxXmb8WnSmNjU3V6BcxBarutgSKtsotaJen7SKQU7Y5iaorlYow+fB+u/mmF9hlGANWO3TwA8jw+onQ==","signatures":[{"sig":"MEQCIAohoGbZRWBOWz3yKVKo0OFGvwpRINY1BMBZmGBE6+v7AiB4veT9bbb87IDdYGClUy8xJumWgcvSEBeB7adWVUVXKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1114726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPQQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGhg/7BxlHOiFdwt5NkTtnbSq+pq66YGdIaO7QNW3mOuaP/ladExyZ\r\n5ChFkoeqxw1rFzAtbyOq5+ZRG+a9VSeNZdSi2pWFbYLBQPZ0fxDf2ZoXVuxG\r\nA/BuEyeiZ3y6mQ41QzO2AIiegNoRG7o+qRLRm4mE5kULbMum1C4bG2fFw3y6\r\ngNfEEIMm2IkUteKp/M9dP4BmVBgvJQ1/vTXMjvLfjOVRR/frUo5ZVAhrZ4+i\r\nHq9MmO3+mtVNFCqfmDkw5kqpWV9HFXWcel9m6MUCzB5/vNuktd9c6C4e6ugb\r\ncVZ45gMgGk49/3ED/FKg3O7EN5IjhXQDMfUlGguxeh0wkYAQ4eN3aWt55x4x\r\nC+D3ivxr9bnmKhmlB1gpN9waPfC4lIDZhBuU2yLZgRs+XJxs4l8zkOyIo61U\r\n95CJ+2el25/entaw+9n7dwZbGyFJJbJGXSahSNXSZEEnnoUDE9QgWE9Cqmmq\r\nfPKZJhVjy8dewCJNnRyWpgftRylHRqVNLWJVkpO16WEUQZLo0UCcyj/2snG9\r\njmE1qmr5McZD2d0qlBHEpbpOUIp1ELQqnK/ggOhm/rWZ2/jpizpc88CglxXg\r\noOx4uCFE/f+mnZPi+Kh8cQZXNe/9uJYIWzpF4kc4R5klLGW050fBIGwItrlQ\r\nG6CrOv3SS7lPRM3tA41jlvnMjDnVIF8nQE0=\r\n=Yvel\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"07a077fe623c177c8d35acc24d474e8a93151511","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.90"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.90_1648686096588_0.32733436181078024","host":"s3://npm-registry-packages"}},"2.46.91":{"name":"@apollosproject/data-connector-postgres","version":"2.46.91","_id":"@apollosproject/data-connector-postgres@2.46.91","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5011ea32adfea4a87be9ce37131d7ccedfbefe22","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.91.tgz","fileCount":348,"integrity":"sha512-Dy3Rz8lYZTnykVZT/flQxifirES3PV/Ejx2qOrWl7az7tNFLRPGPKLhvST2vAhYy77UX8TOXyv7pJoFgWHdWoQ==","signatures":[{"sig":"MEQCIELe5rzt0VeG9iJ3StbmjHLtFGNel/ES9iSXQkpuRnWLAiBR1VhnlEWnbwt5CQXcNnrT1dedeWkdfyfDoByibBktLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1114915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPT4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8FQ//Quji1jKD8knrgHlEognv2X1GN8kfCrnc5R2xUXT432zY+Hkq\r\nII0PcTDxjPJ8zCJpC+OfZwrALixMkXRmHoStG6oas7hTvEIZ4OIzF/GlEHHm\r\nnutCp+3XHmtq+i5N4rdlBmAjRPc3sltkr7QhJ5/7xTv2QAuK0IVgmnV0PwEF\r\nQETxPG2qvYrDo8N+DkmvoTaXFd0XUpxg4/0lOPzaW6FWkLvkKuJCbpoA+FWB\r\nRa7zKDxB1kC7bxISgZ4WG2Ezx02SNutFzOjKONPLIQ0I6STONiPQ8OmaV6FX\r\ntsoLtgAtZERjAQs7NLEgEGAr6r/+lUAhG/IYD0r4npbZVhg6y69NHE8p065s\r\nKIrtE8jKkhfLjLrUFFf9XBnyQevSd9sWzigJOjRctnKzUCZV6U/CJUruE/41\r\nqbaCZUTQ+byA5N5zfmAvtTD8MbviOOSuRJbehmgDGq7hWxwM8bjknhVgwR1F\r\nLG1F5Fa8kR+O5diYh73qd73xi8N8BjLcHsdQy5hXqUzzF6CA4CroWGNd8QCr\r\nXWj47Gayom7TmDlzrvbjnYqx3X+rOpR2e0h10er0m/OoAMRmMUjT/2NElh1j\r\n8QageclfzTRsvNV29Vc07p81CMmo/Rw7E3Fn2cc6MLUzBylzr3GHCwIdROey\r\njXwdjciq6PfFOpd7z1702tW8iBwccVaXe9s=\r\n=1uiU\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0928ce5b1ac8465bf7cc1f71bebc014d19d3c254","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.91"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.91_1648686328610_0.4615119330720314","host":"s3://npm-registry-packages"}},"2.46.92":{"name":"@apollosproject/data-connector-postgres","version":"2.46.92","_id":"@apollosproject/data-connector-postgres@2.46.92","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5a8bade5e8278273f8f57d10e1851151df0561a1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.92.tgz","fileCount":348,"integrity":"sha512-m39yqTkQRXVfMUcNPWuwPD5f+XCK+7h1U1gR1lHeMdpQJgTT5MxIxINcbCaa0FytXKXrGF5XQu5n8zpniTC7Rw==","signatures":[{"sig":"MEQCIA86nY0O4CHFqHUoLcJWawwvq+xeEChUW3W6eUHckQmkAiA7Te840jeF6r72nAGvfYtdRntyfB+/tbkK9Vqpy3lmgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1115104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPXaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqbgw//dF3D3myC7X5PHCx/QsjEjsXB3krAvB0k7rvgjE0Qkk6NZ5PO\r\n0fmwN1sEExX1cRGNLJjBr4HS44WkIXN4aU4s5bIKoAwpoWzonw0otX8fY8A6\r\nz6ze2ozFP3up0aZTKSWvxmFBvYp1oxJfv9wB1DUXtyyyaS/6dd55At5u3qM7\r\nek0YaF2RHUmxUg95TbSbqsJOT1T17J7IF1+u7Czec1/3e1IGoNRLcGUEj6DQ\r\ngZ267p2IcyLIz4f2s+/xv/HQBC4zYxUrOVt0Dg9W1EzOtiBSADs3PqzGll4W\r\n3PhcyHNw/NcKmJxJm2dO0u2X0Lx2CYBmhPXctc/p5b8nUcJkwTqNTcQnifwE\r\nPlC5O/dSTZbs0ddo0Ahx1tFN7U1CvlsluiBaDmgd1FlgAte/N8jwNUYdf8QQ\r\nMd2FBpTHI55Kbt3FQ8an0FN3ZE1zbIGXGeczvEFyNWY7ENVGvWvtvgfdS8Da\r\nqOV04mGjHKA1o/ej27KDyE2nRKCIVWZrotNXG4Rav3Qqtmrne2mUmQm9nSX5\r\noXiPRR6uO9DOv30RjhkNhgsiMwVyUtvKELrtETRYac5O+0k4eLYDecNs61MG\r\n6WJnyZZtLwz/okxfYL2FDZ4IAoi2bvkccUiXFo6kj09olUyOFeBkovgdz7PN\r\n/0DjGpR6GocTC1qkUSGJcpIgRNxiy+F0+j8=\r\n=3tNB\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"fb3a956fce5dd8758e92604c6624dcf4ee479a17","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.92"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.92_1648686554451_0.17361521843023087","host":"s3://npm-registry-packages"}},"2.46.93":{"name":"@apollosproject/data-connector-postgres","version":"2.46.93","_id":"@apollosproject/data-connector-postgres@2.46.93","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9b272c644c996e8f8ff043987eaf52da017cc15a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.93.tgz","fileCount":348,"integrity":"sha512-drW7iKGmdqqBw7uSd69K85N5Ec4rhC/PGtRKxdpsEaDjKbECXCRktb6pJVAqZQPH6brTBRUSPCpDLs5hJIYqWg==","signatures":[{"sig":"MEYCIQDCwExNJ+yNjY0Ub86XY2ZXlJr1Nc3h9L3Ha2ppi1U5QgIhAKaEbA2ZEzBYQ9yposBlZmO34qUG/VPXmXYSp4X9KgK9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1115293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPaJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMHQ/8DCWCtYZP5t9PHSe/fzAyorLJXkAr78S5lBzZekjm0/m/kL5/\r\n0hGtLj0dZ7dsuJhLRuNfMHqkbEKkaW1qagN8rQhldhrVHsSzeN3ZTgzybcTI\r\nGbyoBPeufJ6X6aSBeoA5jZCqs8H/AObO5T4WQ/tmBDthGi144VneBn10ISdc\r\noHLGWxrsnpicV3C8gOV2JDelUhujk0EjyDuA6+5j23uX4D3kfCqtZY2FV4Zd\r\nnFcNJs6Hq+rkK19PBR8zkI2EMlnr4Fko67zyizyhg2ZnLiMSLdb69pPUx5OI\r\nlG84VCRMxMu3SeqyYvH4g+N3N1D+3weB9cD/yDqmWLcLeqDjVGzZRjQjdX0v\r\nNZ41DqPYrHK0PoGfg3wJZxfe5yfpzRNWcjn7q9C5Y8dVyona8PwdMbhPOwos\r\nGwcqQALScZ1uOv+2ZfaCH9DDULcEUiZfE3O08X5XYZY0vgMZZfjcJMcjmxBv\r\ng3KyZfWCh68VB3/dgaXyeHYOb9RzJi+Vlzt53mwlodyvXMvHprYuRixuC6LN\r\nArys9tNTBH8plfAndToxFTAFOcLF38Otxpl1I1c6WyAeGSZwXYTQ+JFeBdBO\r\nJueOS95TQo0u09euEafXeiscnUzw90+OVV/27ubBHaN25ZRy4uPjcsxno2lG\r\n4Tb+KXr4G3lPaT+lOXMPD5v9z6fi61kN130=\r\n=cQSZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c48ee270638718bde3879a17e12423290b57c051","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.93"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.93_1648686729623_0.9651375863972405","host":"s3://npm-registry-packages"}},"2.46.94":{"name":"@apollosproject/data-connector-postgres","version":"2.46.94","_id":"@apollosproject/data-connector-postgres@2.46.94","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f9a56c08078adaa34baa386e20f843fb224089d7","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.94.tgz","fileCount":348,"integrity":"sha512-f5pTV/KStONTVG6aOzjCs9b6HG0Oz2Bu39v+/RIQMiuls3yqyuauWmSB+5LgxzwAnBO3hqFvcVvKyAp4yVHRNA==","signatures":[{"sig":"MEUCIBYqQlwBDXgnTmb9Np9bNGYS9ZsVhaIWyLnjhOSmADXhAiEAzzeEJkaj/BWRu3fQNli2xfsFvjyySg+2uW4CTyuU0v0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1115482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPdqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpjbw/9GgSzF/e/w3TerTAmrY9rDk7+em/iFjIeXH4SY0XjADIL48NM\r\nIonkMAaiPs2pCVKrKexcFQlpagnTB11DGn7qZcX2WWKuY9UPYmNsuxi8POdc\r\nvmgOPhx888BrB+aZRUWk9NQZdpI1v2Cxuy2uGux/TeB17jkRqY0hgzJmKcyL\r\nU2m7XgraHhLy3d9/GHHAAlwXSYjkmRe2PmBqanLtPI9EO7oxbIjC5WPktaSA\r\n4DoIKsFkHUSFtnF5vvTXdXrr/FpGLs8+EmPfiGHPi1lOLQScUw/eT1Y4FMVQ\r\nbXepQmGi/DoUxrObuyOBpF6JfuQ/ibRf1Yt8HJ4r8Ib+svdt7pZzSISloQjQ\r\nFTrlEcdc7K/hfLRelVr8Wwkl4CVpNsp/NMrFpSC5SO39R8GXNjd1itE1LYtI\r\nBUnj4q776aiYTVi036zilIOkWLmJCkPm0Q/kE+UEVOo+q/igbCdGU4c+wcie\r\nIBAVDCpiSl3ak+5QOUd4XuKbMgs89ZvDJDe5fdpYzbuwq6FLEYJqb3JZP9lZ\r\nGTA8rAoRuRIyz+bpuRLH9OV7vKTGkSMhweFGAcSx+fQfEH5BybAdmDYOgYrW\r\n327NbR6o0HfKcX6AJFuf9NUyGsJuA0HAdcHCqx+bACVn/YxdHzlxCBE4aHpS\r\nZEVc547SGrx4DeloJqhF//Dgn/zteIQthsc=\r\n=odMV\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c13aa8f2ef1f353bf7c1e9a2606078ff04b029af","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.94"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.94_1648686954142_0.6263289082629535","host":"s3://npm-registry-packages"}},"2.46.95":{"name":"@apollosproject/data-connector-postgres","version":"2.46.95","_id":"@apollosproject/data-connector-postgres@2.46.95","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5d9477c665dd6a213c9fc56b11b95a1fe8f677c8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.95.tgz","fileCount":348,"integrity":"sha512-dWYNJcMmOe9wopPpsAxf4p4CQqLkC12wLEi8m5hfcpMsA8ZvO8wIP2/aNFKRMY3HeWnU97Lr8a0em25Y66BDQw==","signatures":[{"sig":"MEYCIQCLKE5k+bdxCnWw6NZd49AE9R2zyg5Tnc81zVZ53xoupQIhALkpbVqAEUrBJUamLTlgJxMy4vOuXaIN2E7bG+JkEntI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1115671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPhMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgHRAAmwielYl7TR3vocXB32+2bGLPj/6c2IxM+kQU5s1uRGErdF8/\r\nfhj0LhDwueu/wz+aaaBMHsC7KgqeiOOU4RTAMRe1O9O4J3G9uhMdSsoTQhGo\r\nXHymSd5NlRfHLD25j+Ev+JiO8N6TkE3aEkkBsxZRze150E1/oEYEslU4Yujv\r\nKQJCAVYzceNhPdoQ/kKUBC+6l5igBwMlitjZK6QeG1/+uf2MBOdBpGYxaGne\r\nqGHItjf2ALZFxS+5G/y3asdjCMG2+4nM0tZU3O1BaNZ5aRiAH0Yv/db0LcRq\r\nZkXxMEOiqSZue7tE0j4CPE8Lb0fsrG8dgZVducAwHxmEyisX9+lxgCily2SE\r\ndCX4CoEP3utc+PXqP+DgZUbgMCpjGjXAFeLUqcXNT0rnqiqHAFy5msQhxLvT\r\nXuoZBdx2MtsreW7w/nH3euO2jgj+XG32MrFMufXele3Vd3O1amal3axzI73i\r\nQIVvtq7WA9mhxG4Ve7TiUi/QPxEp1S2/XVcARErrn31FOfUn7Urx4KLap23j\r\nGLyCbzLdqFQ+zZWlYw/uc3XwTDRZDtoRHP+X8twiCeEHVmigc9HbCaBGPJHq\r\nfcLhSY7NGU0VTy98vlx13nI6gTC16y+UCqopboevfCgsygfBjLZN2jQ7g5Kj\r\nK7C/HmrfSNkURTRNKq14AxcVes39+Q4Ra40=\r\n=uT8h\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a1bc4acc210ea73f166fde940402ee4ec8d2c024","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.95"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.95_1648687179956_0.7242623876606311","host":"s3://npm-registry-packages"}},"2.46.96":{"name":"@apollosproject/data-connector-postgres","version":"2.46.96","_id":"@apollosproject/data-connector-postgres@2.46.96","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"246c125527ec3c724e3c62b09f1152cd931d5c93","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.96.tgz","fileCount":348,"integrity":"sha512-9Hb+zfso53tYg50xUoSAYWEVabLeWLj5XTPk/r8rtqd2j85zO4b0IBQsaLJWkMSAkFsiJxarfOaidq8O7vdSew==","signatures":[{"sig":"MEYCIQCA8uHLn/0/NmTSUP2ZRdgRjGLRVpa9t+t6EANzINyedgIhAPH8UER+8A5W8+sb1PmzckZY3BO7ZwtT+907nrx4V2/m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1115860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPj+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrV1g/9G+7vbimjAMVkc138wd1PdqXkiu9Hj2qeAurzxcX2OWXkAnRj\r\nfq8dUTQexJafIf3mA4gvmu3apfxQcJiPFMlQ5rNpXGQEUx6rTmzfIDEM1Mup\r\nSWG5xqDACzqQ2DLxYLj6gKASJ09OXdviGIhEpimX5g6MJ2NRrFkANdIieXMG\r\nNf7A67F8osGdjtpUH/1KPL8ysEKsS1kksNolrIJgTQbo0y+buuIoSeVsMSaC\r\nzmjZ+UQvCryVSO+Nc6MVklhp2kN1FVSOzLqWNMEyTVzU4aHk8NCe7+ITRYl9\r\ny6JjJkDHo0vujFvkvYVZcJpCyqH2WHvia8qlewZz/+DPKRe1MvrtMo7g1c57\r\nc8ZVLM8Exh0oAOjvZKrXAF2lpBU8cH2FOO8m3rZovZBZyYpv3FBbYoKw3hlM\r\nycw7h6nWEoxM/XmcxMzW584Sgf+1wx7EPrfLp2PSgTfMsYRUUNdHRcE3/yUa\r\n+ljb/GSTtwElVwQnIgodoLSlTofeEluQVx7lLTZbsHRcWY6rEAT46B/EkKZu\r\nAZhn2AH0Mad3qX1uDporE+Iqpn7C3XxlU17ITGSbT4pPFqCPzTDvE1v3VtIj\r\nD1eEs40jIfNpcVevJEMxaHlyOqZquPaFFpzQGM0LxRf2odEIHrTnqvTLIgW8\r\nxiRBsJHkDJZ61WenS1T3d64/YQu5Rv7Hkms=\r\n=mJPi\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"151d38327fb3f8722fddbb5721cf138bed92c371","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.96"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.96_1648687358255_0.6894406433453681","host":"s3://npm-registry-packages"}},"2.46.97":{"name":"@apollosproject/data-connector-postgres","version":"2.46.97","_id":"@apollosproject/data-connector-postgres@2.46.97","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"779ef8bf41a84e0ffd43e047df4390a10a87d043","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.97.tgz","fileCount":348,"integrity":"sha512-oD3giHq3gKqCMcCX7jhF4qkWVcZ9O8If2Rs3TNbgEG1cr/YYdX0sekSJ89i2Aiy2mrMJL3kUQ45rzpsXipVQmQ==","signatures":[{"sig":"MEQCIHdMYpA1Ud0Sl7qoqP+oGsF4721XF9vTWu+1OTrP6I3sAiBPwGsuS7P4fwFhNjBbM9HCte/7gTe8J1Q/ju0Tflt3lw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1116049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPnuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7mA//avrOt4xqn1tzEi8pS9wfzBYUY4vlk5U5cMLyL9X+F/kGG9Vd\r\nrmR4GiHZQZoP+gTV0J3JIgF1XhXwKOA/Zj9RKJe4tPrcDrCIotiFu4bH7/VR\r\nUjudm1ntoxdfdFjO70CyMwEVW4VDr14lE2t5yXHN4zVlZ8o1CYf5nyrdMpgF\r\nprob2qfXGUD3OFkBCORxJGYg7NPMfxUh6JkEzCP54fXGXf1UemVmk5YleU75\r\nkfTfB63AAYgZcJPwzIs5K/mdEsTU2fiJBOUiN+sBduyHvqWDDCFyp/h8WgTf\r\nTIiyNb6R7Srx9mGfTVWWqOWADEyRoZ0UHpSow3sqVe9D/lIz4ZmfnpLP2Kdn\r\nBitbPCfsm6kklKvwdp2nr8LaSQpRnleINkRYg2kvr7v1IBxDs1X1nxUst/0g\r\nx/JQo5ps/IzKjqUz6u+jNC5Rt3hQ9qu7OzIYcIx6VpZo8Mg3Hc2L8qNqHVNR\r\nTc5GFwwfajOqAz0qMRow30jdA24jEWtxWUJjmcgPdT0OeQJ4p1NNU603s+eC\r\nmlH4saRWA5Wm0tpd1USLIVvlrGL4kZpnwbIMm4+LbMj2+Qs9iIdTghsOa1Kc\r\nStnNA6rZzCuBMQjsGitspVhzv2FiRf5DNZJ6mUIwM5go0qP95X6Fv38JAqYO\r\niceUyl/ncD1Xi/4GVIf8VEO/r/o48x+QcnU=\r\n=WiV9\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7c5a4e80eade4699de2b8ff825a036b6ca623d15","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.97"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.97_1648687598680_0.9375992927944439","host":"s3://npm-registry-packages"}},"2.46.98":{"name":"@apollosproject/data-connector-postgres","version":"2.46.98","_id":"@apollosproject/data-connector-postgres@2.46.98","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"06a8e077928b2486ea7b32fb362fa811da53a6a2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.98.tgz","fileCount":348,"integrity":"sha512-Mz5bJlxk8YdOWtifXsCRsK/wCQJpt9r3SCpK7feYaIaqYGsRPudYcf0K+eUP5Js1QUDtCxS51KbyZ2bdqllXNg==","signatures":[{"sig":"MEYCIQC1A1ZpYmTMNrWpaFpwCefQBVE22SeZ5qb5GgfpmU47zgIhAI3odONTbqwK6/aDVxq7bWKz8BjZZiFkYM0+Qmhs/PEg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1116238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPqrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGCw/+Nlxx251gBrHXhb5RELnpOsZStGmXf58bzwdaLkbqEhkZrYMM\r\nKgkpgDoVvL2PFuyTHW+HCCOmhB4fMjldfSHl1GtEMCll2e4B0bwGkMcWyB3V\r\nwy2jZSKf8xIlJZv5hxJn3qAgXaGD9qhJW3D6T6PwVV24geA5ldXc4lPrz6ob\r\ndTy4Qh9I+v97qeNUyL6/ynQgID1JidANaqKHWNYUXNCCfAyHQDJvgwqOGdrk\r\nnWjZUylqsa/rlCYEc3PKhcOf68oy3mG5n/mYIDcWG/uZid5iVgBDR0dxQcsk\r\nKPbrEUVDDL1IGVILAYAiKCAubPWcoGsyxOKLDC6Y7uC5BDdIbtNNrfdTMtM3\r\nM/57iJmsDcN6sOQW08nWTSb/QEoMFYOD7otIfuaHM2yick75M/jUtWUBZ2L4\r\nVg7hEJopaIl0lM9wexb4SpT4pMYDrYWPJozcvXDuK2yQVpJzgS5qWVxyzdnl\r\nf3eosqcthrCmsHyUUJgujOQm2hAGU98y4fEf6kU1rg6cU166Nb5Z/zeUV/Ei\r\nHsoSaeEeep1AiOe3hYaNssY4Ng9Q+jWld70oN5RQ5OYv/G7vyyZWC1atlbM5\r\n1qd3zungwSGAFNet7ir4eV3DcMSNGnWlJm8h5EPDUAX2BoVq8i6oh3BSZDhf\r\nytcELTqpv9moopLQsHo0yyA1IWUUvZOucsE=\r\n=SlmG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"783a8f71598196f826cf37891256c514923eb998","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.98"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.98_1648687787112_0.06142644592475732","host":"s3://npm-registry-packages"}},"2.46.99":{"name":"@apollosproject/data-connector-postgres","version":"2.46.99","_id":"@apollosproject/data-connector-postgres@2.46.99","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1eabbe50d846246ca085c9329146e1c17dcc875d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.99.tgz","fileCount":348,"integrity":"sha512-ibYic/93X4KDB1zv3sJ6bW3SCH/k79fqptAMskWDH+NJhgR1Vl4/dq7CAnm6uOYo4gpX5Sjvd4eMpn43KZ5/8g==","signatures":[{"sig":"MEUCIQDf/eSVU/93g51Yge+QBQAfPdtv5RlwMcs3NDsFYBwc0gIgestELwj8ymoC02Uxa+OwSvlrBeTLAFiFdevCM+PFPGk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1116427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPtqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov3g//bj8MXgI2C+QI0vG162J46O/dxC+2s2dwr1iC/DsSv/tZlGy9\r\nPBNIdYSGO6Zz5NdKVng9UhHEG2ZF3Cce0zY8yBGybZH9FbywGNJmCiscqoIm\r\nyAmTJu4GkWIYu7fBJKYmIENw1L/I7bLUzrHXXkJFUgUDv/cgYMZiyA74sQe5\r\nQVrzpMxRAXVAAokLnNU7Cn96xEPiINKR5+vr0uKKV5KsKcDAvK/PzKM+Icll\r\ng/iKAOj74iJXirYcr2FmNCPDRSv5Ic/qU78hhyZfurum+jlZN8gpgx597DbE\r\nCGYZr8LmbPzHoRVECh0AQbmoQjiin4XiRP0MA9jfVlHUHKk+IxWxqWL01SNk\r\nJHdajo/jXKJRwqMBiZMoXRqO6jyI+kCKfpGyMR2O921IK+uUeEEhiMMqUOsu\r\npVCIhdXV/IFjWfaoF7Uu9HV9ATlHsa4euPumAkoBqEznKfImx+RJKVNaDiMw\r\nkZtctFSw6uCeNdAqAavXdqYD1/c3DShmX2zwwmToO9R48irP/fCfXwWt+ILj\r\n+7NwqXFM3fBwKkKNyUeQwf/ig1ZZ2Ex0DqeyYbMR1rjBq+R5ZprxyrS0LsoG\r\nJ5v8ZdCH6GC7t7wWKrDcHQUiTl26tY3nJqqJTymE8LyK8A32apr4fF3Z1fiD\r\nbS9qUtgbLwIWqeg7/C5cJGmXJJkNwffR07o=\r\n=VQqX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c1abf33052521aef21299884edb2051be9f1bb90","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.99"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.99_1648687978481_0.09584046820553782","host":"s3://npm-registry-packages"}},"2.46.100":{"name":"@apollosproject/data-connector-postgres","version":"2.46.100","_id":"@apollosproject/data-connector-postgres@2.46.100","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8f55fbaf4df253e4360d1984049eb5e2c28912fa","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.100.tgz","fileCount":348,"integrity":"sha512-S1++kBd6nsiEfyvDWExjSRJPbmDCmmi8xAk9/7qW62Jl2erD5n7rv+dr7usW41k3fkwd6CptDhWarEON1P6jdQ==","signatures":[{"sig":"MEUCIFH6m/hfR3bfr3wqspfGn7+Xdp37HpBCfVXnxBTY9frfAiEAqstYLbMwSCbH6Ax4jUh1SElJahWxzPfdRAuTXWwghRU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1116620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPwSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoA5Q/9Fmm1fhaO+oMBCdET55GaXprgAk7phXppuidUwyXneWxWhF5M\r\nahqG4bIq4pPxCVsD3EOAAAYEMUgQpR6etLyxuspzIq1YneB91eNy0UMBug8p\r\nezPq+bq+XKk6/LBIseKThN0JajfRvEPP4CR67hxLQGKVeND8K9uc2dFASpk5\r\nuwSGkXVg43GqnvRroWEfP+WzLvUA5uA9sLeKikX3hmtu0UAAspTI4v+J+F/Y\r\n+1v1/SXzuoYM1FE+SinWdnH9MS5kHZFJ2J+3ceyWdZO+joH7nwxvhPkKWtTm\r\n+z3PK6uRT2QxhIVJGXqXsHrKuQW6swCsqUEr3a58K4fV+tdRqyIH6l/Q4PcQ\r\naHwkd6oSoI59t5vJVuKvNTsDrtNZU4vTQuU/Ok51UKs+wEBxnFUD+xLiGi3P\r\nhYADzVAMAMvC2weoQZrrHqo81gIqmPxkv7nGsd9dA+XnwTY9kbzH2uq5yU+e\r\n4osl+NtFsztcgz9Sysg+ilDyun41SbBed3dR93T+SGszG0duY/bEV4IZCp1e\r\nXGJEBpC9qG2/Q1pHcB/SN45z23lblT467NJEmPSbX7kVOBpHDSboD8aMEa9I\r\nWAeZRjtksoj7NYTaEhDzNd7O8yzK5OGVV39hZ9JZtPOrZrYDD2gcU8YaaOOO\r\nbRLPX7UXwwaEWhJJlhA1ZCIegZpgRNI+ld0=\r\n=boaz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c2e500b4f70d564425077febef10754e3b1d92e6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.100"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.100_1648688146451_0.0708535537657844","host":"s3://npm-registry-packages"}},"2.46.101":{"name":"@apollosproject/data-connector-postgres","version":"2.46.101","_id":"@apollosproject/data-connector-postgres@2.46.101","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9b4f1a9706010adc6f6b8fde07eb41b1212e74b5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.101.tgz","fileCount":348,"integrity":"sha512-rL91epolKT0EE4iRixgFIVKn+G20q7TLgk4p4QY8CrZBMK8F2odM6VrubeaSgkdnrgX2mrU8RFvSezaZdS9Vtg==","signatures":[{"sig":"MEUCIQDuFWHY6zZEZzQTUjY1lou+3OGh/suxl3HW2E+dOP034AIgTe9r89NqhwM9a+N64xEWLka2Q/Pgc7tbU8feWjExR8M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1116812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPziACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6vxAAhiofxl1DSPj5Z07ncHzgIx5pR6zx+g+iMoIyleoqDsoXh6wo\r\nBL5K5ZOrKZEaU3X2q3rCYmymbuBhVc2h4QkhQpKmpYAnOZqQH0eziK5EA3ZV\r\n99CyKTIzYoJDMuGU4FOKy3xf1l+mECHLpVaN3gHSl0ZOUTv1WkItsHtFdoBX\r\nChJnMORJsQDVHCyvCBZUKl5Zxk+fy574e+OSnT/EIH9d2vtmX4UKtMOiBkzq\r\nbdfH+tv7l87pblsOFVtR9+6SWt8ypzjqBZuLw5cLrDEv5R2mMvEsbzCDULuF\r\ns5oySZ/Bh6syqDEWrx06tMPuy6rpjQgTmLHk8z+UpQy0jBSuLwnnEG8UzxyU\r\nVyiVgddxqVE34sqYxP4+2TVqKSCegeyA4vxajRS8U0XKDJQRl0hWWBQO6iWV\r\n1Tgr3vCL0GVigpIBus6ZqEqBOiuukvL2C8CCrSFjP1NhslgGyAk5oieiNgiB\r\nV6/B0mJNSx4rQoXMpDRhpi9jCZb9xCM1JlDERexsx3oY7DLSixKaERjaH+Xt\r\n2PGytYEFYyf3DbD57pCXrAuV5st62MYltBqVt3gHJJclPzSbpQ9V/f2A5m+u\r\n3K5A4nmyfMPyWRep989kMzNHPez70CURSdI57SC+9ijNh9vvj+AVK3QOTG42\r\nT5mZGxGxe0WtSQ9TdG83ETPziQD/ZMnXP7Q=\r\n=ZDZz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a5c3fe53e3ec061bd8d812c51d3ac831a6dc89f2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.101"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.101_1648688354239_0.3912611185790107","host":"s3://npm-registry-packages"}},"2.46.102":{"name":"@apollosproject/data-connector-postgres","version":"2.46.102","_id":"@apollosproject/data-connector-postgres@2.46.102","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d7c801e5474ffaf2ea23a2c46aa970a227cceffa","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.102.tgz","fileCount":348,"integrity":"sha512-GKv2Vvo86Z69avHs4oPbHk6JQ1kuiKvbcdvPHKw11Ox/ciJuQghZ1lhv6sHSy08Adgw45gF6xztK5vS2mktu9A==","signatures":[{"sig":"MEQCIFfrIgRBcJmqtARbVd4W3hu46PaGhNCF6++4EqQ1uh+qAiBHQ9igzJYW0q1qZdx/nzM9+p17Df4i5akg/IDzYuKkoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1117004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRP2/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2mA/9FxNJAAa2K0Sq22EWF1GskISkBdVtO6hK3GclykQe2bOwXkTx\r\nZgn3aYVjm95oVSO6HLdmaSDZekuRBToq4RYOAH6UPlVgMgEzGjxGxEWIlA8B\r\nchKNJybHqREMEE8d2eO97d1cCDSKxfXuTtjZnPf5yI8sJYaVS8f3ERUIpfPI\r\nnt/JFek4u/vKTK++AL0W8q7ZY6il5+LOul1rVy5COfweZjeQMB4O1zipEMjB\r\nCyQID6KFs1Crzdm9UwMSkFwJmgNindvBaWRrYHitJwYqVRwIcPAXLb38M6mN\r\nHQwsJatAGj+/DS6C0GzyD1Md3oyCz5AbjLtl1hC3iJiOnxHiFPpLxZWFv5RO\r\n9Cp8F34SQFWhfp9dBdRwyeKaM9mE3GbM0cTHpIqoTVrH6hoA7iOVTtJhoWO6\r\nEWwNV4G/olqEd/Da4IcRMdp9KZTtY9N4lf4/5gC+QR8pT8OFmIpjUHPhhkoC\r\nzNbxUnnVIxDblBr9yoyuZ01J6kg63G6M8F5zs2u2zGkLMaA3iboMRiXu9KY/\r\nELaWSdb4UH/r5V9aZ9hJe3Gvb7lYDDgfmUPxqGXLG/PhwInXuxhG5dkHp16K\r\nLBZrTn0mxLWrOLrEZajYRrRUWuv9yAY5LkOUzj8uJX/LTDKFIkRFqL/ngYvj\r\nHTMmmNeXu6kCYUzH5tsqeLQGMOXS3WEa/1k=\r\n=a6M8\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c617d908069d063ba38367e10688a9a4923c5d12","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.102"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.102_1648688575161_0.32348394587276563","host":"s3://npm-registry-packages"}},"2.46.103":{"name":"@apollosproject/data-connector-postgres","version":"2.46.103","_id":"@apollosproject/data-connector-postgres@2.46.103","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8463539cc0afa399eaff92ae39b186da7bc6cd6e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.103.tgz","fileCount":348,"integrity":"sha512-td56WlpM8G4jI15eVWrlal0OnKk/5JoevQ5q+QEFVxt1rgvS9YMjdsQqk3cOJda+RkPNECIHSOLaPrVFgu5ddA==","signatures":[{"sig":"MEUCIA1yZAgIjRK+3Zb/2FBPTkBspu3iKIS1jknaUGnmkUXrAiEAmXmJ5eGcik4mgwDXSyiLztfu5mC60QSh27EKJ8D6gs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1117196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRP5yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjqRAAmIUR6D82g86uNDnjnkj5ojv8hwyB+IemqvkoOC/yCQjFy3+X\r\nX6E3+baYTM1SXW3g+kZZxRtXaZ0/nm1tNI2Mx8EaHgt3wa4T2n5Lf7CunUOM\r\n3LkSU686e6L9CxqxIO5fJddxhSH9BgZesLfQhnHvQsCBhRHLk6aWe3DDvrAs\r\n300OwaVc7JT4J0bg8TrE73/oDViyZg62CCoi9E0j0mZsCXOv08AV6kpwJOUj\r\nBUE6xgNTxG5xzCUnUrYIjj4U7SzanRh6/kvqIh61Of6GbpSu9R7Bt2dlP5E9\r\nHX1LM9oJTm2uo/Nf17IbXL6vAXa9q1un/cEuETTlCAdwc4dV7sTbfVIt5j5n\r\nfy2dXdgBy2T4Rux8nDPfof3v6zIKunuShqh4uFPLCv6OPR4c8NidmjWGBShn\r\n3LMFYdpvbYDavVYcPK8bNu5rkrGGE0VRI2YTqcbksti6apVJt7YPVNNQ39OF\r\ntxUzjzK9m45H9W5xcOYZ3xv60m4U30NMz2sNzjDHC5Im/zM5Q3kfSgza3Dg2\r\n8xvKfdBRS8FClAVs7S8IKRReWhI4PHnbFcBhsusl9K0RcfldanObM2z5uIxs\r\nyrwSTXqQgR28pbsoiNpUOEHX4CuyBZG9iANmF/LwCpR3MrTvZ4Z6av21BlHn\r\ngDgqY+4n0udzATO4ejSQ/4bAt2v8DjhQ+zg=\r\n=U4K3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"56d0e57e574d027a8446b1e783db535338121197","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.103"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.103_1648688754374_0.8085662613592444","host":"s3://npm-registry-packages"}},"2.46.104":{"name":"@apollosproject/data-connector-postgres","version":"2.46.104","_id":"@apollosproject/data-connector-postgres@2.46.104","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f308ccd39ef981357053d4c4dd563bd20b493763","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.104.tgz","fileCount":348,"integrity":"sha512-NOERQsSI8n+P/hOYWtpYIJhP6pWmjOqox2GckCVWEHhpQf+CpjoJxZbs9jKE9A1SJseP1dkC81UdsTQnbUJvww==","signatures":[{"sig":"MEUCIHmHmYKxhkzhC+68dKsFWqEJUA3XBnG+AUUWb7YBj2A8AiEA6yMZiPT4yZuJwY78M+Cdrfh0aZU61C9/1VRs26AlAJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1117388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRP9LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqd6g/+PY0eRsKxvYFWoMUT8RbBZp3+xHLeKkxVfrVowJNFQlp0UCu4\r\nVlUiN+ERTzg5AxDq7eGsrUAbw3k9UmmDd+B0QGIbEg8KKTQ7BTgMUarhbQi8\r\n7L3Tzrky8bHx/dM1W62P8wRWzipSPvyf3/kdMWm4FNuPyzjYVfIPhJOp/vUO\r\ng5ibjU6cjsLUrf/Z/w91dJLxdVNBPvMyKeB2VmNIF7AMTt1+uG4Cy5CfR9PD\r\nwohJAUXUZxUssrzNMYOxj64y6d5ryMS2UXNnSrhpGfwcLDlw8eGl1wOUc2Xn\r\n2rmY0b1NjKaROdfRLtKNvlNaykUagC1rQ8+Z5RLwYtxAkXrdP2zUWel5ddSM\r\nuGMV3XovoQqYjVkLZD0paSk4viYRzn7zdWC2XSFPMOCdbsAKkOENahOYm07Y\r\n/sDYLQlZdw43+EDgKUo/Mggg/472HXTHTgpqfiCtRLWtxmOOBj21KK4rOvO1\r\nRrKk9295J6kKxrOYywBf8JUyJO0TnzhTAisDBZNkylb52LezL+tT/p1W7Piv\r\nPZ8pOJ6z4YYEyWCkTE4jbt9QIO9C7rUUG/rW2r0jC2kp9Cw4bnKO2ZnISB+S\r\n+qZKJHuDxyvN0RIhPqSIWwjgW0Pi/SSEQOgO+5WSCGq7n6wGxmq9io4WY44j\r\nLSaGWyKVIlpISmHvFp/rCjxqrBqAGC9Mvgs=\r\n=Ev4i\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"127746c89f0da806ef5337b43496e09c882e5cb9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.104"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.104_1648688971023_0.003574424610982563","host":"s3://npm-registry-packages"}},"2.46.105":{"name":"@apollosproject/data-connector-postgres","version":"2.46.105","_id":"@apollosproject/data-connector-postgres@2.46.105","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1178da716b1b2ea34fbda558ec1a54faba6b300e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.105.tgz","fileCount":348,"integrity":"sha512-89FuslkSmHAL8l8b+dm0GhvuG9/9Io78PJLG10iYpImnvR4q0tPSkCuSYnbez4Q8yrIgiC7Vy98irZWmBXh8EQ==","signatures":[{"sig":"MEUCIQDLxbgV4GMP4JydPk1scPD1eXOSiiK9/tA4YK9oDe8hIgIgReEhRFjwVDuDdIwsktSjXxLZwlqFdSzME3E/06FXM8M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1117580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQAXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKLw/6Asb02dmipGX08WzDiYNhYHce6Q1zIabgdWh0kUHj6I/kC6kv\r\npEM+DqFxBm2pXSr6NA2isxCqgpZWqYMYa8QagzP+A997rOPaKWkz0Lq+RULr\r\nqnjB3UVNs5F0Q752yYM4Jb/pH32ncoH+h4ZK579bOKOw0a1Jn+86eiDzcJfs\r\nfm8haHHl2F96Wgv04ntVgLqy2zz9vHIGRR8u/u84OVfnDvOOuAk08i3Jl1fv\r\njX52wUnxjJtwnGaXTBYnK+X7SUNS3O4xcIqU2xq5/kE3EPIa/QQGqSvdGH30\r\nXGtKwibfgJHbMuqxfMFXVhXdgKqNh29pTCtKSCEDfF24NXFdApurpvE8Hx5I\r\nUa8+U4Mc978vwnloJ84evM+bKU1NCtQcw0OK1wNvw9UIgk7+L0J7D20Tvo4y\r\nks2GrqrzBei+83F9cRldK5EeY3Y9tUyz9+un2WeWG1rib7TTI2TpF1/s43rD\r\no8xk4zNxnDwPqfhfz5NEpxdBf3dR+93nKb7FKkLQwT4sf5TLW/Y/1zywU/p5\r\ncPpxrJ+6BE0/EzbO2OBI6Gl5Qz0dQfKjRnwSJz1hwT78RHhvDE0BYdnAIwRv\r\n0jb/lnaGwJ2eZBDyEkzBZ5aH8W778JjYxPsl+9fp+u1lwM65YhEpiSWFHhO+\r\nnDj+7gd+dJq/scyCpH9WAc6sDAfStlRD+FQ=\r\n=2OX3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"725483cc961f97bd88da5304cdcb3c6bb6fe5802","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.105"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.105_1648689175196_0.4073324199113193","host":"s3://npm-registry-packages"}},"2.46.106":{"name":"@apollosproject/data-connector-postgres","version":"2.46.106","_id":"@apollosproject/data-connector-postgres@2.46.106","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"827b5347026a012f8d21df1c004f3003a721da3f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.106.tgz","fileCount":348,"integrity":"sha512-uG3gcJ5BiyhWT3uNXJ2Z3YbB5YLh51wk+AcXt++NuK2fs5nwmJqMmnW8bsyMd2L/yl+PuUC2NmHhyqWUiB7ygg==","signatures":[{"sig":"MEUCIQD+O4wUerm7wsfupm/HLvUAPLi4/Rt5qBrK5I2fOl6ClgIge+loxaC6tmkKDyDXbozaM3rGr7867M6/WtGN7DRtHko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1117772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQDuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmovTA/+L53WPp7Uldll6VFeeKbCY+67L7J+Sl2FOzWvpZhUbFRzlE5c\r\nDXW6KqNOPsE9bI6LOwa+gWg6opfweRCUP/AJbiBpteafKRamoLbkHBoMqx9o\r\nSXZWCiomqLV9AmFQxfa3N5e2XffPOfYcjP80uzfYDJxyOnAtjzwgiXV1mQv4\r\negs0FB0Qrif3vUOxrb1o+/lcCssY4BanEWFPnPk9UhZU6sjoUlXUOhxvgkP9\r\nM06iAK2Nxf+3PPLNIKQmNJV0dRznm6UpUJ59jwQI3Qz73ywXfdDCGp0WFL0d\r\nSjCJ3fpWjaXDCFH5/cnROtS/Utltc20s5mg68YPWxqAE0hQN5J0txkiJk+5/\r\nEPHF8qeKibJGG7rRW/huDSf1Z3OTbbMBu0WZvDFEX9Kqf5M7AzKKCPCKIAH0\r\nTIaS7Xj4OOxLan3dfYloaB1jOWFsu3uM8Khg7uCgkbjqkJ1DTvhipCGI1/YU\r\nl0xwYHT3Js/G0ao/K2nzMe2KkEtPP1QDmcrFJ7yXNpySrStkN23Qmy+TYNzh\r\nxz1j0YgR3MhC8XgFfj7sqL0nRkT7EuabpmH6pFXvfz4ojo9UM3kf7ydxEV1Z\r\nBJJ3fwh2ez5DsR+hlmv2MFClkpQxdSPMkBT6lklM3XzmzSrzqTKR7e2kjRFH\r\nP3GwAJVs+AxCPijx2/1smnZjgCpOMbXhiiQ=\r\n=utZT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ff681a492e28ca04557e77e88ef18281bcfc6b68","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.106"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.106_1648689389770_0.6886025878428255","host":"s3://npm-registry-packages"}},"2.46.107":{"name":"@apollosproject/data-connector-postgres","version":"2.46.107","_id":"@apollosproject/data-connector-postgres@2.46.107","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0b048620344fccb8baed3a163958b6d402ccde9b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.107.tgz","fileCount":348,"integrity":"sha512-e6k9fgUoiF20/z6ZadbQT3NSjOhNY0L6x6jjvx+AaNWlz60qh4Hu7eD0sKAM+EIbWUlJYiQTRe+87QgYTgGayQ==","signatures":[{"sig":"MEYCIQC5J+UzAWsGDCCdrTvaLKSQIh6FUdzHX8o+NRciustEpwIhAM8d+8dnfkrkmyp1pO9tiAc+cIuLBlV1WB74iJg4Q30o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1117964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQGpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5qg/+NTrc3REXITrrMzthEssmaP0q9wJwObaGpCy0/rKO68kRSUs9\r\nsHH5KvszUz1igmvXY6t0q4atYjrZP5lHNeml3Ow/I51TR1fgyNS6fKMAIs9W\r\npgkoD+KAL2EL+vO7FtKzpCDUVRNG1Z/kKUUs/nldeD6DkyIrydMFE5dqQQWJ\r\njSXdLJZxw2+no/4KAz0Sf2QxewnQZ2iP35zI3fRsPHRd88oNT9oRNGS0BFIT\r\nQpSkA4IAmWhqiNVwWqce1HqX0WrcokzbkypbWpkJcGnF/tj5LyOrsL78pLYq\r\nK1oWru5mDUWj5RMesPi44W4DKJKuYkx3PivdQzOKYtEzI9EV40qhrfprgdAH\r\nhlMfgIwEdJC7PQSXGK0TMV23fLWB7n0+ki45bAQz8xfivX4mzguwQvKXd0TM\r\nJ9zGrVTODtORmzNjgQTtTVD3iWuHcQpSKHdxspSzORaMcT7WumCbYXZxucuB\r\nh5Qs3doYh4p215bEa+8vxtYIm/5O0JzZlZcpgW+BrqpWzvXDhGAciN9c+TZq\r\nZWW3Hl/1WhKs2V9OFybtIFmUDa0LyfR2gUXmx3l88WcW/fGMRcJpIHdX7Sd1\r\nCCFaqB4utitUWexhMLdUDqyRDVAReec4OQujZUEecz2ORLX5ZidcTvJqVRFp\r\nEPGr+QJgFrPYZvyuPw7juqkiUt5AolgPeuM=\r\n=H7Va\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a083c6c8b8b42a057b722bbbdf420f487fbae85d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.107"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.107_1648689577680_0.22679453893263446","host":"s3://npm-registry-packages"}},"2.46.108":{"name":"@apollosproject/data-connector-postgres","version":"2.46.108","_id":"@apollosproject/data-connector-postgres@2.46.108","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ab031fecf45d6db38f7c3107529845eed7d4e508","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.108.tgz","fileCount":348,"integrity":"sha512-CEfWkqUt2yHODrhZmHRwWZvIkZxrBcZrJG8xgVN4UNT5F547+jsBNgSTm+R9k2Cum/EkPbI26SBvKWkbc/8NRw==","signatures":[{"sig":"MEUCIGdPBQyZDyqLyq+hOYHCpbl0RX2n3WnUo1ViEXATODzyAiEA2C88QeoOOI53Q6UnybNBvvewbMF0NbZehhJ9mnAJ/Vw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1118156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQJnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2/Q/+Py+hHsWf5xCsFYhxD+JRNVrrLCUHH8X58fvsr8vNykD6OisO\r\nDY0/3qlkeHxRXj/oeXSBlGN0lenTKfVpls2d0mBF/gTgoCvBREOK7atAbiRt\r\nsCc3PdiZRal8BF/ZePWlPv5dGvf6wavZ6r449JPYnjsgAr5CC255K2f19ltH\r\njEoTL9zSI8lmaUVtRpSoJjCjuowAszqAmDv/pqh3/qgFoqseE9Ugn6rTKgLo\r\nEDt2gk6lRt7/a4iXt3+eWv62V+kmZqHU+EvL3Hl9/hdJsdpvlCtM0vgB7hqB\r\nt2RVTBhS6+c8UfytmSQgo6p/kKMO8tSMFPT6lvmrFvaw7kedNetX9mc88pLA\r\nYAO6Rx4PuhFUfGX0Pch3PiAWBs+1IvrU5A/x9IHId1GO5+DNNzGpsSWLCbCN\r\n1SQQDRLb6D94kpUERHeupjC87ri5lePu6pbaLKcei77Hw7Px3Bm37B/Nej2k\r\nd/oEEctMW5kq/IsIEshBZT1hqMZNlyuAqaoZaFF2NjGXxP/bQjCHbyBZmtK/\r\nV2lVjcMe2375IVfXs6MPxcT0UpSofatoAKmnmJaQ7a7rGRdNXZbQ17l08Xar\r\nUyDwV7b2DyUI5g8msOhhQGsFKDhlQ7xTJvY0DPOuZySQdbTt1nyzX8d9gohx\r\n2fYmSdqb053zh2tki0Tjp32MOi5+jbTVbHg=\r\n=YJ/X\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3fee7a66e777ddc0497f9e0ce651872969ec60a4","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.108"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.108_1648689766901_0.83726992760165","host":"s3://npm-registry-packages"}},"2.46.109":{"name":"@apollosproject/data-connector-postgres","version":"2.46.109","_id":"@apollosproject/data-connector-postgres@2.46.109","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8d1bb41dbe8f0630954f154692e50654202fd7a9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.109.tgz","fileCount":348,"integrity":"sha512-7XAkP/tX9t8vSpivYhP1J33tJdqw5VzXKaQwQKSv+d3qljXZKwqU1WW2ZJuPSrkKFZCECbI2UbxfH5c6Sv4UeA==","signatures":[{"sig":"MEQCIHrfxat5gN1jl+o1K+LtyeGUxogXBbfFQJtOYmrc8wZcAiBIJDdV+T1NkW64luH94qEgU+8nGrajV+uy+RXrGRQzlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1118348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQMuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzaA/9HqfOv0AUR8oWuJCZryDLUE0zR2B2QqZvv4RBM0jEx5RHCmGa\r\ndoUxf1g4Tc8Zo8MLLN/YzTuRibrlFnkdQDdpjsQybeCvLioS7SGDccVj+etk\r\nFlAgRIYmexXzE8LY4Cm3deuOK3P5uv9IbiNwPoiPbvVYs6rmEDtg1cn7yaEC\r\nhSRnKi4sELhi23tOgnN75myaIevg0yTr2RbqSKo7EVgDFffNviEeqZfuqCDy\r\nvc6yLkPEUjiSCWUhdT0auPlZhjX1kb7ZiEIFM170/uwXliep3sQ8/+XBKBGY\r\nGHqfMSOeQnIYPWq3opeRSBTmQe6gguWAXurAds0L+6qv6gBAouuc6mAAdLoR\r\npV4Sidgyfn+iFYWsE6bc/a8l6V/CmQI8L8/UJZH79b8daOLmkthaVlLztvWi\r\nOntcqBtPagO79VZehVelEXQVuQYr2dgytbVB8kTRQ0AiUP8d+GXlxtvNHWYs\r\nL641ZptIQjeHaYM40jjs08nGX4aHtqeR8YrnavcPf1v4mJn+bJJiFvw4F88N\r\nTIK/HGFrccl1TO1g0bYdK/cy9kPzSQMCu5qd6ZPRqnqK5+DuQSvS1kmLiPPO\r\nLJv6yK6HhsesgCycAaR5otukbEeHEJkiXsUgXc37jOvRiQArDuHtPc3t1FqU\r\nQPWcFLKohcI56X9pLPwfJnyg4mopkPYgUXI=\r\n=44nv\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c7b98ca1b30d6105d8ea394a36403089e94d3fa3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.109"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.109_1648689966307_0.7949566543740538","host":"s3://npm-registry-packages"}},"2.46.110":{"name":"@apollosproject/data-connector-postgres","version":"2.46.110","_id":"@apollosproject/data-connector-postgres@2.46.110","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"70be793910b5585cb4047ec4b7d1acd0fbdffdd5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.110.tgz","fileCount":348,"integrity":"sha512-wvn3AaHWbPDJo1jhnSQu7Jlnl1EVveVrzZK3kFKbVTerGDaPqxgrGoeSZWXPEP8pKNnLTMucEH9BFuZO4agiAg==","signatures":[{"sig":"MEYCIQDfjirGHFxzigIFSZUV+CmxE0xO3ulzwO86ficTv53jXgIhAIyanW+KTyfpcuvi5HrwO2oxGm49tAjXyrps/QbQMpe5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1118540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQPvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrS7A//aVXLHgEZi8O6laU7KEaj40s9SnNkI+mUnqvdM1SdKngYAC7J\r\nzlPkGGFNJ+m6sCmKlp9T20dU6bboHoX4wvuIf7iQ2CgOlkL0RVX7DFj0Gg07\r\nvgz2LbROueGasplDdshG6/t9aQoQDN/hilfqo0kPbYk/TdP9g07BO7NcFzM3\r\nVyVTxMDnSuLiyDqb92Lb+RQugPLo5NNCVgmF3yVGSXYytnjjpm6ple5te+vU\r\n+hQlj8gSF/xTuy9onFRktZeJ5NlE3dRWprGVjfSbpqvB/KEBQNKXOxsbF6u3\r\nIfpq5Wd1VjG9eGdCvh3/7X47EtmI0KBKtTydU+f/r4sHNKTgCNrrQtF5t41z\r\nEKyrvE3HU0jKZS3CdQ+17RG2oSF6W2Xv03+wgU5i8NmC2UywjS5d9LAaFuBJ\r\nKdZEuHJ4yIrfz145rut3Gmebs+fRAnTZfygvK9uJNkS5jDP4c+HPXUS6wB/2\r\nq4s977gVq1uGGmEe2c+IstSnyQ9sAWOUuXDBrO2SB0Zzkje34cS0V5Qc9eAM\r\nwaI2ZVSdbNYyCI+BKm4JXOg5zecSNV5W4Y2jgzBuXBUvZzJSL/TtAbGutcjJ\r\n7Dg85/kvGu6W2COK3r3sPgcmCrPgk3hOwCmKRgVtIh17q6orHxucWAo+t84Q\r\neT/MDmbml+vzYQuA1ncUy1shItOztHx5bIw=\r\n=Rwu1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"56a3be402b4b26ec1deb29ba99d7392719b2a6cc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.110"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.110_1648690159201_0.21652159153698003","host":"s3://npm-registry-packages"}},"2.46.111":{"name":"@apollosproject/data-connector-postgres","version":"2.46.111","_id":"@apollosproject/data-connector-postgres@2.46.111","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"62ce82960adab5f2049b00b40f883b5a30a714c3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.111.tgz","fileCount":348,"integrity":"sha512-4TBeMiYgrDzt1xMmCPpFGSJY6VhZZKHjfkGC/Zw2SdW0c3KiptoR/imxUlK0cCnmAeVX2KrbyQANno4+gs6CqA==","signatures":[{"sig":"MEYCIQDZYUu/aQEKSnMxEi/ykJfzYT3yww77P+m+yhI8dJelmwIhAJGM1rMASd6LlsWlxZp1xRBvLMv1qQ5e1EY3M3UnnTWc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1118732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQSeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdJg/+PTswdtMy7bhbi2l9/vw91ceql2Nyq9M8PHkbdLlnbU6mggTD\r\nPKYbZz4ZLvdQy3oTOFxRXG+YYSahQrCQ6UHFJSsw7EYkqBuVVVm6MFmJV4Ss\r\nN0N/F8xH16EICPKjvnI8aPPVF/wJgcLpxFADfNgZNFTr2Aneme31oWaku7MN\r\ngCsE025by3kPkZ+t43kZeVOPTKJvCxjUP/cu/XaRcXHbZm9G1DvUlhhBB+Bi\r\nATUja481miAYI7fh1DFcq9Cj90XKix0huBwXCB+9BH8Vzl9lqmLElcLyR0rd\r\nuZvUPEZ/k60yJuEzjpbXlHRDsaWT0BDA03ohrCWVX327wRdyGGMthyhDHbKU\r\nsErboqWaBL2Vs6gzYHV9tenvSWdSxGKgvihKlN7UIMApgUIIroJKdUU6nSQD\r\nVKsKETMQnPrIP0wE0NHr13s3f11V0gtxIgvOnLTkyl+lEgoHT2EQy9OoU3V5\r\nFEwNP0kdJPQ5+adJjIZ/q7FRJ3UFjk6rZ6VgfURKoA3+RyVU2qc9i4sN8/v3\r\n1FExYQYqf3RRW17qgklaZYaDYAvo9Af/Kt7qOyT9UTFbtVgsdJ0iBqfZWyNI\r\nazaWDJqwBUZDF6R94btArpLNzLdP3RBxRl10plEGavbs0X4Dpp1+71O+c/PP\r\nJFUeQD6fJtvSBvVzyHAVR3h8m/LdQ0M59YU=\r\n=oWnX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8566f39c943929f508c0ddc0820a0ec611662312","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.111"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.111_1648690334501_0.43830660606529115","host":"s3://npm-registry-packages"}},"2.46.112":{"name":"@apollosproject/data-connector-postgres","version":"2.46.112","_id":"@apollosproject/data-connector-postgres@2.46.112","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"853f6a0224b07309cf8bda98ef696cdb3dfc2387","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.112.tgz","fileCount":348,"integrity":"sha512-zbf0RgUQDOXg6SYpjJLeS380gFSuFppSvQv6DVpKw1M6x+XxLfiASH/mNZQ3raewuB7qarWzyK5xLVXm9unDBg==","signatures":[{"sig":"MEYCIQC0tRzWPJ7RfSNyM+P0bBUuU+SLwIczJ4VUqZAUH5ZOyAIhAOojgWQxkxcmELKb8OALUS7DnDzSXWv0czBYS4Vko187","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1118924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQWCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzoA//XiQoPxmI1PGruTFxAEYtKLVwgvjyG+U/a1ZRXxPEjnkNG0y3\r\nzNxgjwChxQnLeyksX0zUFkMJdZ6DBcs2PqrXxEGiBm5jYzooL7TCwVDOuOmI\r\n5AyIMJ07rFiNrPlTZ8Y8m3YIj0tRrm+U12M8NUMtMNM0fgGOoAHW4GXql9bD\r\n/cf+UeT4iVu5YCkuIlMvqDagZdrua3rg15Zb0ANwqAxlj2dvt3L/p/OhvYz2\r\nmX2AJa/DkiWhxlIml6TG/+/4GmNBr90+2E8pIQS6Wl1CODkLhxcQUzqilYmn\r\nH99WdE4jp/zdvieoG+JB6twr7SwUyp8nD4+Ae8rV8cCZO38gJ8XneW61GKHv\r\nRQstuQy0vWP+P0xFYvIjvWsqqV3CQv946/mDng5xxyOk9+rRIfXjrsHyNYw/\r\nP3+0PJL7KCWYG6rdQkijFd780A0vuWeJNfKEFEXB71qYqSvVN96fgiNjJBtO\r\nW2ZTgK4WS4W30r8yckxzgvetxK4M5bVAS0O3GczMX2Y//Y1jixXNzOa2911D\r\n+V8wHdhuNH5VAyVB8KiWABMpQHy4wxYRgvsrWAnneRcH3LMzB2akiOu98oVt\r\n3kNd74CCNVeDHNQKL3yu3FBiYtEe5Mjzr2KUWSkEXa8+tvDqhyRbwwhetFdC\r\nnYnqeDqm4uIyjOXBi+nWwMv7zR1xTL8+Ls8=\r\n=aRbJ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"37e16e4d639ed40fc26b589a6116391116cc227a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.112"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.112_1648690562426_0.10873207156783948","host":"s3://npm-registry-packages"}},"2.46.113":{"name":"@apollosproject/data-connector-postgres","version":"2.46.113","_id":"@apollosproject/data-connector-postgres@2.46.113","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d65cbae07fbeb34bfade63fad89d9da514a1938e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.113.tgz","fileCount":348,"integrity":"sha512-NM0tMm5L66OiFkw8ZbyFncHDBVDCm8qNWFHhdE9dDHlr9zCjt9Bjvl/9h8X1qdu1gBLtqd8cIvT7/PgBGyZdxA==","signatures":[{"sig":"MEQCIF6IfCr0mlDhPG7Au/Fw/wl3YjWn3rqITdtPiRwLLswGAiAeSJtCo530juLgFRzHODwxUSdEHsiCHRxjVYcG3kJ9Cg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1119116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQZLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmootg//W7rn+2xZs/CI89yAadDt5JtaPHiPDKQpolvyVijOg5kOVYig\r\nIdNJRhU37AnEE4e4NumQr5KNgrfYocMkhaVmOew7m+ID9GHlTQUriO+Wq4nF\r\nqjsp9H7yzGySDOig9Cr/I2jWVodLOEVx1Pq9XHtYw6LqvFEJiMVDepG+IK4J\r\nmUnEPqJKqcSILuiP3na0awbZZjtqfEtmAJw8TMSrc1LLWqh5fdpgklRXwUV5\r\nY3z2zxSVokokXTHIufQkJujCDjKWc1vketYrE5B7Zm+QchN9VgWfilb7gs/0\r\nvLX4O+iNmaqXhYmtGVGqms4FDFKxD/D8MBQDnrkD4MQlrwYQqzertSP7gf+J\r\nM/4L4J9Pv47azCvxiJi2EKKA26KEhh7U0vMfbS8zmqvcYErB1h+tE77MCTFs\r\nXtRZZ8pa4a7jp35E9CwADZA13S2qiVzTohNe5QfYXfRTlFe0U9Lli8pdC+h5\r\nc/0gjoty7rNNHMpnJ50cflHhD9DFq+L6+M6gdvsG8rM9jztbxgehUH4SPoRS\r\nVq7WeDFh7QwkhHryqVOxg06FwVNIbhAx7+Y+POiOBCPc/wd3J2FmaSPkmWdN\r\n105YEODWTF0QsP+hBok8M/CJf4TRrw3urTp/8MJ5vNWRio9tgvFv+GhIZv94\r\nA8zW3estgGIYbWUpbUfQ06+hb9LJGE0bBuU=\r\n=MAVr\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"835aa1905fb50ed13adeb263be574728c1ae004f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.113"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.113_1648690762878_0.1149678658220159","host":"s3://npm-registry-packages"}},"2.46.114":{"name":"@apollosproject/data-connector-postgres","version":"2.46.114","_id":"@apollosproject/data-connector-postgres@2.46.114","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d020c2e06ae14c03aabe174d30ccdca609f52ad2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.114.tgz","fileCount":348,"integrity":"sha512-kL5/XkhydVyuVLvygEGse3gWSCGO8e8vqKWsS2dmiyvJnab+4D7kYNImxvq/Ls6bDe8k4jUCde5OjHkmn8c18Q==","signatures":[{"sig":"MEQCIBX3RQBDxW7WDBsWHGIUM4pbLx5mkRzo4Pp7+nh//U5rAiAJeFSX9QAXalNRzkpSmEqJT/9MVnN+kPGIlcNTen/SjQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1119308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQbnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqwyg//Srg9zKSWDp94MWATXwrja8oOoswV9kISKBWOKCV9MIMbWyg5\r\n1yR00zogAd6HQkSzZzsN2hKNoVmDIc72rx+Sr5D7ITD4v75ZplExodJdBbJz\r\n7bomDoPSNJA6r99JI2HMChieYgC82qIUTZJFkw+3BFr8M9wa6PIXjZMtiDit\r\n1rXfSaDLvTWp3MY46tLOLxW2VM2YJxdgyQ/hVF9TdRQeP5URZ/TLLc9aVx+d\r\nMfhQVnoUoVwV5JBjgNs2QS83n6USYHrrmnBX7ldQC3JIpD4/NDSZ9FC0w01z\r\n+GgukkwcoDvmVpEfEntsVwSCn8+775paKIQBVSjjWlhlNgBDxl6+iiX21xI9\r\n3hD9X+PO10xd9Q0cCgy1s6bhddXHPlELBl8YlKWK6kOJEOeDwxLbyJWgb2PM\r\n8wS6eKjpPGJNa/CU8fyj5hePwk4uaMmKYiX3lQ5DzejKlLPpiMyLyJbime+c\r\nIlgHPc3fpZZL3DRyqM0Pe50D7H8RxEhrYf36RLNOocCdNVN9lFT/toYmM+cW\r\nqo0JYqVQYVKJJfpkoVDYmYLPqETWOGuZW8fsmxmVGxC3JmfI073wJtOVRsVC\r\no/oghVr8v0IKJ+X2HCQKzXZPlK0S8FXVwn6ojCNRDs6afuIes5aFyxG35tRy\r\ndJXqkuqq7IcWK8cUaRW004AUTvGByMWHLvg=\r\n=Q/+I\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6779956ccc56a7aee839bc11468ed4532fa05628","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.114"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.114_1648690919673_0.8254126857916666","host":"s3://npm-registry-packages"}},"2.46.115":{"name":"@apollosproject/data-connector-postgres","version":"2.46.115","_id":"@apollosproject/data-connector-postgres@2.46.115","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2d8a7bb4e27b84fce1981151b63b14f458644888","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.115.tgz","fileCount":348,"integrity":"sha512-gg53+E9muFzPMtD2pOJmNKSSh6YD21WuPVs7AQKv8f+ytq9eVyYSsAeqQVi3nmnKRQU/NpQVL+nlBAFr9h/yCw==","signatures":[{"sig":"MEUCIQDplmpK76KUzCJ+yz/KL7UtU2L2m0Liy/5Ow8sC0Kn1DAIgWJlKqfKHqgAcQfmv1uCKwXB2OVEks8jD6TxIR8TLqFw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1119500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQfKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7Hg//f7fY7bqOUqemFeHgjx7Vy29wzbaH+QND7FQrpG8mS+hDv2Iy\r\nnyu645oKlkZ94hLgNGCRWlcBypfiq77dtfXDsdX3uh+pHek/ZIwi1v18KMxY\r\nsWwnsPvFpXO2sL/FNt6ZUqEBcPoOgsowFEmQ65OZ6T41DlQx0xI+IUVZbIpd\r\n2Dxf1HpPvSZ4qdVKY9KTxZASyWQzuA7NkB0jUwGlMJdo+Xq0qrVNnKYcbOLN\r\nR/njXA6sAVxFtP+X0NdMxtp+x1h7zVXMGM8UWAjk34xSpmgFUZ3qEcZLQc51\r\n8+b+0WeyAZAfsBNSEXR5SaNfPn/7K4yryWqv8voY8YVmrfsODekK2yCDowXO\r\nPVYdbZkVkdfIhBCXvafenWreWspNgKzEhdSzQ8brLuf/B48+OaZ+KCPEnPRa\r\nV3FFQa58/WRyjJM9jvE7oMKgtWSNQa/+PvZ6c/3syWUiVQTRmeat1sqk5vlE\r\n+/GlIZ+EXczc/ahJL/ann0n/1nOfzDajfyx9wMRzG2bDLdN9LoEi3+uI8Xda\r\nobKUjA6nojPF8FumX0NbMj5WGJNnx3NeZ02jMBrhLvqVrk4gqubD3dFs3yFF\r\n7vp3D+ktscVlZQ+U2TKtHyLyL+uKnlyVEzhEhlR1892s4qY9vkoxiBA7//1j\r\nfEBYAKij0Jlnc5AkL26vpGhr+DjvzGkQXJU=\r\n=q1Nf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8f57a64938aef605d5369fb64e698e4c1b09a97c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.115"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.115_1648691146568_0.06845147960937514","host":"s3://npm-registry-packages"}},"2.46.116":{"name":"@apollosproject/data-connector-postgres","version":"2.46.116","_id":"@apollosproject/data-connector-postgres@2.46.116","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6735829846ede886b148ce87c2458e39eda1e992","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.116.tgz","fileCount":348,"integrity":"sha512-M/xjvdWbm1JkbjPUnHuq9aRXjSMhH26Tu3+KHXpopoUSrv/vUvNKETCKPwd/Yo/4nE4tcQZswOjkihEi3+dvBg==","signatures":[{"sig":"MEYCIQCFAhCL6x0E5lVlSxU6jTKP9aTuGYttwoTbRjeXd7UNYQIhAI/ZH7S3iWNZQeP8eQ/5PncAUsWXEwX+6nS5HaTXXKmU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1119692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQiZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoX2xAAgtN1lPDGs30WVshxsyTBl3x01nNNjcK7ieowd9Ei30iN5sFB\r\nXzJ9sVktNzIMuWBxY0R1oGVRI866KZhMDC6MoFxojzWmpEtqsNCscQ2I1Rnu\r\noNepxFWfHRe+HgfGpqLauHMTjSoFt69wuHhzSHSlfky2X1rg++Oyfrk7ntIn\r\nZuoO7sMJKLObYjbLF0UozS50+0CNTw46CJzQHMlPlQ/GzbHNQ2bDOhbu3gR5\r\naItYGJPFoOirlUpma85CdJsvtNXTTDHX4ESRTEWJG5v5z8qyxDdMazjgHIEA\r\nst9aaueD2ITM/hzKnFcieDPA7MwYMeE8+6DcHV40fFbVWPlzs9exDSZ1wKT/\r\nujOOURdnypvAvPgE5X9V4Doz9UO/BdK3ozxSP51ggdf0rLnaw6kCNIfb+agZ\r\ntkKZqziKPfXRj2Im/TcJ7/RbuQpqgLN0Ryjsr6Pf9jtRHilCICBmv5kjsV7f\r\nWrtkp4wXYQmXVTWtaa3PwkOK/UGhGaTcbLTsBr8sGf62hmrCS3aydemqx+I3\r\nGPThz0axjNWQFmA1lLL/pQbyPFPXHi9UYrQu7oMrGpquEHD5f6NX/SQe+CH4\r\nPCvoIcso2iw4oFfAhHPqrzitanhUff/6drJL0OoHou+dT9c1cpHVxR2thH8J\r\nDsTU1p9D+0K1lSeTMcvwFpxC2ka1t3qAhcI=\r\n=i2El\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"5c350ac88b59b1b0ca8f5e04e667e227411fc929","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.116"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.116_1648691353238_0.4014527520070512","host":"s3://npm-registry-packages"}},"2.46.117":{"name":"@apollosproject/data-connector-postgres","version":"2.46.117","_id":"@apollosproject/data-connector-postgres@2.46.117","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0f1cb8e756059244b55e610ff37d121da028848e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.117.tgz","fileCount":348,"integrity":"sha512-N0aAvtSY+p2Rfp2vU1LKeI+4+jKcc0iinD8K7cRnpFkcbHzcrXIgbZZqdNL7pqm2ls+Ii5YerPbQ19pe6EQPmQ==","signatures":[{"sig":"MEUCIBmJj9mTwBn6JmaWJHEflAdZBOea4eEnRHKyn8Kwq2hnAiEA43IUt8Zy4AVXfHq9tAdH/9oIN15tna0U6Okc6SvEvCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1119884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQl8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKsw/+OoXvFTfssimZxNqh4I1IimkxR/mLfGGOO1Cb1JAtWDD3sYt3\r\nrUwKpg9N87e6DCvDftdZ0ysp2tXEz2Slf59FfcJUrgT1Xe8dpYQAUBe9O3LP\r\nb4n3ig6dhKxdpZWLZFnpQd/ZyY8Wt+1pZotnvtcjyGBbSIVIfnq6Tv7P43Q3\r\njlt8arNntvB9e8kF9GGQDN6/cX5SvCRQh5MGTsrWvFu1L/Jf0X4sfpRUNPsY\r\n2K32TBHIIZhTbGuDQ0bPQNyIYDpLdCw+JUgyaraG2mzuhfum/QXJ8hku0x29\r\nlUZOe4FV0avYf0+mNhrm2N16Reewya1uop7GcDrgfpD99nPstoiG2TYrR8uG\r\nEqppWRQHClvCrIpuVabvtaZXicdRH2Y3EWK2fKZhZFsPVSBv9Z+W6Q3sj4er\r\nR8OWkf3Hz5K78xS1gS2duABY8oKupKbdk83SUEHddc/LfYln8KrHoHW00ZJu\r\nGmWmJQ/UTVAq+F7zk3KQ0Rd/5GAt9ahXBnjAGma8qiUejy6F1Vr45xl6vdre\r\nQCuQs8F/r12R9Md8MkWeoAVNUYFHDAR4IWs1oHs8s4igzMPpywu9QeMDcdBL\r\nBQDq4fROXfLmKCU6V/WE5QIkSL2+zKWh9+Wcy4llaF1Bnayo9yNFH4FizdeD\r\nvzNkzdtEVn8oGc3Bas/1LOMDh3xqMzZAFqI=\r\n=Dgb3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f428b79ff9fd9eaa60211839d8b703ea360cad86","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.117"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.117_1648691579944_0.8098307200627302","host":"s3://npm-registry-packages"}},"2.46.118":{"name":"@apollosproject/data-connector-postgres","version":"2.46.118","_id":"@apollosproject/data-connector-postgres@2.46.118","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e8b475736af60a9edcc7de0190fbee98581d8b96","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.118.tgz","fileCount":348,"integrity":"sha512-tuwBSpDIv/jSzF+gGLHjtKZR1Esa68S49NNHnT3EER87zKPs9isvxqrm5iO/bP4KTnmmi/lBiXpjXggnJaUNwQ==","signatures":[{"sig":"MEUCIQDdmExEUQxbz9rUfd0i5zNzkwlE9bMKa/GkaSuxEjEHcwIgaX8hpzJzf0d5xXDXtSlmfbS3NML05Z5R19tvV46PzKs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1120076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQpOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKeg//cQtO860VR+XabqAT/gSu/r921R1KQrd4MocDkuIu5VfOGJfi\r\niVU2Jjz4bAQvj5NFYQU/kouuXLGEqcpDMgXqQpnYwycJoCtipB74pVogXHjG\r\nuwB/XHE3soA1D0i+cii36EEn6CK8lROOR22TREB7aHnBuBsubAcLhvebnBDx\r\n2XvJ2qUqmG+jrH/VA5y+p/XjQXSGZiAgHcLygky0YTdd9y8JrFYZ+p4LYLHD\r\nbSEhs7SzBofxhC0DNw92bQGS9o40jLpGKFYXqp+UmTl6V789FPFAtPVJiagH\r\nJk2nVTTy/YRJsec3XfJX0OOUe1eSw8hN+7xrTDw4gq7CnnZSaiBfkm6j1ioL\r\nDdGNgYTZyWlYDGb9ofAHrC1yMreybb2prjtD5vJcNV+TJH+M1qqm5STt9sXl\r\nzteTwEU4H50JV163wT9uIzqHUElWqTdo68TnKBTZHda07w09KvQERN3Lxekt\r\nawRRtzpqxBumLigMlNI4atvL/1ksRQTWm8jBChOOA+ZvhLEY74UIXcRJhjCJ\r\nRxQxkvyf3z4K2lsVgmEAkl+//BN7i4iHAoiZ1YzOjcBjV4VLxRtQnhI3/ZLN\r\n9UM/FAn3p0D2ZDEMQFLaCYxtxjf4Z595e04b+AJuqbpcHT/JlNg2tdmmTc9N\r\n7eTq9LP+WMCAJ4WcC7s20/7pzrQPRHJ5n1s=\r\n=dqbs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6514e11138e54c5a64c8f20b6d13b36bee6aefd9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.118"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.118_1648691790168_0.00805002458812476","host":"s3://npm-registry-packages"}},"2.46.119":{"name":"@apollosproject/data-connector-postgres","version":"2.46.119","_id":"@apollosproject/data-connector-postgres@2.46.119","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"638d7680a1e2ff87d3f2a6928e60e5846157fd61","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.119.tgz","fileCount":348,"integrity":"sha512-icJbMiaW3TBo6Ko47l2u05dPUEx/4Kk6Z1mi9xiqBEq2yCHrzUqv6Mb5IGil4xML2YPxTLFfF1aHD3K8ILFAwQ==","signatures":[{"sig":"MEQCIHBiaTntG2j6qmJscLXX4t7+YQUzkDHZXasY8yNMKgIGAiA8mTFnEobN7ZT4xkY+4t+lg3RhXlxvHf30WHYYzF3aFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1120268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQsDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpc2A/+Nyo04/JrG3CV1d09IAS7ixeDXa7f1Yyi67OLE5Qi81BEuX7i\r\nBOooZmR0285A+5Z0Q3GeQncZtLi6Jtvfgk8M3XTVLoYtzpU5R0FHO//PL0w2\r\nm7haiwXJQ2jZzKYgwd/hkmnwTug8ZJV6d0cEiDVxV9F7xmd+84cS+ebXfa2g\r\n6WfUsZFL7eHeGSjXYvRqPKKWgluXnxMKapn7sZtjdpL3Ru7seu6q+tFPjKvn\r\n3NkCkvMe8J2U6aprA4MpV8VFvM8hPgJTgajcE55HUDr9lWDNWDOrefvEDzRa\r\ntZ4TcgBNHFdnmBd1wYFZwY9/ZnO0W9YT2OAosUkJCBfVPJ44ErQ1iaSZhOtB\r\n5iHwT7JyRozBL48czSwqkf4begkQvX8T+nvIMF+qnIaF8BuCGtWTqUJ33p3N\r\nRh1zrp+f3paLvje8OOOSbphsTD60Bbq8m4XMutCLyQ5vP/ROmmxPM13/vLpQ\r\njv89hxfKbzFIKdjhQLFb29of0pX17s9viPNAZF2GAa0OR0FnCMn0rJrtQbXF\r\n9K7TWgzTjWLjtaZy+oezvxzypiH6BF6EWmFWxiW1EbDOwlevLBy+w7+EpTOL\r\nBPxUxvwmBJaZDhI/uI/5rHfxC323LnWNy6vxg4w2IUhGScGWKcD+/ah1GNCn\r\nR5O1uQblwAQR1g3RAH8GFCvIvmGwI7gRrUo=\r\n=Gxr8\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e8e0b762260bfab1dc67021f1d90244a68e2ef82","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.119"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.119_1648691970804_0.0977688555351226","host":"s3://npm-registry-packages"}},"2.46.120":{"name":"@apollosproject/data-connector-postgres","version":"2.46.120","_id":"@apollosproject/data-connector-postgres@2.46.120","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"49f14c39c2a5178ea17d39243e7ae530ae18e5f9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.120.tgz","fileCount":348,"integrity":"sha512-ovx4gkwYcHR6kckKArKndCUbYPx78lJFLJmE+9T9JwZ8knlY4iU9isduL+dUHOSGovAdm/34Khzg+yoScsM6Iw==","signatures":[{"sig":"MEYCIQCErv96hG49FypnoLooL4xDEEfrw/L5DLUSuNFvTT82cwIhAJglgWK2CteaQM8sLI7Yf4E/CLrprgUcdS8CvcLtLDR/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1120460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQufACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrgxBAAgbmpieSirrt7wD0JA5frz3Il6XmxjzXcrhQsPHELytxsrh2b\r\nv4gLd0J0kLYuko54L842+nUcRaTY8gGjPTubAPvbteLDG+f3xGIDZAHBUfLF\r\nq8Y0ySYCtz+ePXKbqqjxyTRh6lttAjJXBR0hHc0VUAVRTphaXw57+fCcMp0V\r\nUpXKW8Tdkf2aimXjsxtWa7YDr+8fqc73p3B7vL4K8zdMR8UVs5DhR3c3G3Sj\r\nROWoilXXA96/Jy3f1rLbN5NZrPFkHWDMDclLMkJcU2lfHzql2AicHCPObAWO\r\nk8l5zguPn6q2ljikN/i5PQ/4o3VIynyncB76+MJ/LHPZJC9uaceDOkGIqE5x\r\nVIPqkR9+87Uqy5eC2kjz51pG9kHO+syNH+rplKTaRxTGPoP8H1QPHsThR0kX\r\n0OLScBNPmu6XvjkoQOrztryU4YlrI0vzPB8bAalF1M5xJt+gClVU/r3QF43K\r\nq/Hvm50ULIMPAx/0zBwufNMTNfZtcGzYvYb+CZmzqR+OdMyVtjNoYegEORqf\r\nxLYDAnpEEzsqM2FomqDfZ9CewMgG9Kqjm6sWlZKsKs+PIdSCElS77LwjGauW\r\nkji2CFXNnnS8ZeefhqXPVlU/FMp+K/i6YOhfzts6Ycc8yYDQTUkE0+OB6xXq\r\nVqpNDA4ECRCSVe0PNUcWawIQYwqJInJAK5Y=\r\n=d8WM\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"24ae043c8126b300f712f71f40ead46b634aee50","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.120"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.120_1648692127297_0.26322003520135917","host":"s3://npm-registry-packages"}},"2.46.121":{"name":"@apollosproject/data-connector-postgres","version":"2.46.121","_id":"@apollosproject/data-connector-postgres@2.46.121","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ec599fdcec6dabffe5bd5f3b6fa08e890acfb507","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.121.tgz","fileCount":348,"integrity":"sha512-jtSqcBK1vJEjuowMvKbxy5TTGP2RfTjnslcA310ZZymftqgsLkHSGvrKDOL6bJ8uumBWucaFiIeMkfgB12D2DA==","signatures":[{"sig":"MEQCIDRWgjWDicuv2UySKKCmHesUsOAX24yqkANefdJKCPg8AiAbWDpMI0Y/2ccz1f/CYqx95DTq/epzSK5g6eFpAlQzyw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1120652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQxKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsuhAAluVBwZeoafE7MvRVeqhsiR9BjkS+b2iyScel8Fs2jt3+YK8v\r\nQF0TqegQyh6u9BsORvwQT6+eq5imMshkMjFesEQYATzhsPW+3rGNi4agMcFp\r\nMAfkBtmCetME4hF00iqmHeWLvjIRXdCOsh0MW4orubWgY9MGW6BCql0ll1Tc\r\n0qOvygNv6dr3FfEPTvZoSppI8BS1PGtXOODABXcw4D0ep0zG8pUDZdLeVWJF\r\nOqhRxtdd+yMA/ybHWnKiE6kQdSlAyBQnGsS5puXD6yczVXozSXV2XQ8NQtHU\r\nWTHJD3oGIz2EinTM/YSFOU6EpeWhDauVqD4LR9NcKwuP33aQEvZwLqeKr59t\r\npbqgVwPsvID76+aszPieXj1KDbdH5LUkE2NxqhZpOcPNhRpy717HImMUhZkp\r\nVbiY1Gt5ZqjuibTapcIS8xvS0+kGmAq+OT3vkO3X/ZkHpXweOGeYqhstS0zK\r\nRfry2dq6c23Pui9lZaDaRG2NqbBWlv15yTf+IauNfxDsMvYqcOINAaxytS7B\r\n9672wRoE0MA/6QhRnumFEoVH+qV91HiIBwUaVFO193LNKbZXSrkg7awUvEU1\r\nHyCAA5lB4Lhfp6+U6PIPybFI3Ul7uEqkWU3MZalZSI2oSLMLA797Ap+KChCN\r\n1iNLHN6It5hGjO4feUO9ZvZAp/bdgIXPqxM=\r\n=BEKp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"157d311be52279e45f1683cbd96c68bdfb724de2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.121"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.121_1648692298452_0.14685869397431084","host":"s3://npm-registry-packages"}},"2.46.122":{"name":"@apollosproject/data-connector-postgres","version":"2.46.122","_id":"@apollosproject/data-connector-postgres@2.46.122","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"5d0f57e65bbe3ca9f0ef90913c571dc2bc7daa25","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.122.tgz","fileCount":348,"integrity":"sha512-n4tYkfBfvAPWip0KSZGSir8bHQWiWgsvFXDyNK7GOW5fa2NTw7HuLI2AeYKS6gZK2t8pis2ExTdPCW6lb/T+rw==","signatures":[{"sig":"MEQCIC/5jO8h8KvaYm2FA+bxnFJypDUO/0PaMKYHY4RvgnP6AiA7hhxvhH5PiatBEq9UX/82EDxilpmuZPMwcvBu/HqZWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1120844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQzvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3hhAAiOwOVKb8CDHE8eVQES86wbgo4L1Tvh5fHRO+oB3XA7H1PR5H\r\nYFvh6O+gr79BgE2z8akiIlJilJlPbNPOc06N7gAhpPxnIJDIRbL7CYeFROSi\r\npimgeH1VowLgTu5scT5l/E+WkYnYu5pYvTHQpnEgLkPFgKh+i8OG9yd8oFkM\r\nvQywxFz/qFSEvW4n9NwpwKUv/QyIe/0bNyP5A8EvFLQ1hMf3M8IaJBQIsXDj\r\nLgNxmx02d4EUqvJy3wJsRZlzGLbSoXsVgzPYDzDNHiVn1PIUrCPJP9kBgFK6\r\n9yPXs2v9Mf1RpD57g+gYOb9eb4JfrgZK6m5SmJ0wQx+rJbEbPZ2wbkJzSDtL\r\nkGtn+UmhWMLbaIVgAnQRehWCJppxkNGrryPPdp/0zusXmdsvqHcWYV0AeqU9\r\nVCA1nIiXDZy9Hnc3elFghOkOMHDMyFEVHyq0bBBswGhdQkL5Ap7uoO8+MwHP\r\nGvg3xYYQvkeVFnOMtnx5FkmlhEGPpBMN3xEbZqtRFG5NZOh9+/1PhGhr2M66\r\nXv4bLLosRW5X//ixn+yHS3515nPqN1Gp0t3a7MyeQNP98qqGl4pjw+CqsCXb\r\nqIKZw/alP4TGOHW/SalMPcFGUIILM7JhT6qFRjIkz/jopj9Vkd+iDXT8a7QG\r\nwB5omJCQ2TvRozntHQkMGmeKrtmnIkW4+jk=\r\n=zrJF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b2f789c85072330715ac09d2bd9b64aa22776569","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.122"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.122_1648692463143_0.005468965241559598","host":"s3://npm-registry-packages"}},"2.46.123":{"name":"@apollosproject/data-connector-postgres","version":"2.46.123","_id":"@apollosproject/data-connector-postgres@2.46.123","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"81cb535b111e5c4b9907360a6344de6dfdad52f1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.123.tgz","fileCount":348,"integrity":"sha512-YuBriqeTw5Z3QX9Pf8bC3IWAHmr04qQgYZFThDhtH+w360G1vR8qLkje/taqMiAjtXbqIqBAVT99w2xd2M1acg==","signatures":[{"sig":"MEUCIQDe6c2rldIc8bZuChJoigZm2vQisptNfwLlwQjYqBAo0gIgFdFOWhhtt5XQD/Iaw9JfideqD4tWZsbBvDeVs24Ytsk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1121036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQ2RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocbQ/9EB1LoLAXNlaC5SZyjgTErd+/3p7KHonhw4IPOiQekivPmDnC\r\n+K8QUOspxhV54cYL+hf9O3SRBCEVUTAaUOYhDXEOIfF68WkZzRSAjc3te8b9\r\nJDxvbSwTFVFUUtHpRGdEkiiCNpiYIWVHueK4Pp7JhgsApisTrApoRMX6HjvU\r\nd8xpgk0/ZtsxBUnCbMX9bOqwWi6bARSuf2p9sl8te9y4GUIpDV95R1iQ6mVV\r\njBS76F4flZqSImjDoQF5pXetAbAU0uc9R8jQCUYZPVciZPRv6yIo5WexJKfi\r\nsr4oMSjErQWBGvSw+7PBELck+6qiAv5Coib50FPgP0QNSFUvOhSStAgBEUlr\r\nWFBugAf14QB6dTIz/eO8qBxGu4AY8ruz3Gktg5KtYkWBj78jvUPNaA4akubt\r\nXpUS8/jirSAqQu2wNvC3IfmLjHz4Kl3BhkA/ukDQ0XTEgxouX6EtN4irqJFP\r\nKtOgmqj92ZeiLgHRWhJ01OjekNKrfj/EYkJaM0l4XGuQiEYMaf+lBSdQ+ciA\r\nc/VE4tdWl42HkA4gGzzm/lrWUDsbM3XB2wK3OXVR1tsv9mrrYY3kMz+B5L2O\r\n+pdhHtCeqe8nEvA+wDD7H59Gqfq195s6JspPctvEC4MUlDMr5mWObisr5LwV\r\nis4cJ6PmZTgZuAn4f1yrBni/LINx3VpKCrs=\r\n=qx+q\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7104ba9463c89a42d7a7e9ff0227b19afb13a687","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.123"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.123_1648692624752_0.3192895762259811","host":"s3://npm-registry-packages"}},"2.46.124":{"name":"@apollosproject/data-connector-postgres","version":"2.46.124","_id":"@apollosproject/data-connector-postgres@2.46.124","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"946f5a877075eb6bebbba0843cc773e4e7b37e7e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.124.tgz","fileCount":348,"integrity":"sha512-FOCDci7KhoaPFgY1BV8jkLn0eJwE2uVGMwRVbT/fb6P8Ajmo9QvRSxMQfYPls0oDWB9fxVaYUdPS18iQHtbAfw==","signatures":[{"sig":"MEUCIQDu/w80gdGk1QwryyYCUq1Ccv2Vt84vm0bOeU4HB097vwIgS47UpEXpN5yGSSlUnYWIUKxt8nLlIIoYV5W2zOb1qIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1121228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQ41ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiJg/+ISR54WZWKksobT9CtQTO55vYULeV97C0Hsvs2FhzU4y1JhBu\r\n+UMB5IABP/FpgrGtRWWeqGFtO5Q6WNkSoO4aSXvBG+dLRkOEAdWZSJyYo82/\r\ngIFQtS7GIiasGqIqNWHmq4UAYR36BW2LSGO1+cVIrOdi4hCJWX9ELUsxeoqG\r\nFvrtIfw+T4f+r2U4BfgJAZXxD5CRSfy2L2ynDsjEf/7dJk+Kq7b5KdnP0S6Z\r\nvLme9bDSUAt8cl6D/4UcwyqjvAu+EKad5nYmhvGfdaiVMsbJTATuM9ZmHPYe\r\naZgY4+6zkp2jwHy+8t9EnncgqwKr8C57Na2KWigtD+RKPtRrglRObpTB0swV\r\nU05lQMT3yjK4WsvQ+yluRKmjow3LG8OlTbfk67k1IuUm+B9KWzuBsALwfr/B\r\nV1j7Xe9asYRA6P2ZZUv4e/U9GRuQq1aXlQEZEzSh3u6kkWTbH56rDCAT5TOd\r\nZhwi/nX61qvc+3MQNTWME/U1H7wP2Gn/6gsDFfHhddCjMLkSxZWfWMe1QmnB\r\ngiNSt6c2eTctZUWMi30jxev47vfTnJCNEgNKoSL54/ZrfGWVdiOYDeYpYLBW\r\n07pVG60TnAdzcMMFO6Mi28NUTBwq9J6qh+ZoklP3SzOB4q8GrrN4Oy30pG1n\r\nItyfq8k0jcr7aTvZRm2lmJ5Hq8AlIoZW/94=\r\n=ZRuJ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4ff4eb4ef52501cdfae66dea4defd5c7d8951da7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.124"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.124_1648692789726_0.07743991777868287","host":"s3://npm-registry-packages"}},"2.46.125":{"name":"@apollosproject/data-connector-postgres","version":"2.46.125","_id":"@apollosproject/data-connector-postgres@2.46.125","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0f9fbabc495425bdb658825ab8a77edb19a8f176","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.125.tgz","fileCount":348,"integrity":"sha512-hT3hxBQgKiRbygx4brvdlbYR/rVsVY8DKmS8PC+nDxldmTmBmoG30niZP7kKllMMwccmN1OrEq7P8Y/YgRTfDA==","signatures":[{"sig":"MEQCIE6R2k4r4KzPha/0+amU2QzLjVCZob6bD0NiX9xkNcCHAiA24TVErS4daA2Er1MlN1oZjQiB0zJKcXFU8fz3sZiy2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1121420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQ8gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFIA//dlA27gBSoGojEHQHsKiIj2Fl6EmqwVV5pijK2/7mBXTPhhze\r\nMoXcsK4279GVgahhPVYW4FSTyTuJfogrv8t3ZUz0N3i60whPXDyuzB9WU+3a\r\n82nfr1dPqwBtZJSHo3bQowqkJm+DxZvntn4EYfZyOkRiae3bEWlgzsoWAJG8\r\nZh+r+vOPIuqIlGvdpdp6r5uUWaOmB94v5Da1tySjXORj/hl0BaQFv4Ttublm\r\nERLXhY0F0oGpXgVpxy51sOqUlYBsU86s1q+FrjyCJsEJjt6grnTCV/5cLuD6\r\n+xQf5rrUYd35RFODf7PFxjHSVOuPmg77eQrb8Z7ZJMvdbh++wcGtzk/USu/E\r\n2TwG7LILLDz40DyoSdrDbiMib3vkbJa0L/RvNteQQZSSSXI5wwJu/pVOsfEb\r\nEcNH74YOAGHvMvW36ZCfTBN8E24FCIFX7gYf9vQiOqDqMCeWhGPgfFYdHaWP\r\nio4QYor72Mu/ky2LXiOG2dX9VTZnomdUpSsItjtkZPXFyP+ZeYVF8rCEyitR\r\ntn91dTuqulq7OQXq+ko9ZM2WKAhoh33cixpeWg/XSvAeJI/OFK+qWxkf5/M/\r\neHMpdSrozlFyQof8ViejY3Ntik2gkXfTeiFzD/WaM5ySqIKCvGbMaFYmTo0r\r\ny0ASJ63yDwaBJzYxf0V3EKq7WmvjwcHJnLM=\r\n=pZSz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"170df02db7a79aa10492d2d1b180b12be51176aa","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.125"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.125_1648693024522_0.4437816219327253","host":"s3://npm-registry-packages"}},"2.46.126":{"name":"@apollosproject/data-connector-postgres","version":"2.46.126","_id":"@apollosproject/data-connector-postgres@2.46.126","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bf4357aa96240eac43f9b4b36ff30dce5f94f28e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.126.tgz","fileCount":348,"integrity":"sha512-NThCNG34910dJ4qF+3GC2g//Mt8ghOmLdvUc02ixHmv8VnCJmthWGCKfRY0gswx4BsJqT33A7OJrF1UiOXT6fA==","signatures":[{"sig":"MEQCIBNxwQ5jQ4OkytuSlVyFP/oobWwtlvoH98Dzbasy2v5zAiBouQC7OVKFQOv4fPHWOlAdI2e0Dt1iVJ+za7UiyPWH0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1121612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRQ/dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDVA//Y6glNGB6vkW8wieoornEuwZX7IDbKN8IUirDRljcba0YjQBw\r\n6EV9vNHQw8MmwdxKsNEIVi53mnKRPXImNqSfNx1Qu+HW4cRoN31/3HYwOyR3\r\niNpTZ2EVfvePFxir8gjZxdGECR41lFHqJL00h+uBC6dV+ch/AXkj5YWCwHph\r\nUW/2jEoyPetepC0xzouPWZ8zHXYXo5kl04MEWWe2AqeKZ3MQfbQoCfTYRidv\r\ngFeFXZiikyuyMA9EY4H4+w9alYtvSAD0BQ6yc3CzwA4BSd3z5wP1hcC6+7wY\r\nUktmY8ONZSlQNSpfuy6bge2pJ7MCCTfSDyvTJNGRvF1l5e8Bkt7vTz1lnD9H\r\nj7onT5hn5f/jLCYLPUeHDUi8F4YUVpUU+ZQUvl7DZ5hJO/jdWQ5gBMicmPIy\r\nCrnk8J5j786Mcv6aCbCBPrP/DzcjtQIG587wQ5jsLqnykYFpnZf2cJS2md7r\r\nIPGL4yZpJIEodvOfJDeo7hcGRuu3qjKvfa1xTAccaMic/Bm4RGGh/NDr7Mht\r\nroh1hUjV/n1tSTzi/BPtpQdG2Uswun1gQm5fv7bs0CZ1dx4u6jXQU8XNVA2f\r\nohzOsz5K0Mh8bhcMX3z3AmxkJEQIIBhmIlJa2IZO4olUZ2+d8RAyU9Q+k+aW\r\nHV1aWsQxwGD49b9dddnh9a7wU7hRJGoMwOU=\r\n=iC8R\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cbdb155d987bf7e478f16854244138baa215e0da","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.126"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.126_1648693213471_0.2562921657394892","host":"s3://npm-registry-packages"}},"2.46.127":{"name":"@apollosproject/data-connector-postgres","version":"2.46.127","_id":"@apollosproject/data-connector-postgres@2.46.127","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f6a521ce8fd555b08e1a33aaa39fb66dbcb6eb3a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.127.tgz","fileCount":348,"integrity":"sha512-E1bpwiUle2fx6LnLwzStU8dBKOe0w089tc0illpNyPqmrUmNQSiT4E+hAcGrRLaaQc/3aDkVwLIWWWcl/d1cyQ==","signatures":[{"sig":"MEUCIQC0ucVymA4MNtaIiVgRedJ2d0vXIOHOg3RZa4HtRaVgiQIgUoHN998x2BP7gkjnXHjzKdo+AU3epjBiv/HjvTYaTrY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1121804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRCoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxsQ//aYKr54hL+NPUiw+eYmfkipC9sTFcc3jAzBw908z/MAk+voRe\r\nJW1RI+g5xZGziuv86GPjkxqUgG1H/AEAuBBHgPZYF2o7DsDb9nsF6r2VxKEV\r\n4dkjOzBohCILLcNzcEmveNnUJFYLd7sVq2T6KvJX4d/qCcNWW+jv2h7WsKCC\r\nv/cgnSzdM2COKX4olgB9xc5GYUncD7vo42LATuuvPry+I8aTXB9S2J2QXb47\r\nw03oOrNNu7zha6vvHtp69a6aiMTZzIev3CxzsrYhdh4UiT/6paw8gfUWMvId\r\nd7w0whsq7cI7VoC65eZ2oKpVcyXw+ndg/S2//xGmUDfoqZsVlat3W71RLcSl\r\nrqkpqZ/4EFXE+pwiXd7ZFXbFbRxHhvzRPshepsRR5LtXXk5lkaT0B+34jmpN\r\nGkN+KMHjrNAvNPzyhBTC6paxSEfgJPXe0gtOkrGiHUOy7IyS/H0Z4gcqfxMc\r\n0JHO/E8XgqrqCG9OtliIdkzq+ARhL9YSSpVB7/oIH9wln7QsFEHHEv1c6H34\r\nik9AW9nNrgSBA0/y+WuaTK/5W02JB2kXdG702bSYOwrEH7Pzc7BZ1feTQuwl\r\nZs5m5whKKDF9GWb2ltQfsPsZmGg1A2TueDuV0bE1G0bmL67B4UnWHmhU7zqC\r\nWrL49j4j2gHf0AxC4UDLAful4WIX5NwCkoM=\r\n=PxTc\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9af74da94ba1f98b472962187b26a2390ddbd954","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.127"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.127_1648693416247_0.23703285648729633","host":"s3://npm-registry-packages"}},"2.46.128":{"name":"@apollosproject/data-connector-postgres","version":"2.46.128","_id":"@apollosproject/data-connector-postgres@2.46.128","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8de1cfa233377a551e346d1fba61954a199b9db8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.128.tgz","fileCount":348,"integrity":"sha512-zKjCspKH1kEOsAFPOD/24g9NWRZ1Ot8SZFCFu8xpO9zC8PMnvpN5j56yBGkkiG2dejLTvN90f6gkFwWhvq8PqQ==","signatures":[{"sig":"MEUCIQC+vboGkj849Th0sW0pkP9nRnUe1mJxRWxor1GYj54ZhQIgA/AiH7A5zXdfc54fF7Dj0ZsoRyPIs8ULYi053Pt6TxQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1121996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRFpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsMw//W8DyviEbn3fXQWiNAdw69I/VoILrLuD5KEyH+3/Xlm1LEu7D\r\n5Vpt0f+V7SlV+J8EwqL6lsLsE5jnPxJh/O3e/EYVEDWuKson8qGlgyaDmIIh\r\n4sSAqOjk/SFOO47H8wQQl0VkUXP/ghUFeLcTQfvEMhmrVGUUWbWPmhc0Xswl\r\noMuf9NkMjoqaJDXf1UFK2kRneUE5Pd0yZUncWAbwP9tU27ITDMQusDJRMxAS\r\nN27q1Ehw4r7elxJ6hB3FNdhS9EpGKsT/RBKLXgp/h94wpzc06u4bSrc9Txkj\r\nCFnrItFUEn+017mQkpORO2i8tMVdjuyguixRrNcFzd1Gh0NM0AmeseOZN/Z5\r\nV648tK7gu3iHp6RjLHK7NxUSoGPme1sO34yORGhY7hILtFDBQ2zW7wNeLBPY\r\nSF0NsZzvGMDQkIqjyLoVMYQ+/k/U8LyCOVDIrIz9CZVheUZTdSv2Cgm0d3bu\r\nm4KUoMkYrJtz6N0O4ld4RBpugsTL9TRAJM1Xoew+1N3JKN5h36lqCtiD1q7t\r\n2oAJptKBK29oscsn0D1nCUvn8AWPhudT/pxPImdtzQ0XOVpFwGsY43oii+yJ\r\n34pGed9sKyiZPY8Ss4qNOgUtQGA/5IJ9sGyyLpdDX9m1tf02iZXCGwZLH3LA\r\nkdRG2kmBt2PAQpfC99p2ZFb5bcjmxmJhdGQ=\r\n=MkEA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2434bc07d091f8756829c94eb98251b6b21b5dc8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.128"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.128_1648693608720_0.6823081889768139","host":"s3://npm-registry-packages"}},"2.46.129":{"name":"@apollosproject/data-connector-postgres","version":"2.46.129","_id":"@apollosproject/data-connector-postgres@2.46.129","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3470f1df22bb7a276b7eaa82713a83ef6b7caa43","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.129.tgz","fileCount":348,"integrity":"sha512-R6saE3Xvr0+CdcfhbJTFfymH3NpxCYn6pzmUsj6KluyVyCJRoub6qbALEf59EMQlhHs9N9vnNJYJCZlix8V3kg==","signatures":[{"sig":"MEUCIQCGelHXz6gK9/6uo4r2pVd8WGMMAs32YCLWDo8GpaBfbAIgMngEFHw3r14jK2V1W5yqCla6FWbO2cvUbSOIE0LGkGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1122188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRJPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8oA/+OAc34SHh5jqxeE3dwrGIp+BNZAt+KqjcL/8uY2FyRdJqZwiE\r\npG7PSLu+puKXn3HCvH1yom28eZlcFho5bAzaMzDZrl5vHxsEZdeDPGe8cASc\r\njsR091GKGbRYtKhE2Hpcek1UtxHfbLf4TqfNl8co5rj7cibCZu7a83Kvo2Ka\r\nKCZoTnOj6SfZEKxozrjB9x05W21OpjrdBt+KTy/zvMW0KgOCSmXOeJ4RYubA\r\n5AtFdPwOzDT+OkCgda/vFCl9Af0I+nIQhMm5dxit11dgHo6GyGtouDcLKMl0\r\n3+blhRfUuQUiM53wSjo1HVVwLA+jNl0EMW6P9lIjEmSAtZn4hWifTG1MRnec\r\nmMEo9sv0OejcH3t0YfunnWNB7NSzCwiucpnv3zbKKE9cQlgQLdc8QQ43G9X/\r\nzNn9Lb08aQT7PVoMVQ8YQzrMODaHufDQaIoqxAOvN4Huh/KEqVY19wDII94y\r\n7/ZD+ZaKLeY3T5pSvet7kYAIahws+V2oUljnX9kDNnSbblk01+TEMCu0cscr\r\nx3TfMZgsX67ZOCcFupMe9oIJh7Wgf8OmKLZM4FSokLOl3oTr28GRxSjfPy7X\r\nENANk9mz71N3daPhaRh+nQsj9ERIwIr/6iR6j4yHljFXJWKnLiafYS74g8y2\r\nklE2Yup7voqL0Jbwws6767Zs+oHLiIe+Fc0=\r\n=S0VV\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"391bff8f6273074ed6a4c87222dfe83fd200e4cb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.129"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.129_1648693839325_0.6763249250261159","host":"s3://npm-registry-packages"}},"2.46.130":{"name":"@apollosproject/data-connector-postgres","version":"2.46.130","_id":"@apollosproject/data-connector-postgres@2.46.130","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"777d07cae67c258e14a999dc2f448638d1918cc3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.130.tgz","fileCount":348,"integrity":"sha512-tYTj0wtf8Ja7K8OtA+gtinPJfGJ/zEAMtq90CzfemM09iUBSJE5s4U730IewsSFeWJnTVbL2V00nRQJZcYTllg==","signatures":[{"sig":"MEUCIH2PD+h6yaIsgQeDvDJORY/oOLfwEo/0sMD5/hTvqwasAiEApv3YIiWfQeizxjlTSwn1NknwDSjnqg4pfmAKDU5WiEo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1122380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRMPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHtA//WCaFh8J4z4iw3oyHkfFHmSzAYHNA+k7JOjWHvVOBlYbgw7cW\r\nKZYD+MPR+J5ZMgt3lpeTAQod3Niupg0W4Q3XnJv4tF9fY9mppOdnZ/sYL1R+\r\nHO45WdWfHCqiFXd8622qjY+UKb3mak9cyKVm3Z/uBYnjFFyOni6XgevMoTta\r\nYxIqHcSXAvGyrgkLggYYKhdNwvcySZuEHRsXXfT6rPYH66qlsTvh34x7tewQ\r\n4qukWv3xS7haxnQiA6Hs7kirDl6nKaUqMd6jKxaOXmRAEqqDlRQTk5019sJt\r\nHpoicNpYgZcoVoLXXnyEVfA7FAUZ2MVgsDZexxx+SfvSy40CuXsGBIw1iZtC\r\n4HmghZ7rVkgub/pwTazVZaWFTv+dbfw6aYThhvie0bVb4fRpkLvHPIfAXTmE\r\n6bbLgMMTnbDk3vjWknMXFLxceLWlg67SJ6VhIg7gezxRfoYVU1zYdiL92qaP\r\nLTbMjb+rXLmdVG3Cf+Ff4K4YOeZIt7OKTNUJ7LE65Zrd5NJIvpCajzScqwFy\r\nlDM2OdW3iTXKL8SmA0tsgxCRFaU94DHjxaHsAkJD55ATDuakIdr1BJl2zZW1\r\nu//09KEhmQeml7r1P5IPcrY9xjj/dFWz+t1v4S+ssmDl+bbiNfKtH3NOn+Vm\r\nhAhfxUaPObEIC6ASI0i9FKI0Ot1AuCja/xM=\r\n=uMQ1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"247aa37f85ea5d4fda1b24ddfc61ae1e449ff19e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.130"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.130_1648694031587_0.5358562095325274","host":"s3://npm-registry-packages"}},"2.46.131":{"name":"@apollosproject/data-connector-postgres","version":"2.46.131","_id":"@apollosproject/data-connector-postgres@2.46.131","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8deefe14ad2eaa68766ad48ad0a61ba12fd48b7d","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.131.tgz","fileCount":348,"integrity":"sha512-h6tn6msG+2tI2vO28v1EUyaxCDjXAVBLwXE58PZbktaf8yFMUYGDptq4G/96vr4m1VuZE5VTR6QXqCR0sGV9iA==","signatures":[{"sig":"MEUCIDth2vYhQCMKQ5vvrQ82plDESiArI18MkxDVNHoCpMbKAiEAwOX1QqU0etKKMh2QexD2v/AzQwrURU+bSBKsVPLEgAc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1122572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRROtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrV/A/9HurrtFFg2/mqt3x5vomLXJ8yDVU29X2oo91/xrCrBG9G/bsj\r\n3uE00nK7P65umIubo9gGV56nODCeh6fj9iJ8RE2kh/Jx1CJj/g+V1484xe3W\r\nDHxxTUp23ZI4822fu+Dvl7IOGVeqW7WM8/9+AU+JrxgqYpYkdwIhdWk3vRqq\r\nRFCahjzqYBc6Bjjn0UA+yWrzYXxEn5N9BSxsM19IWgBTsmUVbxKCtW7RTLlL\r\nveVrdSzCBYZCffHoSXgHZG/PLjSQ3KuY+Fw/gWcQC7/lm1l5XJ2E9ZXDIivC\r\nTTqNvgECMIJkDCu3TB6HhTV/0rhb/FeZ1QbtL4cQEEuktk05JbJ233jT9MiW\r\nqOvrcCVidHtr2Ykf0mbZW+fMqksLJyXpaD6e5LD/u3eaLZ1GJYffuN6gBV7U\r\nZ0Gc3WClOpUQ965vTz/320j5TS+z4RdeUhmYcA3ZNua0AJrIaP0EllP7ltz4\r\naSICwF2phVrzASRHKEyOnBL/AzthH+XKSpxLHmc6T6X6wX/joGR5z0hnbsIU\r\nEzJIayHJEBkU5CZSEOIsavUD0lwV51WXVMK7bHDBgTwTpoBi5T68brrg3aCe\r\nni1lq6HYBUpdWJ5ABBWXDbWjPa9VzB+f2vB+rgKD8bQei7vS98/ZH8rDkFLK\r\nOW8y2WgglwuUi/3NzebEmf3+SOR2HpPdMO8=\r\n=znpv\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ea95511c2da3016da0d00b21be0e1adbdcb36bc1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.131"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.131_1648694189190_0.7790918032047187","host":"s3://npm-registry-packages"}},"2.46.132":{"name":"@apollosproject/data-connector-postgres","version":"2.46.132","_id":"@apollosproject/data-connector-postgres@2.46.132","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b97eb61fb21d3cae510c86ff1ca4c52e0e005f89","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.132.tgz","fileCount":348,"integrity":"sha512-HnZvs3+ayT48Wl0VtVfiuhr2p+9elckIC7dsZSgOzu0Se4i2nRxrpsyGhXDF0KwkDwm/aWtJ5Fwrq4axBUMLoA==","signatures":[{"sig":"MEUCIQDZJZFVyG0rcZYyWLnCO7+1ecg3BzA0zBYzfL8PwxwioAIgefkWe6fpqwjUsZ/Rl78LI03yLNUNuZ5hs9/ZaiSJx/k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1122764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRR5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBmA//XT32oD1jAQ1ZQA0KwvxtJULdbCKBU6HhbtEMeQ7MeYnVfIgI\r\nr4D244WINTKZNxUQPcUcRFMi559GOvUYwX0WA5722HQSHLBsxRlcN+J0Z+x6\r\nrWFprfLA7aG7Egx6hGH8h4uOrnKyC7WHLHLGkampX4Jey3Qw56d/ZkUrSb+a\r\nVA10pixYWZYwM92u8YPqEcRxthCN4TPsTqgR9e6oeJRWd5ptu7ypTzXosKXp\r\neh8hfJx3suVIQWErVCXVgUVvFjwKYkhhcR0ZXONRV11JGNQ4ZTqX/HoXeGZw\r\nyDS5HCSP4REN6RGp2/f1K/zypUhHBzO6D1fmSqMddPUpvsbhqnL2iBFfb0/n\r\neg0xU+q220ieMG1/vDh3Q3RTs/vfRDOOYJQ3uKAESt8TvaGN+0KjXOM5gDRl\r\n2GLR7uY9rQA5zbmL5wTSzBo+LoA/ubsofelxvFkNA1LM/gfYLt5/reIbBrh1\r\n6xJEMQ4WWblC4cs95Tsv6+CiiTYx33geeuk0nb6TZS+nGcRKDON4KPZOpLmR\r\neXbCpYPIyOGhIxKZ+R7oIYv5y5lcJvFaSE71kGuZf064u9DWYdvZASQ+DSwy\r\nAb1De/KyZ8E3v39O5e8P2U/AmHsFaqzYYYN2bFz1OUtJmwcwPZB3Atxofdiy\r\nj9aJHrsBSNY7lJYqkHjHTF3eMJH+gRyxT+g=\r\n=miev\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ab807ea52cf2f3fb7b9573acbd079c87d8cc8f58","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.132"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.132_1648694393020_0.06405801764048125","host":"s3://npm-registry-packages"}},"2.46.133":{"name":"@apollosproject/data-connector-postgres","version":"2.46.133","_id":"@apollosproject/data-connector-postgres@2.46.133","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cf3c48d6060b243d7ea11a48a82d59ddb7e16c60","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.133.tgz","fileCount":348,"integrity":"sha512-xR5G/rAnRDfdIBQFQjmOAx8wyI0WivVCLNFTRLiiboYOArkka2gSAXmpQ0D26vl4HnFn2ciBPzTXjIeRPu+UjQ==","signatures":[{"sig":"MEUCIDMDpt/gLUeNjga9IANgV8coZaMK8IxSSRrKSv7rZTN9AiEAhwUl25tnHTxGbz9KjDsSf8upWxbFqga4uHh+vFgHfVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1122956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRUVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowHg//eniEEG5j43FJrgtQ+fB81lkIpAbxwGte5S7n3aezMIqjFi8U\r\nVdAU87k/D2gx4G/unYgpht20t5bOdkvQwQWZPETt1TW4LptbHYxBUokWa2EL\r\nYIpkdTTvvV5f8QYFlKuOKS6Qtf4NWkb2aeoqEudDqP9CRGmeyaxfXF0wqANW\r\nxThTV05iNZWWw7c5HDQr9Qnwl1v8nk8cT9kwkmJDDryYZcRSqPszm/FQy+HY\r\nSaDSbtY9aQuRVWF2oXf8KDmyngoUQnBIZZ9BA+t+SUV7XFBYBhl9LLXDMDWu\r\nK9Avfu18phqwK2MFySo4bIIwZ9x0/YkzhACCkvLfRBZ34YvIeokKswtXtl2d\r\nS6dC0hN+Zk6o2M+l8rUHBGyk7ML0EJevbnD1MgMfKqB/naowaRI5MsvwNxpw\r\ndsH055JCp0VtUetGrm1FUMr7Af6ASzMGdC2TZrF9PrpM4OslBq6l34aLWmIM\r\nV7t+NqaGmTyofaoprB6/u4WRX+1fMRB8ljVVEIIk6+TKIuYKXdPGos3SdgvA\r\nmSJ9O3xKkecy3JYU2zCoX8o+d0d6tJ5EXkyVBh2pzChCzG1U7o6dk8OoO8X3\r\nFIuK1RjdUDCynH9TsNxvrtw3WRuGHX4EMblWopkf2KYv1pxYiGPJHcr84MoF\r\nu7VOZiXLFu9N81ZO+fMZnjcwNrvyoiAqVvs=\r\n=FrbA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ae9b4f4ac59f32045e76e678d0ea13fd23d86f3f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.133"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.133_1648694548930_0.9424395681446767","host":"s3://npm-registry-packages"}},"2.46.134":{"name":"@apollosproject/data-connector-postgres","version":"2.46.134","_id":"@apollosproject/data-connector-postgres@2.46.134","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2b0cf130e6dfff686e1532e5f34383e3dd5a8528","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.134.tgz","fileCount":348,"integrity":"sha512-UK3VdpwMB6QA0pLvbVaOmp8fU6JkUrnovgIdAxEsVNGyj+NYLTUtRs8EDjlxz8Stz4zzVq2Xzuq3MzIJ5nUfRg==","signatures":[{"sig":"MEYCIQDQb71qY2ufgo4dN1eCKJ65xV23lOn/ofPulqnT1UPK1QIhAJ6/7QR9zQr3huj5bh72Sy89Hn3s9CnKR89HKrt4YhQi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1123148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRYeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpKg//RNSKG7SeSUWK/c0F0sFjRB1VIvt6sm1HanomaXBLHklTtseB\r\nN/fItwV/Y7WIN+9UaNjLH1g9lZcmLdTohVwaKk1jToy52SYpOTxX3AixI0gM\r\nxfdDHiakklRW89iFbkEwXfEt/hfUkaojhoXcAsHo+mfcD5KoOvb6GVJTMSlc\r\nc/3nBmOk/xRSQWHT1FDtpDpBrw9Ah3kXoHfJS9XcTxk9dnwlfcAt+G1S3p2Z\r\nWlK/M9w2m/aNStM7Ww4m0k9l9OpfsguyA93Wk/WbySRkYb3u6JeWSGWwRTVZ\r\nzDw8aFNpEbfK26zupB8MpYRJORs/kBWe3XIMG1RHk6IUIKrhhlu9xyKNXKnX\r\njkVv1RvwT4kDngC1ljBQ1otlO3edo9qRoY1L76l9dQLptG5QMDh+kaiBg6rZ\r\nxnf9BkPrk0BlkvNU/GeoNV7jt7ZIe4SIxO/TBlAaNR60g/QEgufGbIo22Dn1\r\nIjFQE0fQFMpw83MTAHt5uyT+kR6dqaakypnlLzpMtTu68YT1k2e0bEjRIx6p\r\nA4qLuJGBlpllcOG5Lr1A/FuusoE9+LicYWZv5m6TLnLBHosDeEeoU4gjlg+S\r\n9KkYLLmhT0ogwSFbvU+dYUFRGiiBh96esTg7LzzYkT5tRJZ5DBrMjpU0SGcg\r\nTb3qWwZsn7jOHPSmvI2utlRnvHugJSY4maw=\r\n=s5Zq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ff0731aed63697e11b5640726b00d7c53a5cc1f6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.134"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.134_1648694813811_0.7103343969898108","host":"s3://npm-registry-packages"}},"2.46.135":{"name":"@apollosproject/data-connector-postgres","version":"2.46.135","_id":"@apollosproject/data-connector-postgres@2.46.135","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"51614d8e8bdedf31d568bdf5b4b8468a420de33f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.135.tgz","fileCount":348,"integrity":"sha512-OxEIOqHA+EN1ZcY9y+9asDoJH/szl2sOY5jo+O7LxbRVhqrGk/zOnwoCsicMlTxGCkq4rieflbZC/dpDOMkRXw==","signatures":[{"sig":"MEYCIQDOh+ajaXyOaGrfpgnKSCBFE0WBADKJjb1O//gUhfxDhwIhAIi0/647JkeuDsh5kM74LpP0d83jxpPaYe0UnHFOGqDo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1123340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRalACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqmaw//X63SWoKxY+fGiIY3ffmlMGWIfKOHlK3d9wRJb01WNa/wELzd\r\nYBoCLU/WipV4Tak78/8eKqbkuRfJdypjKREZtu2M5c0Jhf4CBddxgr6ys/r+\r\nEdAo+ehejxZK7UPL9cRyUtk+jqgwYz+pvWf0SHHFf/tWWRfhvm8P7KLk7Yeu\r\ntbvYSlQ4CUV9hBTto71/oL4o5F9pD8GRPmy9SNiPHaz1kRoGeX7YhyyvcGjg\r\nITY868pXiFZelQQCQqNcdAktAJfAWCzrqNyFtgNGSCEuVfF7sC/CnxOWPT0C\r\nfqUhh0W4TMHAZRLkySljpRIkA1IRw4eENUAGY9/3sW/Hnx6a72PrddDnkkkC\r\ntYmxOrzbz6I1Pj89j5BJmj4pMnfUXhtq4TSc9JbpMoGSw90lWYwuodTKLUzP\r\nHvzhQBMe/dLE6l4uafWzAwffrHf8OXNygiSPgyPqHvtWk6EQ28ALPgn9giR1\r\nAO8+TdGvagFWwwe8tXvoDk7phPF2va7c63DzkwHix+wRKSSF5kM8xV2LRbID\r\nC2qFBYo6tG4VWVbIZHC3EC5/T0c1hvT+ZRoMMxpg1g2PBHeyMijeIdFvEM7R\r\n8iO3bbf9OSMK7TMOEM8+q5hdpihddQPie0D1n7NrXRDO6BlxDvNFe1MWxli2\r\nTkR0BbqMZmsKrHR3TLLWwE0+AGNbKMzi1vg=\r\n=rAh/\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"847f7ce9a1e9443bbf5921dcf4c59ce9056d7b0e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.135"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.135_1648694949746_0.7370647984878997","host":"s3://npm-registry-packages"}},"2.46.136":{"name":"@apollosproject/data-connector-postgres","version":"2.46.136","_id":"@apollosproject/data-connector-postgres@2.46.136","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d30d0bf03c5704511bb1e571d6e4c4358b6fd52e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.136.tgz","fileCount":348,"integrity":"sha512-PDuF9RB26iOSUEc+jmOI/jJu4mvRfJoSxV1ki4QUoVE3pQ8ctr5i9i3BF6vHP5RcRMUh/8sCmDEZPUPoV268nQ==","signatures":[{"sig":"MEUCIQDTejFCHWc/GYWps7fmY3Nu5fsq1ZqWuO173i+J9iNYZgIgYNIamW3rMXPE9TXAhJ2viUxxIj3Tjo+QiHhRAdmEaAk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1123532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRd1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQ4g/+Pgb7N1RuNNIt9G8vjVKy6GMI0oPMyTTO+O07gkM3P39PIElI\r\n9Wb2tCR+TUrGdayqNbjb3ipV5iFSdYPOZd+/7Uo2FPaSvuP7j+VizAWBwtdi\r\nB47Em4eeIj2uPTO5+lKR4JH4NxCx+tUJCP4FxMGmy61aS+g9Ot1EdTWFk5Zd\r\nmG5qicoO6ALeAnJHi4sb4RLgESPzX4CpjncgHbTKBGoCqaqHUN0aj882CD3v\r\n1FEOJc+o9TIy2wCaAlXUgQ/lD1e2cmIfWfLY7bVXoPK6WcFxYplpsP6vRI7S\r\nWYIK9R7LEzyNcdM9u23DQtyNnV9+RpME+3yeTKsXOT4CqQxDyP9QnvUdOZlK\r\nSZzcOj4Feyv9XkR9/M+mV9I3wtUsOEjgViS4L0xQkHss97JxGjYkX6yF8/iy\r\nC+zXUMgUhra8LMkjSYkZW637E/erRU/cJ/JYM8vN5kBttYj0NljaJ3iXaVAw\r\ng8jdCTcP3uoRlyMpM4lLaBa7cdfQRK5SQJkY8lkKI9p97YeNoPeaSyZXKJ76\r\nlE/YfZz0nMb6gjXWpR+fL3qiDFTAS9e7xGJM5uDzz72wgR986H7wdCMUAz33\r\nkxEGUD9RSMVjNIW4TN09XOxORSmx+Z3WBjyOkm4iOoA4E4NDt5IpSYMi10tN\r\ngGnIfAGFAMin9Z2vLIu3RF9o/51ZlFzvCb8=\r\n=7IQ5\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"4ce0e27a1ac29199bac0abd3ba9c32cfdb29f864","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.136"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.136_1648695157487_0.36486675390955026","host":"s3://npm-registry-packages"}},"2.46.137":{"name":"@apollosproject/data-connector-postgres","version":"2.46.137","_id":"@apollosproject/data-connector-postgres@2.46.137","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6d3b6edce14f6db0018f76c9d5669b5446ff30ac","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.137.tgz","fileCount":348,"integrity":"sha512-aHoHZQC3oaJE6vWtKCLmoJwTtq/ECECHkp5pQPsUeQBwcZ7kFLsXQsZ6GpO0UlO+fqPHDqy7Kra3SMMdrvbvVA==","signatures":[{"sig":"MEUCIQCmAVsqjXQW3tRizwbQ1lJivIkZUJY+TN8NBhzlptUJFAIgTB8y+HsYkqzNw9Toy/YztrNRTh9l5YT/MrSQuSmOTTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1123724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRgnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp93g//RNlZ7ES+UZWA8MtBltOoy9n5M8ED/Z5of6RaYs0eD2taSu1/\r\n65yARpzS99+5uVuwDt7aN4u2iL3VYjd4eFHd+JyqyxsfK98oJtOIq9D9vUUs\r\nkZGf1cVtRcd+apyYaWZPqMl4Mxrlqa45MiAO8BOdzD358g7NggRmwPvG1o1o\r\nSblI33ySAcrwP5TeMQPr7ctHHg2DGKhjHLDDUOP1VBnnNswHPov6+MdzZvhM\r\ncNrnjtdx1rDd0dnnoBARPq4VJ8uY+Wssl5i9MwIQhQ8LNHZ8SSqrFGU94P5H\r\n5GSUkA6q6JMQfjCFEnoUMgq7E+sUwP6B+0iTlGpWKneqsLW77Njj31z1bFco\r\nsi36JEh0ufRvpTuJUHMWjZ3CzBpYl18frij/2ghRTEx3HF5WNNw//Af4PJVr\r\nHenzIO+3OGB8VMCzw1HmJSdCFMMLCh4mf7arOKkwaCSIFwVQs3Cnb+h1a0Am\r\n6K5bgrJeCArz/zZtc7SK9kmgTahtP0t03bbKFi3gofgtTOPn23COI/AbW+nS\r\nCimU9CesO8GwosF/XRP0D9pJuYhs8JX7P1r58VzXbMWZWtdBMeq9hXMwnrbi\r\njzufoGkJ382WyFzN6ImA74BhMoWQEI3OxBaN+T7f2oFS+/9/wog2089RS4/1\r\nyNYnFd1WFNT7xs7TBIhPXTbyL8NguFOTwBQ=\r\n=mqZB\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"89efbeee9d83b8bbc2f75aff54798cb7c6167b7b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.137"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.137_1648695335271_0.7055562563072757","host":"s3://npm-registry-packages"}},"2.46.138":{"name":"@apollosproject/data-connector-postgres","version":"2.46.138","_id":"@apollosproject/data-connector-postgres@2.46.138","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fe7a2e1b2ff7132dabb103cb5ea9be2e1fa80c2e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.138.tgz","fileCount":348,"integrity":"sha512-QrQ5Rc/+h8iJ0Xr6xF1VZOjJg6XF8LUtlqd9/nTP5v2LD9A0/lVZ0trbASoe+l9G3LTiQJE+mmZ9qOMi76oMqA==","signatures":[{"sig":"MEUCIHvJ3sN3xcfJ2+3SeemAvr7L9k01YdvUwg+T/c09ZQy0AiEAyLoN56uppSlEwOHVzQTXw5kgz7fMzw3D/34qIxylFhw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1123916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRjFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmon3hAAjm9nZDGdZNTAhOQuMfaJWfkdo0kMD5FDl5+gutuK/jy5Rydc\r\nR92t1ZDe/Rj2+G/z2pEhUcUiyg7mwSvlMBeldoxKsjez2fLiz13aoyEuiSBN\r\nOHeMrYzAlIUHG8JPtbUn+4hMSIS/uHAQfFbygZaD34bSvHMqMOYW/Ye3APIm\r\ntqfU1M4n2eqVD+XgvhHzF1sywtRup8yZcViCbYFfWkFUUpnBEDDGvvwk/Vxt\r\n6Pbv3Qh/9pgp3bAYoJTg+CjlEzabPAygCnkgqYDPQTlojX67s416OjX65gup\r\n/jiUhLr2xidl4NJXQYGfQ0u4k848/42Pi/rGp7UB/zyMSl0r43IlXuJq5/rR\r\neLYTzgBdjXQs06mpkZ3tDwIUKLTUWkjz+53HTIjU5JwGFcP3OvWGKDLg5BGh\r\nHWnqRi/JDG2TWC5LOjzmCoh3S36dbZY5uVRvEOoE0+zWX1fOtikTWwSHnaCh\r\n9OOsLdJc3G0LN2Bcymy2xlb/ccn1ZY0I9ihu6C+lUS4Zsm77ulTTFo65cxrD\r\ncYYthrk+BTDXjzY1l7UHHo0cpDpGfqXzim5g0HtTFiKzu91DWuwXPOx/L+Z/\r\nzsOs7yZOVRpEBUBg+f0W1rFTA0zUDYQHvdesDUaiyFqhSjiVAqZKvvyS1y9j\r\nf8u8fLOsgpoieiFaapPXEtQt9MlZnOlG77E=\r\n=ITVp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1f24c93d671542ba73fbc04896f17f58bd9a0a6b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.138"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.138_1648695493472_0.8422528220600263","host":"s3://npm-registry-packages"}},"2.46.139":{"name":"@apollosproject/data-connector-postgres","version":"2.46.139","_id":"@apollosproject/data-connector-postgres@2.46.139","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"230e889b131da82b2452654202a7f51a762262de","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.139.tgz","fileCount":348,"integrity":"sha512-n4Byet4wI8pi9dvf3YYbIG/tSLhvrUtwaMLvp3dlnyBQICMeWRj/UNMnMq9xv3dZBHX40J8g3SqZq91RsUD/MQ==","signatures":[{"sig":"MEUCIDxSVJnhKmY5FPtLFNsyxiSzE7DxO5ZQplfAU1axQQk+AiEA7m4/ftHFuiCFmNd4s+30/2scfa7FWeiOAui0e1rAuHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1124108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRljACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwmA/+Py6i8ClHT9t9xMO/t3qf3RVy4JTZD6KGIEbwkgefItPvWIEf\r\n+eRIG1EyS6trMZwdZ08MwyQ28IMAmWlSuaZ8s/KH2eaoR6kudSAQdjTSSiGF\r\nJJ6JjsdNH7XhxscuI+X2koER4QP8L6O5LE+GlKSCBQ06QicMXpu4TA9ONWfO\r\ncvnwvUZ6JSp5e5Y07Z9zzCANmLsxBikv4olP/8rXkIDx0Fyry2HCb+YjiNNV\r\nk+g5igvqz15nv0SGdD81enlfkLmHVrXc/NOhd5Htf0zG96dkfzwy3b0/9ep9\r\n2k28e0Of3uKBrZSAslragXHLcdyEKySj/KYaPci7pg/S5EDYSS8flkrZtov6\r\npLw0zT8caNC1UDKarNzqoIPTiNSYvZqIGHO/oBOgKSqxDugSsc1zh02Aaesy\r\npiUoCOG1kt26WwpwSsGZ3yeuriOYyyZSZEN0Lg+QYABIUTL3IV4CrtiZSKPT\r\ndcV5lxZELscuotp5MkiZR/1br19sl0/aFXm9u3FQ6Zrh5Khpru+cyPLGQxO/\r\nPvvB3NPLIIwJxrKep7hg6aV+QZULiRGgyEIbXFdUFgMnK6alf/NuS1NvOLpH\r\nLQKDvqE5+qWNLvr66MmmyvQ5rPE5veU5Rp0FmFN7l0weXrHIgrR4jHTOiLLz\r\nt4Kd6vCV/+ETkvlk/RmKGnt2GX6xvho5GcQ=\r\n=mejq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d4abab01e4055734accb5897a4f53f5646d1fb62","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.139"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.139_1648695651411_0.8808462537451804","host":"s3://npm-registry-packages"}},"2.46.140":{"name":"@apollosproject/data-connector-postgres","version":"2.46.140","_id":"@apollosproject/data-connector-postgres@2.46.140","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"51944f630707f51659d49d6b836558a527d1ede6","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.140.tgz","fileCount":348,"integrity":"sha512-+hFivsluv8scMGaI5LxZO4c0lPXsPImM3LwP4fGTPkrJj1waebAzotkuEqDqmEmLW9JHiZLgzO99/gS6Cdoj3A==","signatures":[{"sig":"MEUCIQCo5bH3jFVzfiEijBd6226Ze3MCgtwbXhL1cnx25eORlgIgVlT1hCUtDaYlEYnKG3vrqs/9nOCSwcpcQPp9kssdjss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1124300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRozACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyUQ/+LtUfdhPqtr1NfAfBHDmSd7rTFaVBhmAjmpKjOCxZTkXXBp06\r\nVzTxuipZWMzSM6ayk77MTOUxYxXYvvZqNfLoM8WFJcpgUZ6Xiccst3YrFRL/\r\nSLUhlrcvhira+pK+L/SJXSpAKMoQDLBxx3nIcmoMQcm+4Dmyc9A22xgQfv23\r\nUzTdV3siKEWxcsF16H0/Zt+HG3EQ2YS4jjb5bTYfq2FhTxC7ylJZJwt2W2hV\r\nYxedobIFE+oRmmwScVpzLIdh1ikDwE7BxaF3PLekEpyMyvXvSTWJhxVbIMFk\r\nolTxp2ymqwPvtBERjdGjeEoERmfZ62XZs7+44hR/bsFIevBLbNXmr1g4ZfhS\r\nMX7HpBsdEYRNoNFrn1XpU4vlugH+zrZrj0xiVj/PZAZUdRvK3ASpxv9/BLI7\r\nWOIlVS/DhFUfOf5JKo3JLjxmefdWK+gJDamHJs1043iPLfezVHm8fdJDhyfr\r\n8/ASGEiGs9yiVTEMNC+d9540LprlskGfHC2EnNW+KivcSVmXY9/9OqRFjjo+\r\nnWa82Lcd2Y75JcY9UWGjWkDUCub2XX6p38Ubg+cla2FBnAF4YQ96BthlbfmU\r\nriX5OXeEgZiHthsH/fPnQYl+grJVq0rGQeTqQQpCCOkzfG/jmj2VSwOb/r51\r\nGoU+lspF+dJ2sCl8lkWQfbqMacywbytFHv0=\r\n=Uz7G\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d90db71eeab7f19ef15231d48549f70e7ef542bd","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.140"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.140_1648695859084_0.31654563307742856","host":"s3://npm-registry-packages"}},"2.46.141":{"name":"@apollosproject/data-connector-postgres","version":"2.46.141","_id":"@apollosproject/data-connector-postgres@2.46.141","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"faaeb074c09e5c000741da02976e8fdb2ee514fb","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.141.tgz","fileCount":348,"integrity":"sha512-qAvYNJRngXEV7SpUxCnx15lAcvqWyuODvcxaQ/Gofg/HGsYHUFbUbgNyTN+6i7vDRKGf47+nRzcs115w3MY5gQ==","signatures":[{"sig":"MEQCIEE5GqJWHQVyKNNfzvFJ5bcBKXiGFMpBH0EL7LJoVth9AiBSotieGmjyMLxseX6QGl+bSz13cXXHkq3KHxEmLXL7Ug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1124492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRrIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPYg//XZLY2jCs0oeDZ0ejyLuHcFS5JkiZEJs7Ictq6waE7TwExi/x\r\nzL0SrcUXOspbw7VZCYbCsAgiV4T2jvAYswVy1eDliKyelDUZGAI1mV4UkKTY\r\na6GhBmw3Tqw1GIa7j6GZTAbbH+mfmzqIX/YaD/btLfCThZQ6yDXSVNSe++JM\r\nEYCOHh+1CVWLVNgDVvqcgN4iTG3BOiPA3BosCnbQcJ5Urj2sZrRS9q6JiIQG\r\n8stshXOAwaYftZSEp+LUxdK0iFehg6TE6FVgMUjzDy3L8ZQ4q2jaHx14Xf7z\r\nnnPJ2+i0m2qGKqTWs7fClrq9ehOCbUmDZ3oj/gkcIhwp6ywfosa/TYPH9Ahg\r\naHjM/khMZqHcReGrN3Uy3lMK/uNgSFKScMZSOVRno9wTGMPOUjAqSN+KRuI8\r\nsipyadBedhkxAHlQcRf9kM7GhIJHKdO6KzmruAhmx39EQ1wRq9IiVOXwnt1a\r\nyDzC1PAWqtJ4NW7b38Q0HA4fZay3dDeQan6MR/2vjEzYCRL44pZg/+rzP9TI\r\nS69yDu4AqO450rGkZEw0gv8G4f0X+sCP0boffFrxaaDi7Gu+eKf1JA9wCT4Q\r\n0NGN+Bm1+Sx5wdJ1T/PUqChWJtSimQOu7stS1DQ7WxYTIPLhxlFQj2s50PDj\r\nZCygmu4XaniojFSLssU6w+2DnntS+QCAlkE=\r\n=9afp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9f9687487cf7db28f7638a3b600c627524e29bfb","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.141"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.141_1648696007988_0.2943954521814529","host":"s3://npm-registry-packages"}},"2.46.142":{"name":"@apollosproject/data-connector-postgres","version":"2.46.142","_id":"@apollosproject/data-connector-postgres@2.46.142","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"62730828bc4b82ded3fb54a40ffe0bd1f40a6118","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.142.tgz","fileCount":348,"integrity":"sha512-cOBeG1QEsvi0UNB+r1wcnZOX6DSqIy9Iq4TQ+esP1bV6TEoEijjGHeJ8PpSsdUYYGKjaCsAES8L3SFyeeD4Zfw==","signatures":[{"sig":"MEUCIQD2JqC2pw/Hel2P4QmHVEkER23uChwc6s0CzLpp/wv10gIgEAYbTFci00nocvwAb3QK8F3MBVj7O7D6Eyw1WbyGBVo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1124684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRu1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPPg/9GjMVtSDhzgUHARvrNt/TKFHMFS95sWc2SN8kq7W/yQIWBwUR\r\nHUWV+DeXnj3L7cF30m5QzCebBSOSDPpmLE3tkw4BuylYpaGFbofVNSHvSqPx\r\nFBe6iMb2q5KCwh08qweLjFMo19pmg4mQdhU6caENA7vaijLf/DiD/2Pc3nQ2\r\nNulK95lGoV2wA3KVgKz2BQRET2fL3EhgK9fFgWNCKQOoSJ59SUOpNvzj56JD\r\n5l0Q1l9z0ERoB9tqqDXPI1odCHqMklLaYTY6W43fBU/EYqRwXaOJX4HzxcwB\r\nP5JQYxLvnVqA0NbBw1HrfgAToMFwIogoy1/Opd0+zx4bFYz6z7pdbtLaKGc2\r\ne1WXHLwqxCFYPWzKEbGH4keUGYxeytkcA5vtEAlPmMeOwVI221hgsAH/EH9M\r\nIeLTgVGHapxl2upWHCV2y+RBPY39+a62SSVpL1ov11zff8WC2OLf3qjs6xep\r\nrdXLN4Fn6Q1vO5nMlHL9WtN4PNLLYEdFjAwC9DVMFVNxjO5wtkChnitfdo0C\r\nGKpPANelNIFMLk2DNeIlRRXM+0mQCBEuPICi5/+GtGgkdm0K+cVMeOqUGTn0\r\nGaygR++jzCH4uKTKRvBNcukkNYTvzPTbJekP4ltaPujCB7Iy5r5JC06hvi2t\r\nL9ysUjCGcGTO7zjn6Bkz+YLjnOLd3RRgLnQ=\r\n=rz/X\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d1234592b55577d3c2a697fc5ae4154ab6f5916a","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.142"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.142_1648696245274_0.7557726711117616","host":"s3://npm-registry-packages"}},"2.46.143":{"name":"@apollosproject/data-connector-postgres","version":"2.46.143","_id":"@apollosproject/data-connector-postgres@2.46.143","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2b3065f89cdb2c4c08913bd06ee0165199ff7d47","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.143.tgz","fileCount":348,"integrity":"sha512-Hiyzojuf/h0NLwaTDEzVLPp2dSf1ojBMeGZfWxQu0vQgwvfeEf8HofRBWAYYbXNaRZdgKaIRvETB6BXXOsJAKg==","signatures":[{"sig":"MEUCICv/ZaTqL3AazhTR4P9moEUm9Ic6Irx/Ros8soWo/iZSAiEA3P4+0WlNCa8zlkzu7QHbu/0ZOSohkTWSiGceZou/ozM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1124876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRRx3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVkA/9EpzizSO+jS/GgKOOwa6Owg/hpjFJiBUCPZ7PU81xDzTe3t0x\r\nnaMiJwXXC/wubElN0DIDdHMWC80xQLmegBb/aTfpOHsQOYE5yW05F639CmO3\r\nyO+7z0vq3rCWz8xpUG66OHzEyZTaHYkgLAMByt4I93WUMkOleo8bgTL2XSPN\r\ngoqKODaCNJC7qIOkg888dsytloWKmIt7dvXlmEedV3drK5KIyWhgqrREWQAp\r\nKg1KWlHr9QmKuluWsUbMXc6RV8igHbli9S7dlCnNpEzR88wq19kOYsRvve6O\r\nSy6ThBd7g+A9UPAM/PqhoAdNyAUBT6hS+q/s5DqU7UdcyTg9jktygjAxXrvr\r\n8ZSJglrXJA1YN1dhjnqphgo5JgRoS/ng/V4/+2BCVlsUyktmggC8kb3zW2Nv\r\nwQJ47o29ZYCeH3Gzh6rxKN2jkQraLqYv5k5A1UVZCl8x+6eCCdByf46BOAwa\r\n8sZOJ5cHQy2u7wqi3/GTCUYGhoLLaMCHHdTy/ZDgSTSnIcpmu62QGxLl0Z0C\r\n7FNxmg0NXV6cLRTGyQpE3lHVYuNcEmPtwG40YbONqbOHXGDbC9/ERzRNdiH+\r\nwbbvmr+Vch/Sta4sRnZDlBWbfysWI6pwy4V36VUQk4tAhHyCO0gSjdiHaECM\r\nFlch1G4uwPcPxyKhMuA27Kuy8TyHGZth1kI=\r\n=P10I\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d8f0fb7e1bb81ea11c772746319e5219f484dbb9","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.143"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.143_1648696439800_0.8983740442942305","host":"s3://npm-registry-packages"}},"2.46.144":{"name":"@apollosproject/data-connector-postgres","version":"2.46.144","_id":"@apollosproject/data-connector-postgres@2.46.144","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"831b8c5b7ff41b95dc0512e6a306041bb7bc2b8e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.144.tgz","fileCount":348,"integrity":"sha512-K6OiIbEO6aPmDp22LWxpebrz0sPUWyH+cY8LKeACYB3sAZrQDjOfpT7mng0YnhGGpmW8efqFJdglmkM8bjBgvQ==","signatures":[{"sig":"MEUCIB5bHp0vD8WiIb5DUuiz9n6sk4bjhmInY0g5AcYFn66YAiEAxPOWG1C5oRE+8bvKZoEjkQlsr5zSjXUByjjZN5uoLFA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1125068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRR0UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb6Q//a2ZCkm14bdT+YLLwuDR6MNX2d+ZZ9xN8+vgjzz4DAzw8rOEP\r\n2SgtmAIlHteGQiIwu5nIi70FwKtMKNYccqNtn71mQmGJa0uLDBsG8ltUPT5E\r\n50MrJpeVcfK8yqygQvCMA5O7u6fRxwzdlKRidkkXnUmcAHMN0c1nrMNdiO5g\r\nJwMzYNmGOvL2hLYqMQ+U9E0aNtG3B8DD//RUl3ZJtUt4KrEP+KlqLoX7as3/\r\n4tYVmu+hk5jz7trgF2Ku6NZxNjzSBo46e6FrdRu9SrBLJcufV6l1tJeTCx4M\r\nNpj58N01OgXNeXa2PHxnvzglngssx7MT5nBbUNWtS20kABTgtOCsPS2oFF/Q\r\nO7g0fRhA/1h4ojvyHjwrSuvRiYJ1ugaHp9U8Wf4J9TzVcjC8anvp5ctPpkma\r\nzFcI4hWqwLO255SBss2b7PpsucBHOCt50vFIWrkUJPadFJVr6Af9SsIU87fl\r\np0jkllpKdiwZFQuIPY0hvVJFfsOZWlfhCuADRS14Av5yzEy57Frz5AqYbzUI\r\n+VY21aSX6KZLGi22Ib3hGU0qFR76LpUxUMDKi+6yRvQhxJlYGy6PGxaTyfna\r\nDXyA5/V8gy1KSccllO5gSA1nrWEnV+xocXb9SKhG//seCniOkRm0x9yzxeP3\r\ndUGNPXT4bba7UJFSWRUAZKoFPzttsmtKY4o=\r\n=g297\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b1bb1f206d66cb240700f252548e8021b0a17652","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.144"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.144_1648696595871_0.597959758725467","host":"s3://npm-registry-packages"}},"2.46.145":{"name":"@apollosproject/data-connector-postgres","version":"2.46.145","_id":"@apollosproject/data-connector-postgres@2.46.145","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"9aebec29ee5ac81e5c348c5396bb29663ec05efc","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.145.tgz","fileCount":348,"integrity":"sha512-mPgaLABVE5I6G/0iS1LnT9ArIzzvrKEUayItcaYflNcizfWJOlkYTN5p1TTZqOHtVcbVAQ2+2mJQtyCwCy2HNQ==","signatures":[{"sig":"MEQCIC4yBu5lanYyLbLQZ4QRCBK0s/FbDjRuGx3VW9tUsCz+AiBHkKAUegfK9Q18WvsVKcETx8KhxGpOHTvxIBHeT/dGVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1125260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRR34ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkOxAAm2ZcuvmoINSf3AJv7J+JhCT0ATcphXlCKR9rcMr1sXXAFqgc\r\nQsro89LysqEXgKIPF8tb66fVdgTEhOG+cji/iqvaAUrIrF16ReasHkpUiows\r\n/F+Y8e6ga4heoxQVgXiyVQ8ssjP/7FDFJMBhC6tq1KeO40OougzYBN8XEvme\r\nWEt02sVyC5Ig7D/EL/CW9mgafK7F3gzbPPRB2BBAgVucP21gdYazUWq/JKSm\r\n3FPBvD1LvdcnYZC21WOcBcFu14ht/97PWXZ8uHBfa9ulnpNdYuH7ISEjPCI9\r\nOUNdnMC4EBrdvHToINHosme7FmOsEoCMmGj7XIKMTxLBs1mPCTrGXEU6l/hv\r\nsgI39OIKHIU7h+CQ5Ohw6AQKjiMaAtrcZEJ1EVbmZPKdjPL/tssJKNTzbQs4\r\njqTDj1w01pDT613flh69qPidKvQWH0Q5ELK/gV4roMNuxX5sWAgrOYnBm7EG\r\nvnAhS//u22NB4xR81Qt60dsYkryHF4r4COtvIFloas0ADh5r+A0JyqL5Kz/n\r\nTSxj7g1I/cv/Vu57BHtSGJHfZqEjRLn7VHMSEFsEw1J7rOEngMAAv1w2ar5O\r\nhBmO4HZvu7a5fZ33ZtrNhlCfXPhl51Hlx3FMGGHJhIE+GerpuYsVzM+f3BRt\r\nVm0bkBr93ycsylSh47hlGvE7PyixNnCygnY=\r\n=PP9w\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7bbc217e125f890865f76684b315c296b4e55361","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.145"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.145_1648696824101_0.5684865468704423","host":"s3://npm-registry-packages"}},"2.46.146":{"name":"@apollosproject/data-connector-postgres","version":"2.46.146","_id":"@apollosproject/data-connector-postgres@2.46.146","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"98e539b271faf53958b7e14f528d510e37915fe8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.146.tgz","fileCount":348,"integrity":"sha512-zmxKR9ehsNb4zF9PZsmNLHvZftABQVbfGzxr+7bfKvBoixpvsGDjd6v1388anybwlGO4SJLMFBRQJ1/J2yco1w==","signatures":[{"sig":"MEUCIQDmXUcPU7ZUB1VXsysGcANS0SpEsmIOBig1RMXDdIYQQwIgSX3kpC3VYDIk44hpD3YBd2Q1nKz6F3CzalVkERrKIxo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1125452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRR7IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNYg/6AqXe+kjb3Pk4+Dwe4whfyt78VyaySGYsGbLioqtWBEEIJsO4\r\nzcr/EMVucR4YXrYreidW9PRnQrgtjTZ3qfpogS548p6YfwRfaLDCp0BxzwY2\r\nOFBWisOMl5A+gMbCS1gK44ueQmBTjSQ1SsKFagyywAStcq7zekLEznV6evAX\r\ngsTiB/qZ9JpHK/QzmFZacxD43Ei+JICFs2ZIWCSXQ2JLL/QMouX2e4oSFWFs\r\nFcMjPfaMVlRA27todyYhE1J1v9xJ+iPXCAHRrJO1Ig5PAuBsjTk0GKASvh8j\r\nowfZ+V+2c+WtN7WcNEdJQ3lgk316EjnuvKeG0JMFwEIuaSrLSAQylijLoZtF\r\nHrFsyerdhyQFGtMQnhhILUK1zxFjeELDX+SE4DnmaJ2G/mJc6HKNwx6Ym7Xv\r\nyPZHYca+oIEMddFfEPriLZH9d1r7FlGRuQHalevdWljvROGBNxGXVDw4rakJ\r\nPMmjBjVczl6PHS6ljmt01UXSSgpDTQwSBPNVj1XpZr8YxyHWaRH1ujn0WRv9\r\nyiNu/l0h3jlJXZ5bT5ITjICUu8zy76hu7IsFG8GbQ1rALbWihsjc2Hn4Mo+U\r\nKNM/goKlB6ScPlMkHx08SJE9rK/aP0xaL3WAJEEQdCnAiballaXIaiAFc9ce\r\nUtW+HVzO0lzuLfaPWyvd6uwP4d2pgze2NKs=\r\n=tPfs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"ca052b1487c4b77d24d491e6d7126b46cc60f69b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.146"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.146_1648697031854_0.8929009113723914","host":"s3://npm-registry-packages"}},"2.46.147":{"name":"@apollosproject/data-connector-postgres","version":"2.46.147","_id":"@apollosproject/data-connector-postgres@2.46.147","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"978116f8735e7f643b17e4878d911f1d4089e2c4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.147.tgz","fileCount":348,"integrity":"sha512-beOTW56ZczZClO2tRfmMkJqyhbFvqWZAbmgacGEx3gcm3USARz8+tpLzmTeJbXaLgilGErR4jORRXHi6nG1YNQ==","signatures":[{"sig":"MEUCIDR5tm0wlQkdKZMwwlZbXgXs2qRTaD4vlWuo0oxBsm8fAiEAx7WXSDQ5BVMU7nVqRm7bwcQyCybLYF+d0hXwOyImaR4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1125644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRR+cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbEA//QfgLeGyJ449GOZ6pyNhUrrfOdu0EYz8o7zFGUI1okF0NDcnN\r\nIeH3/dfQHcLyBxpRN43LH83dFdmwAw8Yda8wAS0Xm4UVcLTJDXQcfq+90gBK\r\nAg0EnngoO9uDQA+ydUZq2Sc2ZjjV9MFO/dQ+S5UUHcA9CFSQBDPXhx4dagtl\r\ncz1xH6J+9mE0h/1mrLvnIczc7ReR/bWC3EfnGKXt91eeIqPnDXTgLBENg+qY\r\nr9tj8yibD8Dz474ltHa2EcQ183rPPGw2U5uM3wYddniHxhtehQ13FkFtRotV\r\nEgvmW+g/w6CbYdQBSj1TlGrxVhOXKI43TOGQN63JW8c9EyZjaKgvsBldSITT\r\ntWWfxjTvI8rpmC1Wmoh7klXSjw6ykKl1UqBa8ZYXdSMY0X/CBx5MGco+asyV\r\nRqeVjQqHowJrOyNQauJTTZSJpoXNHAhBt3R5zkohtDVduwxAFRdP28wfxBnu\r\nkhUWQjpdyBgEIVNTtHVcopW+gyxNVHdiYxd1kjrTaZ1lariKV3oY9+4RlA0R\r\nzHTk6ZzjXLsoHCAe54DVd1/uUDSf5bXJXIAC3W4nClyJnzz3R5K7ClR5R2Bf\r\n2dW0JxsIt5e32lpASlhUHWIGpyPjKFvFKS9d3ldnMgUgGYKlrlcy/NvJVs1E\r\nOcMMKeLm/i5JkWFZXL0GBJZgSRodbIktxeA=\r\n=AjZh\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"11ac560fbad7159656a3216598ae16ce032c273b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.147"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.147_1648697244379_0.3156567243640467","host":"s3://npm-registry-packages"}},"2.46.148":{"name":"@apollosproject/data-connector-postgres","version":"2.46.148","_id":"@apollosproject/data-connector-postgres@2.46.148","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"486c3c29ec67d4d05d370e63a8660844ad0d34d1","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.148.tgz","fileCount":348,"integrity":"sha512-+rGK8UpuaDHufE8g07pcYtVAHa6ZRa2efVJvuauA5EQJkeApVkrMYVKZG4PT0tcC+8PQb8MsyjOVacw617MpNA==","signatures":[{"sig":"MEYCIQC26yo69I9a9WPR6V5MS/MK1m1ilfEb6FzKqMK2gtkLUQIhAP9HvR0xi2Hba0f8UzWVS2gZUvkyDJ7TlSk7x/lsNf7d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1125836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSBMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmohzg//fgT483zfqH0Mtp8BFnB6qa3uAHmMUVLvvkQEihy10GgXiZpo\r\nZneaXnPl1IyNKDCcYaJs9GxNcJnflMqwLkirMdQMHRZmcmB9hqe5oEGMdXB0\r\nipziEI5bjJPwyeEVbXQjcKoQc7a2dBOAnKBzKMxYRbFnH7wx1XF6jzTHyOkH\r\nehb8pdQJltUv+mGPXXPS4nUJsN/C38O2B3AUwkV2VqHR/B1+Z+Cvuj1OgxvL\r\nrf9YA7iVlXb11OE2EX4AhW/A+EpLmqmrqakMd3CdprtaYXujCWpji1O5ulEl\r\nmV/xmvH1AERKjN2gyYqgwO0SnLVOgA3Quflh2JqXS4jpDFcTCd0S+wBQ3TlT\r\nOJSB8vBHLF6x1z68xkmG+Zl7k1VZopdLdoY3ihJZz9Z5GPF4wg2T//JHdziI\r\nMF6JIbMkbB4OztqfYGFLwTg0gjJbG70E1XOUK3Y6VZkY7DlMQbv/bUQdkw5k\r\nLMpDGGdVX98m9lZ1ZhQ2Fo//8qYlr3V54qo+ZzV7S5FnjIwHYz9pKt6dNxSc\r\nDIKci4LncPrsHUv/FKfN2RuSqlpJdRd3fTeCmX6xc23IcUUpqcFhxI9q32YK\r\nSpRSbSt4xNd6JhsttIebyQg++wzN0mu7EbZstwUsQcvCT8LyHbK3uA6GDS6w\r\not+g75Cx/YdDbgh7vxMLTi3AukFLeZwOpx0=\r\n=eEz3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"805486007e214002f8f2395a13a8d81cf8714752","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.148"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.148_1648697420228_0.4775910771620584","host":"s3://npm-registry-packages"}},"2.46.149":{"name":"@apollosproject/data-connector-postgres","version":"2.46.149","_id":"@apollosproject/data-connector-postgres@2.46.149","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"07c96cfa472546c07ff0348d2f908e007cce33cc","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.149.tgz","fileCount":348,"integrity":"sha512-iOuy6W0sw551UGLJttcFZHNm17X8eQPURQ0P/WntpYFPDh82Mz3hxkJXv/vqJxiauFcy7u1FU1J3uIzNmTQH7A==","signatures":[{"sig":"MEYCIQDp+PLCEeT0A8KCG656hgGGbNc+70ryaNBtpWcFzh2EtAIhAKUzVMHyVIt8y9e6XCfl9o2JhSVqVVnu89MogChebwiw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1126028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSELACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9BQ/+IBd6Yo6Di1y8KztSN5UMW/PU3QDsxzI/lUsNq4FJscs+f9E3\r\n2jCXUn8yEyl30m04W2OA8SEG0Msbq7n0HsSVTtEkYROkJqKZkFCLH/TqDgZg\r\ntc3y7Yi2tbWgaOOGqZ0JW6hRLqeFZt+FhWGnjAVFthXL8eRdSVPgOKWIE8EH\r\nir+TRCX8Dx2gjWQI6YYKMPDHbPG+ZTZuJxHKFTbRKo+4H9s2sogb590qJwW/\r\nZ+3icIslY4nJuNPNzhBUAfEx8JAqco+uBFtdZMEGBesGzu9UBTLCTxa153Gf\r\nKN07S6Fm+hsPsE5WHJBpvcoVb7Yxsi97un5xybQZfEuz/SpmfoFC61KxStu7\r\n1lvLF436N2R/m/kmNlkA51E4RG2dUzfxMXPBtuJwTr3MXvj3m9Z0BaC7o+bq\r\nYEIqFh4zxtJlN/BMQkAS3OAmkzTUPv8U5SDninAp+vR6sgTA20mW+hZ1quLo\r\n3wbavAEsWWZw5N8ymNwfi1bqiLAD6CLSIUZiDsfIlianTHgV+feFI4EaJbdj\r\n+wws+4p7dsu6efP1rvKtkbmJeV+dntuks79lBSmxUFnc4sEUlvpqX6IP4e14\r\nafbDFUcvhj22eKolmbKI3B/vJGlwbZYy30akm4Lq36XFfneEFVVHD6OTkuc6\r\nFUj4beRujTxHP7T4Xo2IxpmmuCDWaM/wzLs=\r\n=H5Gh\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a05812956ce25631e9530bbe6fa7d72608acaaa1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.149"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.149_1648697610742_0.913818738681335","host":"s3://npm-registry-packages"}},"2.46.150":{"name":"@apollosproject/data-connector-postgres","version":"2.46.150","_id":"@apollosproject/data-connector-postgres@2.46.150","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c0b07ae27d72bf4c8839beb3256f1fa4faf2f6cf","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.150.tgz","fileCount":348,"integrity":"sha512-C9bV2TXmGLuelulE/H0FUAJ9NU6Ki5YQArBwHsZDvL0r/3cYH4q2wI11xt5uovI6jBTklke40FjEvIxQgFy7jg==","signatures":[{"sig":"MEQCIDu5DkwFqrMksD5yoridIUcaOuoS6jsuUqC297KdugaAAiAotSwfKRhvtYDLNyb967SIgMz1dxnIJx6a+kpwq+4C/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1126220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSHAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqHg/8CU3r05snvV9nO8jPWri8vhJuybqqe+jBMwUDvgf6nxDiRjLa\r\nqVi6qDZ62Kke5W4pD0AtOFPKd13Lq6ELKf+z7AFI/F0MWKI2xQW0Y/mue9l/\r\nJdtoB9o446h1yk5c8cX4JXylZG+g3urecHIN3GlAen5z+0Hmt9d3qAMVtq9B\r\nEIr0LVRuZsveSTsg8BoS4oMfrx7JedURKQMX+mzFcLLcz1vM1j9BVeDmxPTH\r\nZwT4XensaIV5xd3ybwjFYs4Zl9OnUzhzuolSbDBJzBoFVxQYCaLGdlxRZ6wa\r\nVrAeKKfDeYVvLtVJkV8L3P9KZhflyF1MXGvVKVtrt0/8Im4UVq9WP69m4SFC\r\nz5N1/GeQt389FY9eGsJZpwi8ZJTm3pgK4g/dRLqqKQVA+qY6DXObURkE45RP\r\n5sL0FUU9MyuU5Euat57lTeOX/YbQG8iiJAhgkubHHEzNRgtACrcRsPDp22v7\r\nuX61UfUqrMSaHAGDXDZoaRlswAPW63JJMQTZkXg4pPydNGZQsrzYXjCJOjvU\r\nIqdYkz3Z0xdOD4xS3a5a8sTF2sGEKVuKWzHyEAbuvS+w+dGVL5DkGFtL7AD4\r\nhi+Cw+wtZ0WcaDs8r/1aNYcxIIqwSv2PXjBLqOn4GlTRiW/g2s3ZSmg2fonh\r\n9Te4oSL1arcBbx3TgJuPZ3JDuzXe9VoWRX0=\r\n=VMQS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f28a2637c1b059e39c0f6ecadd1fb4df1d43c8ae","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.150"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.150_1648697792193_0.36194212159544614","host":"s3://npm-registry-packages"}},"2.46.151":{"name":"@apollosproject/data-connector-postgres","version":"2.46.151","_id":"@apollosproject/data-connector-postgres@2.46.151","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bfac0f3911e9ba4606e68ad9e827c4b7b3b2f53a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.151.tgz","fileCount":348,"integrity":"sha512-4TEYbAhXoaasPm8VJrDOn3ZAYdZHN3hmd88fwUlnleEBiJ6qkUax632vQ1JM08fRyNGIzx+QhJroxfmLSfnRKQ==","signatures":[{"sig":"MEQCIGFVZ+BDwkdz+xYwYg1bnQIKAgnwj/i63ehqLBKU+7WsAiBQ8un0jSpBugbgbfStvpxtGXK8atspNY5lh62rONKoQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1126412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSKqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBDQ/+I9MMtjx5uRHWCLfSnlMJQE8UB/2UfZ27gtlYrsm2Cm0hOau6\r\n2ialDCfqzpAGCgAz2j+J4vk1t7wEtryFiMNDx+3dzTgbQGZXaYhyZ4xToI4p\r\naTnzX7GmIyvbFuQbzaHe5dDC8yhQYvwN717PouOEu+JUqS3ozxxRao5/wk0Z\r\nAghk7goGo+nN4o5VRL1uMw803DdDQsgZGrKu3S5oo4FmK9r2DKF9JRgg5WgC\r\nULmqZny7nHEv9hyk/jGifYEN+bmFoP3i3anEUJgazWApwTa+X8aJV6ij+Zug\r\n+SqJmc9urNITDYeL75YBiIRscyRNZKnVxP+oVWV7ukxzxvLSwnkKqDVQLRDN\r\nnN2NVt3A9DsHOGljB5wYN19DkTYLfk8d8BOdsGT1trdoJTLitNlQK8EqtyJ6\r\nGxoSNOPK3FJd8TeIGSQPEYO1np4J1olqycM1tt78wDPEGlC26nv5WYQ32Vv3\r\nX6LJFaLJWQXso2nv9nqcj5eyp9cAKjgfq/PBdrR57n+uFp7H7MnVfQVaKmWM\r\nHiZJ3sYdpJNoaXhG5h3nOVoR85V9IMFd4ySLXKtfqfjuFFFjOSNZ6Vz8A608\r\nGUdO1vLlDl8sHkuJod6ZXW8bU8YIhMN/zcrh8LlgvkJf5mgyvXUlCFlIhr42\r\nqY2wRl/CgXqVHmbEyh72egn2Z7VDPkcO3mM=\r\n=Khgg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"79b2343ece5bc3316b86bc9bc74cb383abf9c9d8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.151"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.151_1648698026613_0.8906882341454503","host":"s3://npm-registry-packages"}},"2.46.152":{"name":"@apollosproject/data-connector-postgres","version":"2.46.152","_id":"@apollosproject/data-connector-postgres@2.46.152","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"8bb31859dcbab4b63ccf8c5bad40296dbc8e3b6c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.152.tgz","fileCount":348,"integrity":"sha512-k/ho/bBYdQO9c46r/s8oWbur1BOaLt6SHGVqkztS7LS3Gb0PM/iO/1yxUL0bhcvzAY9EVinCekC5fDJsuQTqwQ==","signatures":[{"sig":"MEYCIQCHZn5IvMHGxlB8waiIurj7LBVzgORDai2jmgELsYDHugIhALTRm/hzZsaDBEC+psXlBlJ56X8zaPZTJLthBWVgBwsH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1126604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSODACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Nw//ZUyu0BuMZPa4JE/iDwSAlJkG1ELLxLI/UDs4HcZCkgcaseyV\r\n/NZYPonQLp9f3554ZBUqOFxTJh3dkBQ8ex8aeNB0KH47sGKW6DhYfRnemanP\r\n88JP74bI97Bgn3dNxqp3a/Fl9i1T1sbqTJby6Iq6Fh5GgHpHlOBDSVO0uMLQ\r\n/3mkH0nErzT5XHp47t3dHXKuy3Aw9GVk1RwQwDtF5vJlVKu9DSK+PIS11JUc\r\nCD8c42W8clP3aCTbQmuxlDW5oylZBZ8AYmcL8jBMvUSgMmfUTiE5RMoOAyh+\r\n4nx9E0URY0iYsZxNKgrVPBgzcIc4/0MtDEZ6zPbX9dRwqd61eZyS3k/tWHHX\r\n7YXNp5fMQR8CZPLovLw1iQaHCKem5hXKtOCrnbmealgC4lHaAA1jDZvE5DnE\r\nKUEB3Rol/C5OyiQXIUR5F3HuXjZPiAv+IFt1jwEBBnSuXL2rDyNhilrQ2p+s\r\nuNtokVNwKILuS2VMLBTYkGPNtoQlytyWRxsyllrE/Th0sO+YtoECHrN+eZK5\r\nW4VU78WbIWV08W+w02KTERny+vEzFa3Q8GYIpCH0Ta3m1hlJWZS6j6jjFHs3\r\nFymUVAegvK3kvb9qSzJkx9Yx+ZYKMzojs0jJiyAhBSGNySFrsw0Yu7HWyNrZ\r\niZSc0VfNMTvzSmw2ccHWHrRNx/wlxHYVODQ=\r\n=O67e\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3529055e0752d9c634706b5efab72f2b687cbb6f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.152"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.152_1648698242746_0.04817602489859096","host":"s3://npm-registry-packages"}},"2.46.153":{"name":"@apollosproject/data-connector-postgres","version":"2.46.153","_id":"@apollosproject/data-connector-postgres@2.46.153","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e67b73495de2880f1a5560cf22fa60bbece7af11","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.153.tgz","fileCount":348,"integrity":"sha512-TU9kiHE61ci4rQ3O3OSya5ZAXmE5kEylL6MEL7m4vZj/FhdcCQFNOsyhHbfC2R8s1A9rwS+7oyWVuIVqS3GrGg==","signatures":[{"sig":"MEUCIFFW125bhvsENqITuYmG8ZWgv3ux7Zt6v54o/ZQJEX4BAiEApyxG9OzwDXuT2Srn5192e8aelurr15eYJtRueacMv4w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1126796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSQiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr16w//YU7gshTy+wtrti8HtA+nc/dddfsekjQRQb7cBbMX5NLdbgdW\r\nR47pvzurKsjEhcyeD7ZUGrNKLr89D3qIwXJrzo9M3v73Qy/6CAYWEXh7wF47\r\nF/7uGUSSjkITEYs2zMdc3NasydzPZOPupR3Mroo3cy4x78vTVoooe5DF/Si4\r\n4VgSGr3z1n5f5BDf/JfcFumHy7o18ono+EXY1Z/fS4JHGW/m8f21e2VsdXhK\r\nsJRn4rdCoe1PjzPgRLuGwBJPbvX1PcLbnNtvpofx4bqm6igEHHsDcErlnOGr\r\nTYZEL1l3X3F4Zdko2yZisZ3d/+cI2mIOxcKn/Wn8/KR5Y+luJnmiIEha6s9b\r\nuUihM9pojIketVS400hqZwcbVdQsDEnq52f6qj5H3h9Jwg9uwqu8ot86LvKR\r\nJzrzBZlZhsjtcLI5hNHhfk5TjII73m1tdXOMmACNKpPix7S3iPx3WB3bi8Q8\r\nB01nuqJZ7MI9m61hMpdWHcVRWSYmll5mvS9VbKyTmhRTuIw6KlSwFpIDY6tl\r\nVGFdYx/HplsDh5+fXn8Ya+KzPMYmZndC9jFkjcTgpDhnoJvqrbEvS7EpAGJU\r\nslcl0dyj0v3lx65QK+NVP2/vq5SvDE7ZOZHGJtm89FZ4UhwyWKy676qxAbFj\r\nlKWnketWl62+D7/gDOa6GWzydVCtwVTSIhQ=\r\n=StTx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f46a3bdf6d3e2471cad550bfb6f0651406a593b0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.153"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.153_1648698402430_0.46565363274446336","host":"s3://npm-registry-packages"}},"2.46.154":{"name":"@apollosproject/data-connector-postgres","version":"2.46.154","_id":"@apollosproject/data-connector-postgres@2.46.154","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"6be1f4b7d6e0e6d522ac2ca732ef7943b9ee837b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.154.tgz","fileCount":348,"integrity":"sha512-Xj4C1j9rPZQ1JnLWBJWh1dLvU8DVuKXPhv28Djr+cY00CFlWwBKBGM2sASm0N0CWtF27kuDBvPUSEUKYsXiqrg==","signatures":[{"sig":"MEQCIHb1Aa1g1PLr0kguTAVtFYwarrL1gQz1GbQzRnccrIV4AiA2H+Xn6vEuFy/yRhJzu2g7o+zWTu1DKe6tIUoV8BG3bw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1126988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSTFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquBA//QePbKN4lz6Go1WOxXp843e5dKl61392N+IbXTTONK0WkiiVV\r\n3xLC4F61SGKlthixri/NskUrVBWKUw7sGy3yHPnBGKthXNrjN5qUScm3osrm\r\nCUDbvbCy69sgW5FACwsG4teiPYpRJZvt0kNXbga1r0wv1fmcrK0igIaUDas1\r\nHbMnZJnPp3qPLqRDlRrDJq6EGus0OeTv/wQCU5CwrUlHe2MRt6SVVhtzmdNH\r\ng/XjExLC4MAFps/NDnp1jQ8I5S/t6MwVVjnsZuLrO2sXS9fcB101UG5kXKq0\r\n7u3JsKKXKyfjCT0JbMtvnpSz4r18g/I8zW1w3gtXsTjdM8phh8+LXEUEtzaY\r\noudFoppdIRHEX93VCXuDwvMx44+dq1z82DsERcQ8fRU8EoAvDllUjqYT2QI4\r\nYL63npiOJJDParJLnrCSMS9AIrGQqtFtxjsZSKzN3W7ukrFyA3zAC3GBEF1v\r\n7yJirMwmTsuUWCdIkvVgMXhpyWI3LeD9c3Dl26iqIfi3P2Mpa3n7Lntg+d2h\r\nZSmhyY+tGANqKP7mMJ0auU/+tykTv0e0wlQK9CuANpFd92KQNnUhLqcG7Q7H\r\nk7JZU+DA1OpayCIKIx6iRXDqikPua5Vkjv6cJQSZhin2SjV6MNppfQIdPqTB\r\nWT46unkYuJ0QtMdnE8MQ/E4pQ3ZzQI0PMIM=\r\n=YCvO\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"782895379e233c1756d200c51252be3010410f66","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.154"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.154_1648698565157_0.37016508482003885","host":"s3://npm-registry-packages"}},"2.46.155":{"name":"@apollosproject/data-connector-postgres","version":"2.46.155","_id":"@apollosproject/data-connector-postgres@2.46.155","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f41e19e5343a07087489b1992f4d8881213311cd","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.155.tgz","fileCount":348,"integrity":"sha512-6Ej8+gugTZXBqRUmV7bdT/Ui4Xf03WSUjc7Cu489gxORt0wh9BdnL6sjramuzMwbDPHDwVE6cNWv16OjLBG6Og==","signatures":[{"sig":"MEQCIF6BsRHJlEf75Jp8GWvbgFPVZUsBnYkSLuxfFqQzQ3GOAiBL/7aNBw2jpv1XH85VRzcfkGHHwClM88EMihGftbLikw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1127180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSVqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpjag/+Jrm/DG/gZXmAg/CS/LM6bN6lEuERIa5E4ujdngl1i//pNand\r\nxWGj21nJw49XWJycn67Y0yhexAB95KZIvMFDXygFX5gDes8/mztP1LxmlWLF\r\nAqNNZpfe2MI6pzNhFNtd1Ffg8SjR07sDFQhBJVEbJMdwHEs5xs+l/Jusiqya\r\nxuBklYZdx4e5FcKkkDgbZ/DmtnNv2+QJYAbZdRwP/zN0JWrnaVzCzjFIbxOs\r\nGGCsDNj59U4mEXfe7RnUALZ9DCxSMDG6uJDI7TuwQ+kIUhoIHed6s9IfXxck\r\nznA6FvGN3JUzWtJK0ywpYw1EztZkJdipC/UbjxbMUraGu7nkG1e/iUYnWQrV\r\nrTuqiMDatSH/2zrd1/DqusWfQ4YiTwuhgvCl1m4EebEcnGtKUfeE5c0IcuKq\r\ncPzrpzMvKwLUy0ZS2TPzEk9ztWwV6Z2SLlysbDVTkDyi0AMr7sq+6U460igM\r\nTET2FNzK+/xsHeAxck3kAnPSodL5a/Wac6dmwKpypBEzfkR1zC10ODFovje8\r\nRb3d2gP4mVeRF0ZKXo4hlGKlkT4UEBJxZqAwEGwybFCWwec5iyaC9kr7ZO2R\r\nU/SVLTiDGg8Uq5MAYi9wM2jbBDh8L2cFrxCkuuqnTdIXXkWPjxRIyr6Zu14l\r\na2ee8zoqErVXdNty6CVWNRdCktUTFzJZaMo=\r\n=bIXk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1877f771ea9c4563ed5d27cf7e28d8b6ba2498ab","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.155"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.155_1648698730709_0.9856876115868991","host":"s3://npm-registry-packages"}},"2.46.156":{"name":"@apollosproject/data-connector-postgres","version":"2.46.156","_id":"@apollosproject/data-connector-postgres@2.46.156","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dbd7940d38544d62c03f076ec510070985ded2f9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.156.tgz","fileCount":348,"integrity":"sha512-mJUGYzTkY/5Ce2Gbe3zGYo7/9E09LDSVYBV+jDtodEaTUQEUQbQakdbErXuqXxAKUIIljZVB3fXbpv9RIAOT3Q==","signatures":[{"sig":"MEUCIQDrP9NJA74Y99sr4H+PM5Ac82llnmfobZUwSYNA3igWNAIgeTwk982dDChFbvca1yP+Gxx77F6d+C+aOCRJ4Fha7d8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1127372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSYfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptpA//SuhEB045FYC83ClOya2w6dUj9Mp4fPdbf+PT6l6rq4y2EEfd\r\n6lUwD174PiM4RA6lXKW6gNII3rMtG6bhjCQGNSV22d90xKFOIGscET5n1d9C\r\nxE1YIFBESV5bd3TUTgWfdBbgpfxtOWCwsvksa39qNi0di41GXLiz94ARhFCH\r\n+zZTQs3+HxPJc94sEFJhjw7ntuftAWYJSKGejfweNgXsyNp38ny0yi+DTyqB\r\nW0re4avAuElqbUbCpUKMgdt/aMxBaErsQLNamLRRGbmMrErdhJgSK4tA8Wv0\r\ncy3gCzIAJ9wL3D+TF+GupfyHdfqL7956gscQ4JhXp9X/RPvf/WZL3l0lvvyr\r\ngXf/BLnkS8oAh0RzSUhVEeTgbc4KwiU/IeaD0GnO82RPpmqzvlgYt4UtrCwg\r\nBA+m11f5orvwFvR0SKHQ7tk5QnYaj1iWm2/xPQWUH5RPbieNrTvj1+fb7mJy\r\nFkDVlzITt/bbwV9mjqSY/pPDP49kj4jLjcclsSFvAvm0nVZKnrulqch4gBYw\r\n1l5u+RWZnEOmmhv3jN+jsG9yNZ+g8JvFicmZdVtLkv0ZuQ9GcdOHSeGNAeyI\r\n4fvoZL7Rz18c0hD2djDOht+lnrE17jJNigSZoW6MYVwAURbbp6REgCXeN0Ru\r\nKeTUz7WCCqj4KckQ6FoCuoqiQKa6bjBrgbI=\r\n=4FTj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"9433c159b9aa68ccab833e16585acd82bb221a79","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.156"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.156_1648698911533_0.25080347860044094","host":"s3://npm-registry-packages"}},"2.46.157":{"name":"@apollosproject/data-connector-postgres","version":"2.46.157","_id":"@apollosproject/data-connector-postgres@2.46.157","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f45f28a67092bf89bbd4cdbba79cc0e2b118ba17","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.157.tgz","fileCount":348,"integrity":"sha512-4o1wc2fSQ16+aj53uaCqgX5XgzRw8pdOMDlqBBhHdm72wllzGmtVvl7zsu/T1/wfpPkzW7OtFNOnSbUihPclCw==","signatures":[{"sig":"MEMCIBb0XbxqB1UAfmsuBOJku//KTDyc04/c1RPhictJg2svAh8olWukapiuyVZjYArU/H9tR81j8fLykZ9Lj0XxPav2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1127564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRScPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3XA//a773p8IVe+AL2V8LOp1xOz/6NX7G5U8p42upPYcJi4fOeX61\r\nj4756tD1C0Y3f4y3OCkRVdiMBQeQBkNKMnWGbuB18/kA+s1gz9z2iZr1h44h\r\nNomwJiCbj7nF1fT02MDwCdNn44uY6UizVU/w5FedNov8GmrDPGJtlKxQSKhp\r\n8qvkogGdHjF69ZljzosKTVUFvy010FrYXw1tGIusJPilytMND974EZOH2ghQ\r\nv2AewcHaGEsPg7op+hBDNbB5kAsLLjIqe9zK/NaQ1OZeEM0RpFSp8DwcaSb1\r\nWIBFWd2Hjzxww49frftIAw76EnZGEQ9JK7w0XU3OYhnvvihaAak0qxammZBk\r\ngEJSvqpFkNn/q/UFtP6/ep/7gtO+BhKiWik+vp+7uMT0DOzq46/WkAEcF+gq\r\nLSXQqdJqFh3mupSDuMzMtOHD55K+ouT4pNe1m7iBtxIL7odi0PBirwhok7yA\r\nBdizTXS3MIbS9Qre0q9SWSThgXbdCYpEPv19kDwEdYrhLp8Ma5FUGwGpZX6f\r\nzJXZNnfZT1FQX4G5OkSWO6xLztoXx+owk1LWFpSP5KoNrYYgWXBPO4WUwAdy\r\nGemL7l7ZRueowl8stUWh6kWO1iJpHnC9FdAmV6Fkl510qvrtER3Zi2D2wHWZ\r\nFbeUlEIsSpKlLBd++Ui26angfgN+Tbwq7AA=\r\n=NeJq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0141a4706c1ae3aedbd2056d3831fb519e73b7a8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.157"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.157_1648699151477_0.6134034444098908","host":"s3://npm-registry-packages"}},"2.46.158":{"name":"@apollosproject/data-connector-postgres","version":"2.46.158","_id":"@apollosproject/data-connector-postgres@2.46.158","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a1dfd8a73eccac34951a3862b7f4326625a39888","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.158.tgz","fileCount":348,"integrity":"sha512-tD27X63DIKEFP7l40nMvmZZo4atINjJS+xaSRkVG7j2bEUYG5e283aPscHY6cOTiaJ2FlJ7ep/FcK6Hedxu/iQ==","signatures":[{"sig":"MEQCIB9ib1YQLxmcJzcq/Tg/MOx4OLyTeTaVba0w9xfl5pUxAiB3k21vzVlooH8YjcK/BPepw4elgCIfo6CIYfxNs5czxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1127756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSfgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpl2w//TgdV/vjcqFuSlcCShKG0ghDo1Kw2aQOg2vKRmkTA6tIZjgEf\r\nZlFVdcrQnytuc4eegCQuNsTsst/6wZdL5A/+KkbeuPt+ngxTp3YFtACKc4Ir\r\njoGmG8XXbEtFxDK5LZPggBPT7x/j4NJ0u73SreMxPaw0V8gTJYhYtq5I1tri\r\nzWY+Dy8YQDwXz/DJIj9rYV02Q4NR9F+mOJmPDeuuNhl1n8iKMTaTdKj/5KLp\r\nkE6n92PJE/NP2Y3VKzrhDSi7JA547maa0ridQ292fcudvrzmrxPZCyJFVqvM\r\nxioVhT4aNSdy5p+UQNvXApcTkeU+lZ0zZF77c5HH6e1VxUwNiA5DElq1sfJc\r\nl5m8RxqLN65dOF3NH0OXky3N9FPdVEakJEnb+7Xf3UvF0IP4YKFVM8YZ6j+S\r\nmNZVadzXy3CmxmycXNTkvnGfdduoVyf/XO7sM16yszXb78ik5DP0qY9uzIpb\r\nEjeKHr42qJvkjw1SdJAG0Du42u5id3EOsKI2uYG1CV3arFeW5PvWDnZLCxcp\r\nX7+qB8UVUwwgUOP3jiIzOJNYfb/5+7NhA4ITWmRPHUSqr2xo9paXtxZjLY/L\r\n7J9B8GpHMpK/+kpC9Wl+uzkQ8E8nkZRElBJ4p7JfzWU0f7RyckDT/y6jKjRj\r\nboo8rDF2XPP1MHrEYNVJJXjfR0U0uh5Hm4M=\r\n=QkaP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7772539c55b6a87215708cbb0e828b13bd82df21","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.158"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.158_1648699359884_0.4758073888414782","host":"s3://npm-registry-packages"}},"2.46.159":{"name":"@apollosproject/data-connector-postgres","version":"2.46.159","_id":"@apollosproject/data-connector-postgres@2.46.159","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f6424cf605a6acd191d42658b83660052beba4da","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.159.tgz","fileCount":348,"integrity":"sha512-HDtzqMU4XYMeTYz4nPjP0JRAPsWl4FuxoNMjTsHXu8K15XnkkYD1Jph7Fp0i4UuRMb5FaypQj7B767UI0zJGaQ==","signatures":[{"sig":"MEQCIEDEed/2tZBCnKqvCxNVeR4kbsoR5whMPpgxh8C2GlwBAiB4VVwZeHoIQBRttPjR7bJwXZvocbgvcIkwN8XZB6jqaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1127948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSh/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmro2g/+K+JQHVhzzLtStZzRRg5PDMofqyIZJCX3T6LnF8W/SemZZFi4\r\nCGgSsrYRCne+HDSttBj74IJKQtMADEUoV9iSYZjkfeDk/3esO9fmIkG/PiOW\r\nEQIGtjBeuCWNGU9I5XiNH3ed9zdJHsWCGA0Bquv1tFrP1+KQyEmzzJIBDCvX\r\n5+BWJl5F8ClZ41j2xEk0VMgshg4G4h3aUqrwfoO3oDW8yFs4cYMNTDuW9/0t\r\nbQGCvOVCXzNcXPLPNu+FN87My2QschtsNcb6yefnkTNYcXSm4vszZkgaCgLu\r\nM9yiVXu+aGRpct+3G7eOF3oas7QrxIuhiM2Hm1IClWILt/HOxbkfQfcNfiKK\r\nPkP8s+vtmq3CDVPj8TCIVWeetKLpNYLQvbrL39H1mlVr5Il4M3OzDVS0KxJa\r\ntdfmGuMvHxyk06qE8DXgEjw5mhFSvFvmZ7gJ+8+FtHNVRxYixAyuitldk07M\r\n/uk+fkY9FwzKAsKaCcsRnJTD//C+Jea3X5pb9dvTdzOUJyBgdGVQy3EKfeNU\r\nCyILJriagVIWt2Y4hePVC/ilx3cy+G7K6QdtjXJpwL8pvG+6CpGwBMjDEpMp\r\nJml2OTmzyjSLkxwVcSzxc/vUMgKCvvT8MNcxanJ5vbe41WKeQxk8cSKo81tK\r\n1Q9MVO9wS2xezeJLFw4g8Jb73iPh/fpi5zs=\r\n=WGfT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8109c012ee7ea19712c4b657d048ff40fdc5c165","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.159"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.159_1648699519401_0.735736144744537","host":"s3://npm-registry-packages"}},"2.46.160":{"name":"@apollosproject/data-connector-postgres","version":"2.46.160","_id":"@apollosproject/data-connector-postgres@2.46.160","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"854a427ee24d61b41a3d097af3eb8b160ccabee0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.160.tgz","fileCount":348,"integrity":"sha512-pdg+UbglueWOvILm+cxHPy4GUORl808l/7NupUX3ScIFmaa7OAr1+EoBQH57OHDAxQ5olV6KF4YL0Acw+fmCdg==","signatures":[{"sig":"MEQCICPAp2QJ2Bo62lXtPKIaWrQ/tic2YkUcdT+wdMVi85XiAiBzk3M/d6I9fSS+rPYG2LVK0E6yh3ogx79cImvYnxBdNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1128140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSlrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTQA/+JrnZ/nOFUURkhPeqcGA5pVyU67H5UEUIkSCDbdkp4Wd3SKqr\r\nAM/7SZ6Ifg81haXCraiigEgfKxHNdecaY5jJX0IH4vr08jjIQ5RSmtRV4wv9\r\nJYUafn3DESqtenGxzfce5ob8F8fQ7AK3TABehuTqaMj3c9eTBFM9T6Ep+vEB\r\nxxMZdDeWVSZq0ymMQhAkRlNzGWYhy10TtfLH+f0thbQGDlL7d08x2Jq7dKFa\r\nnGWjTQmIGrclpUAb7dUCq0ATwT0UfmjwVGOJc+Yw8YM3yoNdOkKKAYt5dMzX\r\nGekyZvVMfkip+ZxLmYUKi8N9JETbPbBJsTqNaB9BhNkETnbHX/UZQKcwA16y\r\npKcVyzmOmI52eOY6j9Hafe7ZaLZvF7WrBW40QmFpQJkpyGq7qQ2gVMJCDsIh\r\nHTYyBEExeUQf5TgmvKFWzRjz/LJQQaVaO6SV7aXz1RAdBhR1VI3v95r2QVsu\r\nnxebwPjKp5U3N9Y0CvFTRAk6BmKooszI2LGYfUso1VOP/14PZhp3ZfFLGHCG\r\nyHagTgr4Ja/17/xHsum9SI/QZjkgveKz6yBCsioNSPBvX0XYRSvGyIxdPT5o\r\nMNAwYNA3vPo2SRRs6XPZd6wls3Jkg2Wt649x0M9czx4GI+R9SHg8+kYMk3Zn\r\nl1Zu5COkAfqFVbC9QpVcUgz+k2bZIFdkNQo=\r\n=bxmu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d7d5a359770d6ed3b1ea166fa990ab0e67e82d0f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.160"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.160_1648699755601_0.2022795062285272","host":"s3://npm-registry-packages"}},"2.46.161":{"name":"@apollosproject/data-connector-postgres","version":"2.46.161","_id":"@apollosproject/data-connector-postgres@2.46.161","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"c975f1e930bbff380a960086e16c0070709cd624","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.161.tgz","fileCount":348,"integrity":"sha512-QI7HKt7Q1glcWvaJl+RcJdZJikDb2o4CnPe557M/xVSC01csDCMcQRgmYe3jHZAIxd9LT1xxkaw2F7cPyJIn3Q==","signatures":[{"sig":"MEQCIG3WD4tafa6E2bv2PsaCLWhjcu0tXjUOQO97hXWEFYucAiBjzZd25U+orMUNeRXYXTsApOtZzwb5nIpz3ab1GESBwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1128332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSoIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEvQ/9FEH+9MMgJH6V5ft/9Gf2cuZJXp4HeQwOJl2irfKsOdbKxlj+\r\ns/9hryLILP04vVaeImpdikD/d+GSGVJtx9bhHIMScxkGwMLibcS6tDKj8jzN\r\n+K6397iqLVWv9UYWDco4M8BpoNna2ovOSIJzzZ8TmGEy/EGeB94zRAdO7EYz\r\na3M5rWV/lJcvHgIjrJ5p+Sy48yGnkS8bjGHsMAiZ9WnIJ2YJngblUG8+3Pyi\r\nBy8Y15EE2s2voXN8zO3PmWCNHh72bVRXCdZ06a9rB+qSo133MQU1wQMwsTyj\r\nwOK0j+UjPoIk4veE/xnhk+psALzfscxzusECwwl1/MBcb3gJF326pe9YWNUy\r\nvtKmzuahF7q2BQIliVnQw8TmW7LzDG5aWM0ZnuyiZGSyHQ04iGA95BGj43qt\r\nJcza8YXb0CwfCfH6dHDhmH8ivwr3xf/pQ9BDOFXTQt9iCiaPB5O4++I1gSmL\r\nVGpq8WR88eNdAsSTHjmy0V3i/QsPOBDkUogN1qKYBInTFpQeebqcubBQLI2j\r\n5xXnxdIXBdqm2OXybSe5Mm8tShkIdgZHMxjQA2ODQm823jzDQGvyWLEziUkU\r\n3Vy0I/0hEKqfQhTn0lbrmTwe+p6geJVtvWfdb33yw7O+uxj0QKkH6ZsiKeVr\r\njF0IZIhFzS3v1ANjPDN7AzG82xSDKb3iH3E=\r\n=mrkj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7ee8157b7aeeb6488c4e79847384cef9c7b17981","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.161"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.161_1648699911804_0.36454426144613783","host":"s3://npm-registry-packages"}},"2.46.162":{"name":"@apollosproject/data-connector-postgres","version":"2.46.162","_id":"@apollosproject/data-connector-postgres@2.46.162","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d6cfa886d5f2fb7b52fb74968978402b1d9432bd","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.162.tgz","fileCount":348,"integrity":"sha512-lndAt4OI3XVoszsL0y3jLlT3I+iubFNuANtvGul9EtO1/c7aNp43pulvd96610CiVhvG5n3kxBTN8F1x8f9ybg==","signatures":[{"sig":"MEYCIQCO5ktOPJar+PoHVyjcJBWb5nz9jJfna01TyccqDo1K4QIhAM7bULJpcmZB5s18S1JN1hOirzYIgD4zmK0n/1waKe30","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1128524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSqnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4Nw//Yc5JgcvI4Fw5Im8R6OzIEWFWz3XOMH5LNN4ciGQjpdOJtu66\r\ntqlagab4bb1AErE5Wr05u1FFzXoMPLYlpWwm5ZVBjI6RD14Vouq3FXKD3uCP\r\nhaGIRSmQLtXzhGQACpJkYwCX1YSROzihZKgBxThZCmNLHuLXAhTx28puDCxz\r\nELaeSpQwoU0Xynx2P+RxnZJuTblCW8ngw9Ag/eHCHhlKBHdcUtq10qCxfzxc\r\niYxYVrRazJX0qlYImW227pwdvQZduTmHO7MwrrytzYURCIlUPwY3qUsu1ugd\r\nuDXCWbLE21oEmg3WZ1E/tsem2Fhcwdwt91akPUDOJ6GKpprjEHkZOrCnQ/Ma\r\nTNQqLmVcny5PQ8UzMQ4NlhCXsLawzaTWM7h6EiprBuy0MvR9fZr7Uxb6EEgi\r\npmzIGP1hovM3C5tP1nSjjee0XpkKWRAG0SRF35+7cIAGGdpGjzrB879eatnm\r\nei/faOwDKbvlghSybauWHNqdWzSK8raaDeHzYUG/vvWP3Nx0Cl2nFHuBdRUE\r\ntuWW5jhPKJudT7JFvy/29eaiqNEYl38JNEdl14c6NvlaaVNx1z36jUoC6qtY\r\n5nLI8AyN0zRh1x0aiBYnT7NOQlD5ejXFkb+i6yaq24zViXz4P466K7p3jtvU\r\nwoT8CVY9ATz4TvafShfh6HwZig5LKSeS2JQ=\r\n=Ohcx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cbbae594c23192afacf7e812d6f04bdd87b86e34","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.162"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.162_1648700071453_0.025231370371162853","host":"s3://npm-registry-packages"}},"2.46.163":{"name":"@apollosproject/data-connector-postgres","version":"2.46.163","_id":"@apollosproject/data-connector-postgres@2.46.163","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"f28c9c72f8063096876321167f3489a5d22200c4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.163.tgz","fileCount":348,"integrity":"sha512-YRixy7YJpXYOK98kbqYFuQeO4Yd7FpRboicMMLrEHqz1VOwK8tb1JDj+PBBLHnZeFzYiPPDlk0SxNN+mjlw5Rg==","signatures":[{"sig":"MEUCIQDCsOlT9KByFJ8yVgQO+s2GIXYzKc8Ivh40DKFsBx3ZBgIgXEonoabHJWiVmEKQtSS88OGQGEUwBtujVzl013m1dQE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1128716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRStoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpikg//ax+qrcDCJKcHinMJ+HENrI21A+An3pbkOKoqB7CJsD5RjXnz\r\nvKAE9SVftSSk3lKW5c9aZa4mZWypQDYLNM2oV/pK9BM33uKDLgoqm1YYPR2E\r\nCIi268xw70mozL6G8Ir6cyUWDtFwl2eVaFw8X3/nCLHqOI175ED4nDRx4BzN\r\nDWVwiTbH38y3O/QIXNFu7VQDayXw9yMhawQfZ97bHH1CLKiSIaFaP3zJlm57\r\nEoWi/HQl/FDd0Qu+We9ERTErtOY3uF+SnwOyJKsv5kRa10CB9Xg/r8Q1lnZE\r\niGZI7UVm1S1//i7v+GHJopWBWNGcA9cXaFss2+2w/CK4o9y4tt6G/k1F1WxY\r\nHFMPOz/1OeKCufcHrDfaCk4htbsGrF2GAoUmoGUHRdvoMEcByeXgOHsxrqp2\r\ny1oVkhWEyTCHIVeEOc8weEHhHU9hNpg6G66cMH3Yhu9QOgwCEVwlHGvXADNH\r\nkxuz2VBMvhg42WxXcdb+afHAEppNDiMt61YN+brgyTuxmtpPzGNjK1FKOfEK\r\nCdKR8VI78ZsRwd4HKFoUPqXJMH5ieWsEmbMTutG4tTxHSjhfJYjmdqoIyBeG\r\nzb/i2ItMLi7F/vzibMsALRsBpjFtJUMNd8sg3ivaLhc9QjugDySj9zCECQ4X\r\n0Bst/+7HKy9aIsP5CmLzXWUPai6t9VaH0Rg=\r\n=6vQf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"02826c214e04b88798be9041aa51d7532593e8a7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.163"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.163_1648700264592_0.8024407010928272","host":"s3://npm-registry-packages"}},"2.46.164":{"name":"@apollosproject/data-connector-postgres","version":"2.46.164","_id":"@apollosproject/data-connector-postgres@2.46.164","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2172e283b0a20d06dae4f8f76f70e1a29a8d504e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.164.tgz","fileCount":348,"integrity":"sha512-FM5BBh3BBhzMeUh3RGQPB16H2L9Pwvk7/+DGu9fvY69eL3H3c9CMcrW6HYvwYvIkb8/r6ifV/FTPosR43L1/EQ==","signatures":[{"sig":"MEQCIDqs2NhrCT+R/kV1MlfLZOjwEcZUTJ00H/jtYIdtv+MUAiA6+IlA/FNavk6io5aDSOvdkNfxB4u8eco6ZpVzzD9+Qw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1128908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSwyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqT5A//Rjs2+yLUr0kG0v3rZ/3+DGoU99oigAZQF2fdhksJw2/ePRXG\r\nRe4Z92BEe7tED5l5K41aENEHJmRp+NoRaIv26zrapY69uofOklbWFesOmcRf\r\nOJnMGKdMa58kmy9f4Ynl8F4MMSbBHSF8wlNSaGNnaRHjrKipI+tf2d0PzfiC\r\nBISnRuzhqVMbN5MwGBWonHPkRVaFpDfe/6ouG+5wB6RrM+CTp+e9Fja5EcrB\r\nJPmUF91pMPPxzkjCXTNLzJP8ZFvL9zk6IfVQopcf4fG2CmpP4NLHLNgGeynH\r\n+E89RYYIdLL7Cdgl0MWJOiq/TQOTKl5zgWqi0WdqTRufUknEw8QKxE+wo294\r\n5xW+NypLncsCtLb1puIEEOEJ0W8JO7M1kF9iPTaIUIvlxXSd4Wcc4mRCxNHI\r\nK3wOcV2cXgpP4BMup01xLXGf28LjhcASAEhtJN5jkSK97UYmnk5KaDKv5Q3y\r\nob3nr26LiMxpIh5z+z7oIOipSRnJiOtRttKMvGezLVEOfNp1gLn2GCkM0XI5\r\nlp3YCdrifHNPz+PuwCp/N4Tf0h6n3xbxThVTBmeWNd/4jz+8L2DFQNqt9JCo\r\n05pIszpnHIB8kQgdohWSRgHb/1M8d7V9g8TX5//zjh18IrjvBgV0uvIfYxuD\r\nH14ySZjybbA7i9j89wQhPiGlSeLhAQVwZsY=\r\n=SdKM\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1b413456ea127cb192e4371db1c50c54d3ec9920","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.164"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.164_1648700466048_0.6385141800240162","host":"s3://npm-registry-packages"}},"2.46.165":{"name":"@apollosproject/data-connector-postgres","version":"2.46.165","_id":"@apollosproject/data-connector-postgres@2.46.165","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7dfdda56ff6e12eb83488a0393067294d923327b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.165.tgz","fileCount":348,"integrity":"sha512-P7HELu3m7zcM4QJQoAcOmfUBP6HetnEg2IF6u+Lh7zWGpUo+C9RtWkjeTYGfYlIPvbjMAtKFxfd7sF6jYmrMIA==","signatures":[{"sig":"MEYCIQC00DI/zMUFCleIAAby/i/7uwFh7cYp4kJQhwqqpKY2ZAIhAOli//5HPukoy0OzWt63ItdLv7JEi3MSEfK9xqZsoLfZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1129100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRSzNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxhA/+KHe8BpZsFqSmbU16MMycsmyQzsbhnk4815qEU2oLoutaxYAC\r\nA1A+dukxtQeq2fF3A/mIKAuaA5R9RGSQ8DQRn9QR4ojLtQxAaMUJzGBiEFSk\r\nJUUH7B9gNaELlrWiwVeOGEstB/jbQrmB3UZrG9+qM0NYL55YOydg02+MB/L9\r\nVNPCq7t/zKf7rMhBNRj3l8X4BGv4cuwVZz6oRrH8/MVgjY4CCOuM30lERLqW\r\njTqmxiNP4SpgD6vy2uylp2Rp2+paIpXwcKyEnUfkRSzdIEWqd/M2RZOnbNaQ\r\nXRrHaKlFOfs1M68JXCI/mNlcqHd7owaOWAs94yVChVkB8hAnkJsSGOXRzHMG\r\nEEdHEH4opB0oe4T9hMdsBlUSghAWDhmlhiSS6JeSnV0PrymwHzGT3wx//qdL\r\nsZQ/RSczxDKZyCHQg6yeuGE7n+giGwS1pXO+8Th+nbHspYSKaqT5UnDGRizs\r\n6Oi2eDaCiC+0CTwee/QMQWH7ZIXnZ8uu5TuoNrFvrFqYBt46E/Jr9O71Peu9\r\n8HyjN3mPv3vUMixr+GXQ0f7UmFn3pIQiRIOFzFWJSKJCcItXlnbxUE3RwNWm\r\nifT70c08WPYyrBIAdOgi2s/EbtCXpfvZwDB34vqbsJ8lWNgvTWkfwm3Bm7vQ\r\nyLNhMlwSjpDjo1bxoDCI/LcSDYI73QvXj70=\r\n=4VVp\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b654a8ab63fd5d8461fd0a02f92e367f034dcca3","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.165"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.165_1648700620735_0.7317797936934556","host":"s3://npm-registry-packages"}},"2.46.166":{"name":"@apollosproject/data-connector-postgres","version":"2.46.166","_id":"@apollosproject/data-connector-postgres@2.46.166","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"e5e8be60f58da6aaef36ee13ad330a016d5022c9","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.166.tgz","fileCount":348,"integrity":"sha512-HSzHCe79OMk5aPvWGs/46pkGPEw3wcaNKwuQGL4domX0Cf8zFEkKrBMSv7SHiMSiw6DIzJIgPjnJ9K5h6vEuaA==","signatures":[{"sig":"MEYCIQDTGwZ8ypMKBPJSLe7pJ8Siob4YjeLy7zJxEFhLLaW7AAIhALfJtk4QfFIJkImU3qD0Bsffz8I11CqkcEoFzvCz5g5E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1129292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRS11ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrp+g//fkWJLIADcfuCAAsP1CwRw814mGnnmwt5kBiLfhHzaORjFA/Z\r\nZeed3kN2wUHWQ+Kg7pcQzpTUXUA6o+UjERTCQJfagg2MLVUha0xjRwTnVViU\r\ngMTIuAfL6Y2JGZyKKZRFCRvIZeyPr0QCPWcU1JtXtEpRXJnl5CN8h5JfaAWZ\r\nSLh2rrlct5oB3IXechYOwUK9xM8ztTZ447756iKNP1Ydo2t3qk/wnaDIWFgS\r\nDfnBUhhopXW6S+x5HJNx9rXKOuylqclr4eXSyt5TMB3sgDUyecup/EAgbwEJ\r\nMcvBWzdIVKURyKqUMqSU/cP7gSji9ElKUZO/lJAElQCvzEvl0NzBRGtpUl9y\r\n3zLtei6hH9lEX2y9iF4e8o8ebyRyJUKwJCrTEZsf+Gh9heoNTv8GQApgd6SR\r\nuUw9//2frfDG7Q7GPAd7x35q/9dzvF0Vo9ZO5Qx/8HWoTWQvn8DvcblQtoXw\r\nrX1IRO0F1/BU312p0P92hGtTbHzmseg0QWEWr57jXe4pzuxQi0nOTwI35L9y\r\ncstZmJVy4tbIc1lWKV6Alr5vCLijpjlA1UNGBilS3+F39KuKMrHFXgRq6wF3\r\nTxv9aEVnbZ2Fad6lp7s0rOSovhl39kuzJMk4al1elJvdWfzw+f6wGVvoMA/W\r\ne+2k0WE3XaQ1DGG/2yNnlDdTBYqcuWZNjVc=\r\n=mbMD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d6767e9d503739cb5846ddde3843b6f3c4986e92","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.166"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.166_1648700789298_0.4023623165138417","host":"s3://npm-registry-packages"}},"2.46.167":{"name":"@apollosproject/data-connector-postgres","version":"2.46.167","_id":"@apollosproject/data-connector-postgres@2.46.167","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d17e379d8491fe3a0164b4d091643d9191ad9a61","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.167.tgz","fileCount":348,"integrity":"sha512-6dHkwB3nf0bydV3mDEXuGelJBfbId9mSIOLnC5GI0gmyEsjnJdbSr8Kqh1fZ8adsHIZK4qu0N4IoLzpGMYczSg==","signatures":[{"sig":"MEYCIQDhPgKLFe2akTp9OJkqXLs7pCGoQwUq1JVvqjsRy0oIGQIhALeUmoNewOGz8f9nPp7whc9TyHN88ar59/vT5dZu8d58","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1129484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRS4XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTyQ//WWghqR/SZ7gQNf4iolbKXI9wkggGn0KaYvp0Vz/Dzk5evnWc\r\naOdtI+cpT3G7wg1t5aKM0bL5J3XregvqqJ03KZrbnM+6NLPnv1hee/dc116m\r\nvlfQKMbJLHpCY4tgB2mkPX2tdSo35qtO4xvCG9UsnBtpSO3KoadtmIdnFrrY\r\nO2RRY2YcpWN8Wri62h5266Il6yMk5P8TptkJxA//VHfd2IBUhSUc5+FRuUUM\r\nbQ9rj7Q0B9+cOdNsI2gguqyCV40LtrB9j0RAOxw6S1mkrzBSJPEAZsOXuPKk\r\nw9egujW5J4ETpQ8D+8XgQaoT5cPqI/VaLKogpj3nfORUsPdIb54ERW1yNPqx\r\nETuAnSec9rLIjjkzF9iXfaFV21/+SQARCWtLW37id9qNu4ameokuf5nUO5eH\r\nB6P/lDk+fV1aGyeapV7TQgblZd2LQqq6Y/pYt/+woriU18k3cJ3uU8KBlHra\r\nAo9W5OJrM7xeqaqwQhIaJF+Gk0sSyMFykVNHTbThbcZ2Blt7y67zDqBDI+yc\r\nEq58IiS65TPJd0OZjhJu5K2a4bjiU3VuEUxM791M8b6rvvhZY59xXVRavpIl\r\nT8EJktyz1+1kSdN+8WTPbrgqlOEn5diHqBjE7tGYX3F6/w0EyMBOrN9BrwdI\r\njDx7dtt4P1kcfJ1Irr1NXrKWXDvru6nqFaY=\r\n=4rCD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"502676b403454c64d60093d375b6fd0ebad932f1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.167"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.167_1648700951347_0.09657863720853044","host":"s3://npm-registry-packages"}},"2.46.168":{"name":"@apollosproject/data-connector-postgres","version":"2.46.168","_id":"@apollosproject/data-connector-postgres@2.46.168","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b6791f242d52de2ca567f8873ab3473408ae16e2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.168.tgz","fileCount":348,"integrity":"sha512-RZ3YRexMPnNEjoGPlLIRXZROjEXLCJioHjmPe2fpFlY4XabP/FaM/pPRio1hj0w4v7kWUIqXZa8bMOVel4ibXQ==","signatures":[{"sig":"MEYCIQDjDFWkMiyAWicBqPMA+koUYNgzbaBvdXeCXRhcf0hMHQIhAPCyNx2hVk3bPPhBEIi/kwR6R3pTENNHD5keLLl5KFqg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1129676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRS7mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpnwg/9Ek3L8syiZ8TvBBFCxqTKRls46J5PdlW63P5+rblvoAbeo4gl\r\nexSagCk1MEkwcpKTXa3zLxicIGH3AF0LTcch4++7i7fZvglOOlIUfPoQ2+/+\r\n7Deq6mbV69kr1C1llaHGUCS/9PMb8CuN+W+yvl4nZFM2/bVW+xx50rtyZYcl\r\nPmOy4WgwyePnmmjHVHsxqTNGTWPZVXTQj/rVW0FKqYb98lo54ixdrx4V9Wax\r\ngfyyueVJhXXPJs1PP2I+q2Sz5bsJuOwuzf7kJJtYIWFPLLB+8DhlPSYaumJm\r\nOhKZ9vW8lrTAHzar7KJI0UssYObvshuuf63bJYaHOdX/ChmbqUfVV207SOux\r\nRElE1vVAA9mwn/tHx4ZGF5up49mtzMAAV+IqJtEbK/NwTNJ/SP4ixI3rq9G6\r\neByT6jnywVM03vuIevsRxVQv50loDtW/OqHKtanptVw9nXqpREf3pFxR6oMs\r\nU+G/qs8lhRkWd9yWW9dlXB9Lv02XXneAd7d+QRLzjnQ85TBBibx8BiktmtM8\r\nL/8wXN/vw/RleW6iLfiEhPSbTegZGEsy+X9/0xmrUSVropvl0mCsAz0urCHj\r\nx8M3InRbKXOyycNlR/nP+OKYi20o8h1Y+hLpVaQgFg+1pbNZIPuYOqVBEIPT\r\nuWJps9ZN2Dd2utqSTul0Vvx8AJVDY1SnypA=\r\n=YHNm\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"5077c01bd36be58f9d6e569886b8684583bb3a21","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.168"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.168_1648701158155_0.870331370193939","host":"s3://npm-registry-packages"}},"2.46.169":{"name":"@apollosproject/data-connector-postgres","version":"2.46.169","_id":"@apollosproject/data-connector-postgres@2.46.169","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"bfaff3f99a2ba86c50ad2207d79c15c1589a7a73","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.169.tgz","fileCount":348,"integrity":"sha512-kVyfdBCgGpGSTt1oXpieJ/f7aENY+f5B/mDpaXE78Kjw8TzaOxn1VLGeIzVRp2nMlaFLYFqmiwUuAQRgeVzTdA==","signatures":[{"sig":"MEYCIQCyrerFYCl2T5NQ772YMBVMvAoDtWWKUQ08SZzqNgTQJwIhAIUbHkzBHFwySxreZt6ybvHeDVFBShee42QEfZMxiHKD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1129868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRS+CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd+Q//VGHv2/+SdrH7hy3tYLwqW8tvzGx41KaWpIzT8t9CHNnuU14+\r\n6d9TjQHlnweeMtbHJd08OuOijLzw6BcpWHrUAV0/iQE/pyvPL1sdVV6rzN6E\r\nFq7FHtXaOVhe73sXVwb9lqWOUAy0R0HcTEsFFm8rB5po5eoqz1axCZYtD9dj\r\n7+cU0yHbaty6yv065szm3A7SRdTvxrQ5hRd4FhsBQWlob9e30NXlITU5n88p\r\ns/Wi+vraZJjq0tbM4+zCyXpb9S+xP/0iKs5uknJ4lEr4cW1NCgrWjUNOsRSB\r\n+Iak68Jd9Z657QWtK0dBOE76Fvh+fVONDm1SDkXHWgHbWKecdww1HmFFZiC+\r\n4Seg7jzuDNQxUW531ZiI9Fwj6kt+VWBT9kHdCzRTswda3Xt0eQ5KxiO8A7wK\r\nNvSeEXv/Y1deDnSpn4OlNM8/D70r3YwMnHadTWS7hrRdsDrjUFjgLlHCFTBO\r\nPljXUMsntqPMXxy0ckMUJhE5TzsmqqF6iLNaO4UdZXNFEkdbAVLbSgSIvJzk\r\nSbd8hFsLXxMWaADkxGErQEj5XlG2rMW3aaFzSsLYxlI0cNIXhhM3DEqoETdG\r\nUhiiKMa5L2drAZURBwKYTViWsu3SP50GqE5FjfjYwAXyz2R2OHX271WFBdhR\r\nIZd9bfTFBTCOg00GfEbAItsWX281Xk/z+TI=\r\n=63gt\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3c377f8656f66cdb1aa8fe0d67bb14ef46f8af24","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.169"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.169_1648701314124_0.27927552705608916","host":"s3://npm-registry-packages"}},"2.46.170":{"name":"@apollosproject/data-connector-postgres","version":"2.46.170","_id":"@apollosproject/data-connector-postgres@2.46.170","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ac646b9ad2f31c2c7e15c8e12911acfcb1c23274","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.170.tgz","fileCount":348,"integrity":"sha512-FWJETqfwLMyid6Hj/TZzKCBJIfUm0nDXG5WI1ued7DElpXL5t4TomS5Om9VlURYWZ5umbJI34drheCZ2ScSZsw==","signatures":[{"sig":"MEUCIBGKutYOWAxJ8Gz79l09hochJsst8pGRLfkDdJmAB4pLAiEA8znqPpA1YpPygC6infhmgVzc93TiLBhPAUHAFquRi0o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1130060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTA2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOQg//VeSCNFAOfKi2mWTpDnRPVLv+ejtfTnfIuT7gL2yNxpKisv4m\r\nfTKPWCEFhwlnDP41kWZO0YaKV39B8WoEBaXfAaqY8lcb43Hm3Cn/0L3bDvAq\r\n02fY+Wefiy6qXgpE6XZg9a1kSPRzr3hqnz4qLeEW5pngifXeMTMKVevM55mW\r\nA5NqENUp6dS9BdPMHfrRZBpP8gkMXlJuYecavGKY7UFHKsVKeEgS2egTfFAr\r\nn9DLaKzqVvh09STKZdDpyDNffdQoVPJdmVmxjlVaEVHip11T39EkdIi6Au5L\r\nSW8ClOY8h9XrVusAZelqaDxCs7I31VcUXRboGLlBZWXZBd0dZvRMqGQ466Xn\r\nkvoBDBso3qL0U2CLWKGg3gkjqVct3u9x345Xg6NOJIim4aNJ7FNcQwFH1+s4\r\nHOXvVng65hFKWPWqUZmZyvM5T58N4U7v4Urni9NhW8xWo4VYeyzycYCqABNB\r\nnJ74J7nop0MMh8vISwnnelEm5vYJayZQuc4STDf0Q6QJjP/tJPl0/AbWQpEh\r\nA67mz+OlmS7Ws/EI9ZpxfqxeCLI6WWIiX8AmIcBPFRNeuSJlKPw6COn7YHZr\r\ng4q2QeuX7w6z0Xv3ST2PcN5W0/JP8buU8yQaXTSIoSTT0er3ZuuXRdXeprrc\r\nKGTXA79BnDpMFxo4pfQWZfIfKjFkxgNF7bM=\r\n=ggat\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1f219b74183b511b2b7b54b04f033ae12ef186d2","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.170"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.170_1648701493850_0.01181667320232127","host":"s3://npm-registry-packages"}},"2.46.171":{"name":"@apollosproject/data-connector-postgres","version":"2.46.171","_id":"@apollosproject/data-connector-postgres@2.46.171","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d5b371cd4ea47ebc980b24dee73fe81b6a705c52","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.171.tgz","fileCount":348,"integrity":"sha512-pWVMDuJKE2rcDlXlk+2x+a1UDtpPLCVQLVw3+ZflmpLrMzmnvA0OEKn+YR92AVnBlT5b3BReDXmqKK0j515A9Q==","signatures":[{"sig":"MEUCIBVZ4dn1IKFMbRSbI6wK+lWz6t11ETWwGdE0/dLBwV9VAiEAy7WvI6ugMjvOoVUOgQgFiu+MEzfe5FZdsacyzejKpBI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1130252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTDcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoeew/9GQ0pdpVODi2JnJS9wBfxLQvuf/C4n/gis/xsRC8p4sw6rnIW\r\nJoNkeOAOzibMwsmmuC1Gu/wRwaFk+yEmKCIriABP33CwPhy3dTURAFmzf5H4\r\nAiua+HrVHWmFfn2cFiCgC4kmBcoaSvY9g20c6svp8NVEhN3owp8ZfMbFGKIw\r\nclBhdWEPjH1U8Cz/OVm1mdt41fdt9c8B1Hnc2igrc3wy1W0/B6eB78VRyNV7\r\n1uQXsk4dzRDBWZthfnioeYKO4LTi5fzlE4DatTkRKtKcovkXm0QnNorWWVfI\r\nZ1/kDXg87Fp8byM20GEzfx3Dz9zqvCebLPA9FLA/M/JCkr2ksdyI1f5J2SSR\r\n1p5bfdmO+obyteG/kLOBtsA+EhC8zTxok/u+Yhw8JPpBRzpG5YgEi+snljW/\r\ntaTEONDDsHVnk3W8QnfRyqsFgece23CXE5Xn2OFKYSRc/W/N5ySui+stqi1Z\r\nexenUIj2CbPx1P51yNJG2B/6ZoW92U12o+usBAsMQw4oDVd1OKiZqdNy4r8S\r\nGIjNKH8mTYjhTd7eEuOZVYQpCcfGMgOahBTcynsBhMtwB1rrNEc12GO5ikkA\r\nFpKPzY5Rtq8H3RQtbXxi9rO2dJiCvySJsRfqr4DgLnEVQ9jt7vgJtoARgqzy\r\nTenXkgQTmLxQmql82tmKJ5LlqshOLkoCWYk=\r\n=DCwm\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"412a1c164c0d6402afe5bfbcb7335904c1909582","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.171"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.171_1648701660292_0.8344029170899201","host":"s3://npm-registry-packages"}},"2.46.172":{"name":"@apollosproject/data-connector-postgres","version":"2.46.172","_id":"@apollosproject/data-connector-postgres@2.46.172","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"14928a1d216d56705ec8c296fba56ba92a255a46","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.172.tgz","fileCount":348,"integrity":"sha512-mNzG+A653QGE4T8sJ96jQQz2aGfU4yAXJ6pTXY5lZnByaoL+eqqTn+QXna0KIc2o3B1ARYxES5II6BZYmRh2og==","signatures":[{"sig":"MEUCIQD9b3JbvE0NFhBuAlXZb6AIaC7cPsf5shimL2O+dvupVAIgUwXRB1YzgvtzO4Jx5U6mRt2SmWCwFUov8yR4o57t8pA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1130444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTHVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCWQ/+OXgf5CYrzVeOrONIQ8llXv4/tavbsMVAvSV1BT6vUMWlYPhT\r\ntAPxzroJJAdXuoYrbrPc9jU3GD6WWC9x6RaoHPJQcmaWagL+yiJx3Iy79BFD\r\nneeqm3kc6rC5z37IhIdh6MyHSAu4oGRcyWi94dsc1MT+3NfOtfb0W8ZLW++b\r\nnfFiWcO3GF3J2xzBGI9d21RKbWit6k4d6h89gZPYAXN9XjljevpZ/VNuqvU3\r\nk56BgxvAtInWdiy12dZA7lXuK8IMeTyusloEt/KnjtwjLQ7fQD5tPndtAv4J\r\n5xY+gT5LjYAS46Pcu00KEHo6ARjAcMf6xgKQeMV+kqhzoKCWUvVQO+DSA72T\r\nq2/MmhTTroHoGo3mKLBQ0q26YeUfwxIkbZsINWvXtntT6S+r4BGDhPdyku62\r\nAPYiEgswXYbhPN8L40V8eUZdixsmR8HYj0ScOEwyIL8KEyXNkxYiGdACyheF\r\nBaBLikB5Wj5kTxs/bEvDnfZDWYWO7UaMzLXIKaXwNyNJssLM1TyeYkRv1sm9\r\n6Dz6RrCnS6VPT9Vc1iaN7bU2spsbS0YJGmiLDGwtn4c4d8rI3ch3eJpN0jwK\r\nQ6sq6up/y8JUx6Ufu9krvgk2HblW4a8YOkUBkkP47dI9z2xapKz+RWImlb1N\r\nIGr4LXYcQzQZsIDYMWP5XruePZ0g0NYOLr4=\r\n=ybRy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"bd29d663ec91ce2c1fa6b39dc1562bff0767b1d6","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.172"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.172_1648701909242_0.1568214678438704","host":"s3://npm-registry-packages"}},"2.46.173":{"name":"@apollosproject/data-connector-postgres","version":"2.46.173","_id":"@apollosproject/data-connector-postgres@2.46.173","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2f600a996c9132b7597ad8835ff9f1f9ac69f052","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.173.tgz","fileCount":348,"integrity":"sha512-YZ2fjifwwmZTcshTM7NYh9lD/Awd5TjsiIg1xacp9qrBY8n2lIdMK1ufX2jvhTCq12QJwLzl3RjoB21zMPT2Ow==","signatures":[{"sig":"MEUCIQCaK6AG+eF1NHhjmNRrBs7EvI1Lacx6kElB6PTYnXeCtAIgfxCciHz/zHmo2fNPuIw6H04H3wHBK4qOxAkkTzuOC5s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1130636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTKJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2mA//QRWPugf7qQ+07XiHtShFEw/P5hpAOBpYUbO+VMDarphORK1b\r\nj/kRS20eJb8peHWh5GwhtqGL7g2R/78I5hyCjBdb9lbBhFfN12NHIqkAWHRa\r\nUihNWS4pqkDpjd9eU6b+tgitEvpr4cYf5vxPt+wTUuNDEAwlkbJN6LScjQF5\r\nLgCFNa8S6UlHVLtA3EbiwAiF/SD8I4tu2FNSsb+86G0ZyF/UFX/LFsyZ5U5H\r\ncz2wSnKRndeDs3bNx4k59up8Oy6+RzpDf6Bnxe1yH2jzmQVzs91K2ZOtiTDe\r\naHSKW4A1PglSy4Q3TNcT7EKoNptmIMh36C+kzXWz9v6qdKguTsqAhsQM7MJi\r\nfSutZK0OozjWPdGfyndMVnblXIiyTy8tm5WJPDEtsO6IXdB1/xrZM8QnxAPP\r\nxxJxgYrp59mcRWQay6MwlQr99vDf9EsGVBqRTBZMtaUV7KELBM6Lt3mHliTv\r\nnqVSp6Om3xaZl2znJXsHPi8qkkGR++19vzVqJvxlXBtIHV4bo+twOv6QVLvt\r\nabEAKg/T7yu/Dasy1FIAKpsjrAvTaFaWTjoZAJElGrf9T3kgw+BlrccZDfh/\r\n+OyYoOfCeOwiAFkbL8jJxs6KFKROiNPDCjT8y12zbrMjjbBv6k8Yrr0SUe8m\r\nuH8orvnhYaIx5xjUOyQtb1H4NE+Tq28DDP8=\r\n=CWYN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"92610ad8d891d78f50bf251926e897f7a9be6634","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.173"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.173_1648702089025_0.3235521389795448","host":"s3://npm-registry-packages"}},"2.46.174":{"name":"@apollosproject/data-connector-postgres","version":"2.46.174","_id":"@apollosproject/data-connector-postgres@2.46.174","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ade105ef3bb2adb8d56df810f43981d8463dccb0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.174.tgz","fileCount":348,"integrity":"sha512-4QXvgP1p6+QB7wxIyGQm13Jv52AwjtQGzv6YgxfaDlbpmi1XEmPuE8QOkrlY+w+g5OY9P0th+jSEcXvtaIX2KA==","signatures":[{"sig":"MEUCIQCs7Mf3hIhxprYMKNiv3eDLQinHeba1XPBmFwTnMCTzugIgUxj2teG/2620zBrkOLZt6F0QifviU8e1b7OAdROKpWY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1130828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTNYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxHw/+P+/hvvxk5MjPpHhl1/GAijGyTj71O9bb2tCuOSeYVOU2KL+z\r\nTU77FsJb0bmr2+nUJLS5182soQSy2oEdhMK0M4jCg1jKswgltqK2cu6A386y\r\nONptKlHvTJffhQyPio+Pw1h9wVuhFo3kiN04ihY03j+NdihRl39nKxA4QlH2\r\nPi5BnKBEXwdoFBud6hrLNVoHMjppm5O5HNxXHmaVCY/oau24g9xmM7SGJ4pz\r\nGA7yYvDozvVjqaUk4yySmg0Gg4xrzV4nJ9QMgnexswU5+MSAhUzRLJls8Bdh\r\niMgUKwkZTsHk/3OK2HDSFcIPRqfCLA+SHvisCbb/lo+dn4qS5b7R2oJJg/QD\r\nDTYn6E6bLFuD7s6irxPTeD0xaQz1wK6xqSHYcm3fVf89eswiTR56DeP9Wa5I\r\nhG//W+BgG/3msXAIjIeRdUFqPF4ThRxjXmEFzEDEqgF3r+HzFOrm1/xi29Ds\r\nN1zkTJTFZxaBRUiUzcnUJSj50SU8hElxTsyE047YPsOl5DDH6q3WIBIj7+Xu\r\nV5+HOnl4YEO0Ydit37MT85GJUWnPVzgrcwIohjAAGFOT0HzmokDC8udQVhnt\r\nf3do1yDU7V1NdsYqbMQgFHbrwJEsSMJ9pbj31k8G9IySkOT+RID6ZLqDahm/\r\n6wm3Hj3VBTLxiGFx/sbsJkXhl1ZMMB0qgf0=\r\n=4/a+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"7e44c73ead4d42ce091c19deba82456633e222df","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.174"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.174_1648702295949_0.08032262153175607","host":"s3://npm-registry-packages"}},"2.46.175":{"name":"@apollosproject/data-connector-postgres","version":"2.46.175","_id":"@apollosproject/data-connector-postgres@2.46.175","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d7bed8bca1f2b1036cd687b2bfe7e7284c7d530e","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.175.tgz","fileCount":348,"integrity":"sha512-lFwl0YyYtOyd4q21lL4PB53Y/0pO8ZcasU23bzJiW+7DR6ZfC9Xa0Kb8b0SSHR2lfO55m2xOgsMkfJH4uCtFJA==","signatures":[{"sig":"MEUCIQC6VNN4Qc/5kxs7j/dFTTXO82vUmoUaJDsms8Z04GCvaAIgHM4jk5v2SH1N0OGHgxJyuJOCXWUwkyalnqOsy3UK9sA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1131020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTQTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzcA/+L7SsL/uGb3Ig3COstRyugcvOb4pisvi3Bdj19iOB7zbrEQhB\r\nOac+HyFZveDejd/i7SwDuWPQHihVP1UVxtVM8maZ1Hz9x0Bw7nUfYGjWyFso\r\n/PBmVYGSmzWL/jl+v2t0wC1GizdAKLaYtElhA9DVF+RI/DVN9Ekwissx7iYW\r\nWGWp+n3F2wJbHSJus0LiyFcGhmRoPyRU4paLYeST9x/cfEDwbUalvvxj15iY\r\nmcTFBZLRWPPtj5esyK3OvMb5Om60yktrcUOGdy+gElvFGe2PNRkIG+OHAD1E\r\nqgNFpltjrIrwJW3sWudgXtE2c8s6MR/RCNIeK89Jm9e1n1FA/MiOeUDo6Thk\r\n/EwGHzLNsRYlhQZ19A9risXScWg+cmIKMT0rR9FgN3h1ix3WbKICbuPri967\r\nXkUl+HP4dksMcohYWBJ3aUFkWv6KurtIa/0CyQGri/gRsFxkTmDKjPUeN80f\r\njw63J9wXQ0V76TzqrflZD4wKGHuvdqMhr1hf9/eVcRHcxUtg3+6gYTl/0ejx\r\n9qpcnbEBR9CsHKq0KZ0BUh2jRbwYswiVINQ/Uw0L3Nl/S1LtOLJ34yv+Nta4\r\nGDcTKo+K4dkqZnN2+wyrDOsIYpx4ggTaCHW7chQvwIp/CYoMXHkfAibmI3Eq\r\nGMz7cu4UsyJLEJ4nUFKLSvxuhoKcjlttTEU=\r\n=9/aX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"62dc1eda03c493dd53d65479f60a3c28d31dc62e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.175"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.175_1648702482837_0.44302838045734827","host":"s3://npm-registry-packages"}},"2.46.176":{"name":"@apollosproject/data-connector-postgres","version":"2.46.176","_id":"@apollosproject/data-connector-postgres@2.46.176","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cc905c48fd8162ad441c1bc19a5e03db6261c3a8","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.176.tgz","fileCount":348,"integrity":"sha512-tZmbZTpvz8u4KhDVNmJrVc9jXUKWZN8ea1a4kx5bCwo7yPWrO+/4TyIccFghsYSRvvgRzFDURC8KpDhQFyENJQ==","signatures":[{"sig":"MEQCIAD5a4ktguoBSNo8pktMHJmC7lvjuyf9EzvUYNPftHEDAiAnpBIOf22J9Ft997haggHLIjVUgzHzyvK3YqLrmqXiLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1131212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTTHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6Zg/+P7RQQKXLJr6cVgaJJC3X+tI4Rg4ftCe8n2Z3KATg3NdZyUeo\r\nyVr7e5SM9oTyh8sDehW+P4RyzloPGNEi39InQG/NyPWT4ZgkvPpWE1KN38pR\r\nHuBcJjVd8wjzAc7aSVxNHQ2qcM99utZXlnvM2224VNvxnD180WOiu5ZVSBn+\r\nQD3hZ8k3uypmEAwWWVXsjp7CloTZ1lRdE0edIZXM5drbZpXYqttpwSTNqo0K\r\n1BKbQIrqkNS+sl/NC8c9YwmwTW/aUGXJYlI5cDZyXln2rtk4a+DhHHwKgWBr\r\nniVOUFSoX7sz+jgXF0n8ZbxVJix8CJNpIW4wybPpmdqaE/qQ6tIVOOMdADRb\r\nmKTgYrTIvuiTzH306P+ZICDSS83OnQzBgJO1Sc/98xSSiB2JNg4b0YTHFI7F\r\nw0SORQ8oyeOa9EBNAbb8YbLi3+ggOfwbcA1NvKjmiUk1NeXYhTkcyuSHJTPd\r\nDl4ZlSmbuI9LP2bKzTJiM/9OQ5/HyX37zwPc9CxS59ig5XBv2fce6RAvA/4T\r\nh8laDi5OO5ccCvm6IYMV5+qTI5jdyQnXVR7+CR04dAiwDrAFZfkHdS68BTdY\r\nXM6J/UBu9sUI0sLM+1AAGY2E6dpFDOwS4hkK3UChaBM9NGGTiTDNumEb8WvU\r\nbC5feusvDJtiIzZBqwJ5/MZDuSoWmDCsqVQ=\r\n=Q0/H\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f445a837b1b177aa3dd0e5f26bd2d16aa3cc8845","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.176"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.176_1648702663041_0.5319851513717349","host":"s3://npm-registry-packages"}},"2.46.177":{"name":"@apollosproject/data-connector-postgres","version":"2.46.177","_id":"@apollosproject/data-connector-postgres@2.46.177","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a07bbfcbaca50fdb4753cd40215618e6403361c2","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.177.tgz","fileCount":348,"integrity":"sha512-nJ8Mp9eYUj/Rb4Jd2F64e2pKpz2Ra8VOy3/oR8jJZ9V6Qsa8NOVSbPL1u4giffEh65B/7ELndNpgEr6Y9PCuQA==","signatures":[{"sig":"MEUCIA+hq+cvATVZvQGf+2ZxVuHRicoqh1j1Ii6SYmBlM00RAiEAjJoceeeGc9wf+0AcegRJZLu6uvrjn/MZDv4inHbzDKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1131404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTV0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbJg//Ry4IHyrRZ8cy9rLjv95TetA7P45WUzgvN9Y1T6t3O20Ad9sJ\r\nf4im/nmSa6spdzqZqtr8pD/vmziE+QV6vArzmCbGvSfKX+iQSmyyTrvk9AYL\r\nbPh1Vg4UKoIDHWLbC4auZ69ctIN41Ifv0d7HBMwXTGvJZ/Ul2HrlOYCvSVZ6\r\n7LTJIP5A1qw4RAPDIWyV2Wug4F58J42AwOqEW+VuYT500usMmHmfti6KW5Y5\r\nDHUsNdYHLj780LGNOAonHAP5e87m31uQKGarnSXMRl0+myGfhGvmmtReQR6F\r\n1nSsgOLG+qEOfEw61CN/UvwDBcl2wtNs0x28gQmTvgTBnLmLJJ+ydtpezHLs\r\n7D1Yju6wk85nf8C9c0QgI1qlOmsi6stQQl1Zk4pg9S8E69GYurvop81+LgCN\r\nPhWzhMj/itZEZJ1eXTk8zOjHPrSYfsWnS1wYIPErXCFlQKkn94vKYYRTPhQq\r\nf4xdndlrkepBByWo4lK9pR6E1RodqnUaf1QeCq7iDbYP9xWqjqbVR/C5fzYP\r\nFTe09XjwuL0V3VKcacwNx/RU5SrPSY08V79Dw2XNwwk+01LzpHiH0XRFmDjk\r\nDGO85XDWmWLPEi3PmKCHOSvIVRfWD6cWC8o/gHEQtGRt3RsVvKIPcWK6kmX/\r\nMTEOTVSmXoBC0gp+/yHph+K4WtUtJZGtoCU=\r\n=uoV1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"cda5828d5e92c136e2ef0f330e1d4789215c1fc1","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.177"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.177_1648702835884_0.3790768383003482","host":"s3://npm-registry-packages"}},"2.46.178":{"name":"@apollosproject/data-connector-postgres","version":"2.46.178","_id":"@apollosproject/data-connector-postgres@2.46.178","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"935c2e16df03731f86ad2b0490b5420fd7f7f703","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.178.tgz","fileCount":348,"integrity":"sha512-Krd2gKKRzMLuCi7uWPhPcAvDxCQZfbYzMm7vC55TLdgX5Z+zga07mYhOxTRsqqY3G5J9/ypw3nHuqbyxSupCnA==","signatures":[{"sig":"MEYCIQDtw2oCLlMnJJ1f0kMCUDdlFkKvWqcBtbNuZlEB7XIxJQIhAJIw5D5p7Nfxk/pq7//7bXX+yiTCsmASItZF1ir2dRFf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1131596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTYsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHTw//Z1tQJrC701DuOeT18Ov0mwwLDhbWp6syjlk3Q5qpctnEjSN4\r\n67GasT35G88ewkCSShRibNl+8pcq9oLNZCi614kNYLAUgCSouF93nQ6nLmR5\r\nOVX5gtCc/hPuemUZby6u41J8UQYspcRqU23FpKcZhtyVwcVaet0D2KTnacch\r\nesVis3QsYa7dnX+c08jAXbIf1hTIUdieyyAxUOiHJMQO+vSNTjKPh9cLQSQL\r\n98KpTnHxn/3W+f+4N3u60hrQfPHF8sCKsJYGiOrEVMgNCiLmn7wN99Wuf/jT\r\nd2eUrgiB47VzKrm/2o+yXpKXRJVUW6IYk1cLbx3FgYRWu/Scp3/ZoAANk85c\r\nKqAdx0hZaBp5cZra4GM9dRa31qv1ZNWx+YAKdz2qIxxdUT/ZAGkNHF1Z/J5x\r\n5mMEEn5X+VFupJ+mEw3jpup+3VVDkZww7e1LHTdur78A+3/eupUot3h7kugx\r\ntmkDuY7i+47ob3g1h97SYd77vaBuv8hmKeIfPibXwHielkkrWevxc3LKRKSe\r\nuY3n4PTvIIlOMEYCzSTA8TGY+Li1Cbx1DLnCbZyaWiKoyreNEs6DxuS6rb8e\r\nXyTc1EhHEHFOJUJlyZZYGPINfLstZ0lytXZwBM2VPHt6Z6crKcnVaY242q/g\r\nOVmhv1jDoWGPDa2k43N5ITm45uNyKGB765A=\r\n=IJ2d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"f1e682d61c9eb0a84ff9769bbc376cdb8288fda8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.178"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.178_1648703020106_0.4366821214456298","host":"s3://npm-registry-packages"}},"2.46.179":{"name":"@apollosproject/data-connector-postgres","version":"2.46.179","_id":"@apollosproject/data-connector-postgres@2.46.179","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d157bd669c88cd831cd49340dc2434b2bd9feba3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.179.tgz","fileCount":348,"integrity":"sha512-/69FSHqJNPtQNwT6bFzrg+57zilv7CVmHxRYh3EkfYlezvcIPimAKd6e8M3gketC7cSsrD0isrF3SHHKVs4m+Q==","signatures":[{"sig":"MEQCIDRhHG3oU6r4636P8PirASf3xBYgu9XlkPPKFM2K6XXyAiAcm85s/o/prEpJgTsFq/k189qTzuYgQicISKHdz0BBRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1131788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTcLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpk9A/8CaYYW/lS4TG1K/pvgpnFHl62Esa7Os5oyhKb1Wodi7IxQVUi\r\nwV43CQWR2mtrf1N0L3kAgb0XC5nCWwi4IXYp4sndjzdS+5kU5sX0RtRTdFnQ\r\nmc81Ue4VHYyUo/BBfTr1VdeN2iycGXcspHjeGn+EQICB45fMkDnIdXkYPE8m\r\nu8iR32eyxzaVkz+PimUgL3fF6tpxWaw2R6o0Be4FaaJOPIviqf4uzYdgnNhI\r\nMTh23voW3rsRvlxnOPhfGhBgxKc4xUbMIVtqsVkCpHRvtE/TahDdh3KsumRI\r\nL2WCkEH/LXwDsHdXDErFjET/xkHQHTPAsTbFHjby26gBV6g1kfGgvWRHvOuJ\r\nNXo4a7Ez0kEEA0jvoJnXaIs0MSCUmrkq5/AaOvJluknMH7f9q98ZEwfU9OGn\r\n1v83FpIz9dKs2HLtOdnCj3lAeIevKSfqWSjLX1nkJwDp/6E7QSD0UIx3pthG\r\nlN8p4VwWZamsruaj8NhGPWUh6obUQkpNdsbIsKu4JiKrsA8RtoRPhgsemPdc\r\natuR8xzqyepgh1/swmOsTqpHZnddfVxzchfETRqgOX/EJ5sR85VeML/uN9rI\r\na2Lmw5Im8YnVqlLhjeBdw2xMDLRGPfZBEAKkwL9g3pT2FY0cTrxRAFMEGspe\r\n1O+Sy0VD9tFl1wZ9AIgOWhWfdu9j3thjat0=\r\n=0C0g\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b6e9a3d9bdfd821f305fe51dc64660562a59371e","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.179"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.179_1648703243273_0.6776510137555241","host":"s3://npm-registry-packages"}},"2.46.180":{"name":"@apollosproject/data-connector-postgres","version":"2.46.180","_id":"@apollosproject/data-connector-postgres@2.46.180","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7935d1ce799952b7b7640df0509b39c5812cd28f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.180.tgz","fileCount":348,"integrity":"sha512-k91wpBlPCW2PN4IyrHe4i+bUP2l3jttMClvUTCjqYOV3CVYrK6d/uVTVN+VsBC0E3VGdvEWpURi7hACajdVV7g==","signatures":[{"sig":"MEUCIQDdw6yOjKfJgCTVcMKGsDA5ZfdWYGTqQ7Xa9zs7v7VyuAIgaOdE00H1BX+/z1DhM0UgSLO8sHEbBO82ySIpn7YDmso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1131980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTf2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8Qg//SP17muuGycfd58pPUnIwNVxs8KHArWfDQcFM/OUR2vTSqpuN\r\nwKrdglysGIbVz/puINkhR8q4/d04ngfBiJJI8aIVPHHHjXhsdZI8Fc18JkMx\r\noilQZXu7rby6fw6QMUTqx0u/pty06D6jUs+//l36k1hAgp7Co5eK1nJzbuQ4\r\nGv25jlinZcZ5YVfTwkKPtlQf6gRITiVEmOx3OtEEjtQVQ+SUuwB2bB8CgjeP\r\nt4/9V6RRxLufXuRkN5pJv1NVJnvP0f2wWDY9Jxy9xp/rZWHHD1LpRN6BTunf\r\nn/z022Rzc6A5cB6cXcYLGVB9JXXw4Zg4+N8ldIiAxBI7wwpjvBZDxoabp2bb\r\nXOLq0L9tJJ34jYTFpt5vvPMXitpMYfLQbe+NEH4dnoy9fGi/DBdDWCPAdg35\r\nJRTn1YHZI/soJNrCHxLlO0DM+NbmGsbe5S6+bH2h9kIcUWvIxTE3IDk/Jgaz\r\n1jMe2975hxZdUutITbkuW4tDTs3TDEfgjxJG1vg+syW4hs5nIATz2MOJZcVB\r\nsYMGaf8m6GHSrGbvR3oXAM7VqyB/wAAVcSLGokmg3W3ZaejN+6fc0FcJ25fz\r\ni/eg0/8HyctEMvxhV49knFNuxkiFs4sU4fr03WRo/kPatCvAwL1+zWFKD3EM\r\nuB9s21oUZ+eUq1jGMCaygNvY4kmvUHmX8Qg=\r\n=dFkS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8bfad9951a9bfe6521bc982f6d1d813c5b97eb84","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.180"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.180_1648703478188_0.026583923455753","host":"s3://npm-registry-packages"}},"2.46.181":{"name":"@apollosproject/data-connector-postgres","version":"2.46.181","_id":"@apollosproject/data-connector-postgres@2.46.181","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"68e87da3c7a3c0eca564119d28bf58af9f6a8773","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.181.tgz","fileCount":348,"integrity":"sha512-yT7uhhhWX2IOce65tPFAUuXpRAMpD4ZBKkkeCNEPB0891Jr+ShaoQKctSSvSNss/tMD4g8+bg/Eo7mg50JKCzA==","signatures":[{"sig":"MEYCIQCEfjbYYEe+ohzZnxUBFmqrUc4TOegIkHmzpM0Rj2wpiAIhAP/LlMWhKhjBLMFK0Xykw5k19Y5uc6rw7cbAKxD6fIWR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1132172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTioACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrh5Q/8C0RT2+8jVV44Bg9WdI1hhFB87b9e3wK1kB/kABh8SGp40bI8\r\n+e0uE3ew2f1vuMiQlpM+WPtOtMB+TTYGeBLrhfuWCsgw3nGl6GsTSCxU07Px\r\nX8/GAn5F1EnYRX+jo/3eknIPvehXiqWOJuLuuC7QTS9UoKAT8g+8nst4+FM1\r\no0kg7G81gjzqEdSRMrPiXaza8eJ0fvAFNYmYaq0v1S+UyM+7cxhbzJgJiGcm\r\nlZe7XUKGuCY2sbJX2a+Whv9T+XPxjB9/E4GYI24dV8Pi66A0+DtJOa1YE2qm\r\n2ZbD2xvlRmm0jNkmEXss1atJ4HaARXqOnESfs1jTwRKOy32noaUibL9oeCyz\r\nhIMsxwUFhijRXoLIx4CQynzh44jcxHPJySyWoLWymq/n6fjlT2bLtUZXpTfe\r\nDvHUTw8zQ682SVvrX6EiN9tRr5rePPGsGk2iXIPaxHB75M7JNuHJja/rf5VW\r\nBqAVrsYmf7jD3F8osV8ECDlZFUgROyesWUJloIPDWqoy0KeW271rR1EfVLwl\r\nGum+aK7FhNf3amSDeHobcS33tjyzHXDXp/LuJh364rj/DhZvtBvQmhf+eeMS\r\ngpDMo/C25hhwFRDt1i4xmAhZzU6r4UF1aQ+Nile7EbA2MyZ41/CJhjlCZDpg\r\ngCOH8U4ZlAzLZN6PfRCNMMQKKXDxA7RpCU4=\r\n=sgxI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"29c26de92452f7c96ad8b8ce764e9f823d9f8d32","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.181"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.181_1648703656112_0.8869699428738331","host":"s3://npm-registry-packages"}},"2.46.182":{"name":"@apollosproject/data-connector-postgres","version":"2.46.182","_id":"@apollosproject/data-connector-postgres@2.46.182","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0d483246376357ab372a265a7eaf4a77026bd597","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.182.tgz","fileCount":348,"integrity":"sha512-rbnuVWuSkwBbL62PjYrOQkwa+Ec+CnrJkPOQIV3pwqVwunV3zwi9WiDT2TrCcuQFYfBduHSdYIMrTg7K9yQuNQ==","signatures":[{"sig":"MEYCIQCptUzLt03xLnqxb/U5fNW7lLxIX85wK1TdwY2wL8u0+wIhAOqwflkanJPlKpKTW7UTzS9lq6Evp3G/ZINQrGwI56ff","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1132364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTlmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNLg/9Fc9+8YqJ0BJBRMM2ZWZ5ZnTNhJ9OTFvGQWopatJYmaFan1Jm\r\nBBribSyU/wxXOk3CtlGzokj5+VIrXKuLg06esiIMHbUi2KKlOfhuda6ejVx0\r\nKH5YOhYihQ4mVq+kxuWCybhmp0txtr2Fm7szwniKoTyg43aSU0XtiCjo9eNe\r\nEI9MLS2KYQ9lRdmev376RGkz44js4xw861mMdgVw9r3YX7uJAmPEcdpqU4mf\r\nww6NJqZI3UgbWsxH0W7vTn9ie++RyV5hHjwEqPNPoPQK6difOmbkvBlUlC3K\r\nJXglRjcWuhFjsUKa+xBCprvdMm4547gHOG6IFhvGYjC61nidab8GvmGzWIKC\r\nwu5SzAgJvuMWVeo+nNuNVtMWlKTJ9QgZxL/PubAZnq/XOWj/xEpdsQtg9Ohw\r\nUQd13R3hZhNnyw2EOtclnFv992EY5iVEtFsqlWR1bvIpaA3N2Mq8XO9HKyM+\r\nARWGI0ODDM/eIqhXe7m9VJmYGHuICy2sF75Xtb3C3Y1LH5pOUS5WWe/pHLD+\r\nMIY85BlkzjIQFLVDceaAdJu8v0RZ6CjKvVFfx6hcKABQ46zOg+hkGkz9uESk\r\ng6digTxmzesa2sVqy5hf9afgWXx1TatE1eURgsvf6grBVNH42NE5CSEytZOE\r\naqLxix7w+bGGodWlf5QQ6yBp2P6vCOQnl2I=\r\n=aPWF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"207014595d071f7ce424ec739fbea8ec2daa0379","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.182"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.182_1648703846271_0.15792471484186632","host":"s3://npm-registry-packages"}},"2.46.183":{"name":"@apollosproject/data-connector-postgres","version":"2.46.183","_id":"@apollosproject/data-connector-postgres@2.46.183","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"1fc0be3c020dfbf043ebc9352145dbf5bf7843ee","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.183.tgz","fileCount":348,"integrity":"sha512-5pSqdTEbYzPK8ZNV4LyyjBhVMJnHzV5a5GSwIFsLTy2DKoyqK9oKCcWfxJbOQ9cjr3QmOxiXxXzb9ftub0Yy5w==","signatures":[{"sig":"MEUCIQDICY35zydGw4nQYP5ZXlThu6mi4OEz/mMzgvxYr3Cd8AIgEx+gjIGD9ronKjExzwLfeed0vchNratXpRsanGG0rBU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1132556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTn2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsDg//cU/8z6bX0JC3IeEaoNyFLLyzjAT9J15K5B9378Hq1hXkgQqb\r\n5XSJmLK0xBknqFmvcAoAk61hwRxSBM39QpXeF7Vo7W8iC77g9PoMyDNKkQBd\r\nQKzhZcbnGHyg2AGt01bFhZx4L8l/0aNOpu6WaK20M1SlL3WwRvgvTHHzgXo0\r\noNLfuksNnVzMXrCgvHWhohTsLGJAb292OCe9ZZsW839MGersJpzD6h1Q6saU\r\npmLq0nUX6DfQTo6HULr4gNWG64BTQMJrffjKi+DiYchIGPtMn1VKIRsGzRvv\r\n0zhcVJDCBNdqWn/G5bHlmYEjAQhnMSXWMaDvWv60nX2rezX1qk5ar0P02nJo\r\nI+uSmEfiNiBW+PaQmYt4faei7exHX7aGVAlMlubJmx+NMhIcUJHsr+UOwV+e\r\n6QQzpuxUbcLVjLPxGdzsnUS+CHAftf7yy0Ue480omLwMpZJMhF6oQhZI9GRh\r\n2S6DNTgUTQWeyrT33y9qVkL5F3UHvlhR9Am2X1x6MopJ4AnsFJ6Msq00KEoV\r\nTE/7hjr4HDMjUvwk7uh87YE4Xdwo2AiDSQng17bWxq+vxN7j15G6E0ml2MEZ\r\nb+PaQxp09nFbIO8OHJ/UTvB5R/qfnCSVZ9hxb9rXz009THh/ettVPH+PoqgV\r\nO1misI7V7/78XVgF3cC2O7LhwqE8nWSjqFo=\r\n=zWQ8\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"3b433f03e166271b128aba5845fefba1a0165de0","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.183"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.183_1648703990641_0.01968352876424273","host":"s3://npm-registry-packages"}},"2.46.184":{"name":"@apollosproject/data-connector-postgres","version":"2.46.184","_id":"@apollosproject/data-connector-postgres@2.46.184","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"40d5e9b895f5565fa04437a149fc566145901ea5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.184.tgz","fileCount":348,"integrity":"sha512-QDgUmK2+MAEhnXZwS/Tf7WNgpTzzmaWCRqjBYT34CY0xi7OJPqXmm8aRkgjqJ0M/OPjACFtjK5v4rw5QeIQ6wQ==","signatures":[{"sig":"MEUCIQD4b3QO/O4wrxTKeTdQvVIb0sSt25i7WpiYIvavHiGQBAIgK+xDM/Jb7PLVAhmMRzoSXf9dP8/ZGmNk9hQvHFHchyE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1132748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTqSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppBA/7BIv8zbxdwnCA5N/alNarqiPOE1WJlFRKS4Fzgi9Oht27d9F0\r\naoZr0vGFl9Ytzgdq4ORI36YnICR/SWv5PwGDmEEfbauUAimedrOay+cbu8Cx\r\nDuO7BDNhsrdIVBN93iqRBZ/aO7qyvPSj8SV8wu8GT+aqv1ZsSeGqCT/bTnUh\r\nMA/1Wtsbxsrbp5xauPfRM4Eiz+JtWj1DLJf/UbarIQ6vIl9wEXOXgG971Tl0\r\nd62Ms/r/c0U3n54/f/RNfGuyRWkWz2ER+jVMPayw/M6pf29HbPGBDfrOgD95\r\n1iDNtETrDUvv9j+zCbPQ5lQjK7fZlQY2uW6dhoiIIbFlDtKHIlnd64lo5mmD\r\n2SlmHAox2qlPYzNZ+2A2mec3DHvq/H8F6HfDjtBsE105zlAsDTJ4XdY5gtlr\r\n+ogSGGvMBEBAosBAULLjX+qjEIBehL3Sqq41Poxey7MYhH1sNCDqkOtKp6Iy\r\njK+taStPN5tsgfJGB2PtKdIu1UaAlf/o0+KfDD5COcEMpF3nnNX7ESALrdU1\r\nlCakH7ThAGkRv9yfQCS7dCrBRo115OffjWZFrljCglsZRvMbHvJqTwQ1gyH+\r\nixoDBDC0nMad8sz1qoJSVXPolP6Z+wIEVNzhOHH1+eXmHYv9Syq8FBRefWvh\r\np7IeUOxcwihrBK/joosFjEDdcLfo76M9Bhc=\r\n=x9Kk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e8a4443439661b949094a040e0156230e1c29f0c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.184"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.184_1648704146020_0.977382230801265","host":"s3://npm-registry-packages"}},"2.46.185":{"name":"@apollosproject/data-connector-postgres","version":"2.46.185","_id":"@apollosproject/data-connector-postgres@2.46.185","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"3be1137fd0251d0e4bcc2c2001cadf14daa6e356","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.185.tgz","fileCount":348,"integrity":"sha512-90Uv+s5biKVmlrVGyXCDIir8UhrI5HbdMI6+KSIXCtt95wBl36otRRVy5jUTNooXNtS8F2b6lgRBnGsaDremPw==","signatures":[{"sig":"MEUCIGOTMmbP8IXu0wOT92CWyPQ7Way4WUy2iDCuLO0cgOdkAiEA/xq8QYiPgBXqRltMuHjlOyerIrSwDGoJqHeyJkOptZY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1132940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTswACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOZhAAoffTINB9VSXJ2AwHFGyjccKyMVufsQJmeDkCtZDvRsRMJoY/\r\nFaFRJFT9bZboAGGlC9LyjQISAze873zBgiAJA2GzR2QQhFeQ9gI3pbQCKw5M\r\nLcYRW9xCYFyF/Il/dqHTx7yE9K02LixdaTXen7AsIP4BnFQh7qnIpP2FHzqd\r\nhDpfywd/W90eQ6arY1zFtUxESfd7ONh1IqMSL1mDTLawNkJ0AAOxMGRQhNE1\r\ngidUGHRn6wolA90KVsmq+tXNws8+m8dpss8CNDjfp9PKe41rgpqam5are9tc\r\niYafIUrNsN4Av6P6ah/zzuf7ejw5GZKP8FeUYGcyC/k9GWfY2hKQG9N2r4Jm\r\nZxgiGg29U/W8R58yK6uDcEilL5Qx5rWWvomLnKOZ5pEsZDzIKrVp80CwVG/l\r\nvOlM4tFXg/7zNqcSJ7Dg3NPvEqJ7O9l/MDMy+tdPiHEo8Gk5uXWDgnDTwS89\r\neXHFKg0X9RGEsPWaLYs+vf5vruN5DN0riBejJCnk52D0nkreD1vu75DBjqw5\r\nxG1kaUwVnj2FtS2nJUU0K6soz/LjdPMp+7IQLywT4YOSoPCt6beO/UVFRjBM\r\n8dPFNt6X4GQb/WEOwtD1nYatg1hyOn+1Y3PN2p0buNe+gFciEC8/tZyhZfWu\r\nhcfVHhuc9awNrEz/bYGctyxmG1pq8yNyjsI=\r\n=vDkX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"956fcebfb7e005f77a2776c917c0302ad84ca93c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.185"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.185_1648704304755_0.13408658325033285","host":"s3://npm-registry-packages"}},"2.46.186":{"name":"@apollosproject/data-connector-postgres","version":"2.46.186","_id":"@apollosproject/data-connector-postgres@2.46.186","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"dba2f349a67a690cd47370e5afb8bda3d67dc85c","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.186.tgz","fileCount":348,"integrity":"sha512-64peMDgmWLc3VFtvBJMkxvwMpX/ANjHlUacBlvM8Zv/q8bdQWsDl6uc5ejugSRpBKW4SDDOV+w7IuFjwDSCctg==","signatures":[{"sig":"MEYCIQCB9SCtnD6SuvW0tWm6ZF8VgzNBaLGDot2N5MIh4dnM3QIhAKYTykbmy1ohShQLQgKKyNXOGI/aZwDg/se+XhevCcbj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1133132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTvUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5MA//XCmkLtc4tsgd9ezd/uhfn7eEXQSYkFNYk7xuib0rCO2peAEN\r\ngrHgcmbsptrIVDPWxg0cRNxXipr2JEk+76BRL5JtXDYC6jzyvfS+yO9kH8Le\r\n7Yp5uUzHOIB3EQ75w/y27nBEInveBet7k5u6Yw2CUfsMf3nGiqW9J9Rpem5v\r\nBVoAyQXzfBMCACU/NUb/RtfNq7LWC/s0w5W5TlBrY+5xLvCC96mmKcW2Fj2C\r\nXArzzP4hsJRI9nyCg0776vb5VsPzh/rQvTlNxK/6r2+rXE7xTUXwDBsr6ROD\r\nzZW7byBAh2527tsh9GzReDWMhIYpbl1G8pfmquN6T+DxSCxmMtCf8plezAXL\r\nSNlwTMkiBRQ/F/MM5nJXFL4LjZiAsuirBC0gOM/e3ko/KvjhB0NOsEbynn0g\r\n1Kc55oYZPC5fFS5wlZwmCk/MFql1F5Ls+VpTeV7wfLjf14ZZyQoQBpJ8PQSN\r\n4x204IqSt6QdYinrXL7NKFGaJTVMfRl5pEWZWQ5XgyFcxGaTfKGArMQtNYXW\r\neZhmQ3mb+zTQCTOYgFmXYDnKfHjXLM2c58b7a9UtU6t75lC+c1aXYcImJdi/\r\nImDlQNV3PDZTYd8TpJZ7MuP5eNRiN8sUqmhgNLFL7JDfQsCYvhgvK443vc42\r\nLNz8Eaaj1gq6J4cH8Wx6Det5rvc9Gk4uTcQ=\r\n=R2HD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0fc857e7c10d9c3adc2faf0d1cbd6bd9672cce8c","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.186"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.186_1648704468521_0.7413142628759644","host":"s3://npm-registry-packages"}},"2.46.187":{"name":"@apollosproject/data-connector-postgres","version":"2.46.187","_id":"@apollosproject/data-connector-postgres@2.46.187","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"eeb873c8ee5fef6473cd10fd9c930cb4130d2313","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.187.tgz","fileCount":348,"integrity":"sha512-fTKU6iDAHeKn0+nmb7oAsqX43nF3DCt8KKGc5Xvm2FLZR3BJsltzY+kW6DShONJHairMinA8dN4bLBGT+NFbZA==","signatures":[{"sig":"MEQCIHEO16UuGMrYoi0iU3RvcuBRA3mQfu2uDt/kr1Bz71n1AiAyVeMWugCxzxsE8e/Hc0T8eMXXVY24Reusf+pr4Tuk5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1133324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRTyzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDvQ/9FvEVWMeMZhZzMY1ThfONpoRyjMNaEKlb51V0nWl9F+M2d2Gz\r\n6uGA7EnbxhlzMF9z7jbdaTUzisXYwT1xBGJMqmniLJvMLXbhUaVCmIX+LaAV\r\nhbL3jdGxJMajotJZcZYPiZF5pf7R9AZxwf+kv0to23z0bRjGeV6lzr7pNrkc\r\nhl4sDTJQzH3sCK/m6Gp/HBj6wqQj4e21+KixlPfnQJ2PNc1V5q5wKCASUfFb\r\nQSkGRmuRjNR/E7mjrAZ6J0e0CfoRfIYBmoncnemW88gEkMuuMlGyM7k0laEq\r\nKozZMX5rQfk4W3pMc9vjodfR5FcYBtUDtoa5xNVxolJBgKwQymmW+X63Blsg\r\nQdm0JiQaLLkttqVc5xyo/hdi1j/cQlclOc0NNKlSIZ/QYgKKvUoOQ52cxUpR\r\n2uFtbOX3EPaUKBw6ENtMIuS+SahmZgsvwD04vSr/ts0eyRWVexKXEUa0it1R\r\nZlnqCSiDqTqm8wzoXpPpJ1pxtPQyLzPhG4PSogf8x7Hcui//awqArG0U57pz\r\nzzRMZhk4dNg0hWls8/zPRuRF+53xeJ674kEu+JV4sqUYn8AP0WoMY5Gvy8mH\r\nvyGaGN1t41TDEAB4mRLk+iaXMfoZtO2Ck0xfNiJXQlMpUWLZ+06dvDrjIeYT\r\n5rniNUWHuK2VELo8nk8qFFhKegnpRaqdN7I=\r\n=54Cv\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d5ca2db73809ce3ce4694ede8be15082155277c7","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.187"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.187_1648704691648_0.8719742156483974","host":"s3://npm-registry-packages"}},"2.46.188":{"name":"@apollosproject/data-connector-postgres","version":"2.46.188","_id":"@apollosproject/data-connector-postgres@2.46.188","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"84586caf06aa38ab00e4199a8b35d507050c05fe","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.188.tgz","fileCount":348,"integrity":"sha512-kv5zXZvZBFzJux3IMmJTWD+vGzYQYZdGEKwqBfB06N7LN+dk01z1Yx8EWwhmcnNN/xDHPMkAHnvhtWhhbzHNpg==","signatures":[{"sig":"MEUCIQDDO/RPFpXJX2ZVfHLRxhtZnuPrbW2ZjDLuT4Imfz9HfQIgSU5DRmKCz0/RX8NeY1qO82RQFan9bvSRB9IuaqV72Ro=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1133516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRT1JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvMA/9HAk9LQErdooRKvhlRhoGUvYEe0f9TYMVTeo+VVeds+GE/B3l\r\ngz7E+qrxtq34p77/N+M/DT4+Fgj3hFVyVMROFKWq8rYDw7cxzhI54qEIxBHI\r\nMR8Bqw+UXBWyzC/QzXOoQX5KFs6kFxkPXff3BS1ifOHRO4kOD6mtgzVzukj8\r\nGYUS/q1kZxZF9G6X7UA5fe1HVQAPQPH3ZYSLcvvrFKE+Wz/o+4zKw7dO/Ss1\r\naAxHWWa1aKJQkypVIZyF2c2s0oF2WCIwi1VmpbTMh9BDyQfywqaHnR8r1ztU\r\nYkQtUgWEU0A74ERAtrmlKyECZVh9Yd33x9Jj+QC+25kiM6lkCsE/UfD60ve7\r\nDLWwnI6lF1SuYP+LUNBLSvP+rjQyjggXxn++vqnUZXWLb2OlLENWaBiWi+p6\r\ncZH1XobyWhIleHYWWPlm5bqjUMDTOL0R1SvwXQSXN93pvRqn2QZ0ZgxPIf/p\r\n+SfflkauU1sOWjaKseYfm6NWEo0YAsh/dqjddDLHqRlpdjnkIuq3f1v0CWhm\r\n4xIxRVfBiTbZXGoIjCiQRiTZTKl/1Q8jcPap3OmDzsEQLIFEHO5hwkodG0iC\r\njsKudCC4OfTSxjEE1FFsahx3z3ebOTOhJGxjdkHHbKVRXnw+zhQdI+HzRi6O\r\nCG5zq1jbCrgSahwOhN6cDF/x/CBVnhavqO8=\r\n=nx+5\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"0fb0bbaabf13e3d0a708ca953b9b645be10cb72b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.188"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.188_1648704841287_0.5484663648202777","host":"s3://npm-registry-packages"}},"2.46.189":{"name":"@apollosproject/data-connector-postgres","version":"2.46.189","_id":"@apollosproject/data-connector-postgres@2.46.189","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"4c9ac7f890dfbbf1f585f75294b280a62fdc2cef","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.189.tgz","fileCount":348,"integrity":"sha512-iZBJEt8hrEGymZmHd/Em0Tew/4W323BLfWVslbJ8pq/p2f/VZPHRTN82q7dk+ZGxli9kPxWTLofUyT7hX9wG/Q==","signatures":[{"sig":"MEYCIQD+Vwsf+HNU2swwSmKVsq6BlaTfmBgbNxSSYd/vY5UpOAIhAN6hh3uDVHtD5CrVjnjGU6FiUp0l/yKd4SLkiqWLWbs5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1133708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRT35ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJLQ//ZIykLPBCWkKp6HRZ4rw5UmCB9vpJFuEW/u5wDQOXfr18tnVS\r\nsN71CN4mlZ7WTwa9cSg/ekWSVyj4Kfw17rFstlbtkqQ1oSpWdwALIKfP0X1e\r\nEXSW9aKIxUP51xxvYhCs8ZiFua956EoBrGmnBZOvzifVxyC7mcUjyRJCAdmC\r\nbBHnScEjlson+l/NDJv2z9CxfmgR/5tpegH1ocFSoQ9m20iCAzwTmN5nMGgt\r\n6aKfTdxhFSZ08XP5nJ9BMsWpExWN9I6+Urfq2XtLvqdW73uSJlHaJp9TW3Fc\r\n5zjDSKJEve/GkgIJFXOAyQCmlfpOfQBbQH7/+KXDOHUAdWq1E0VqVCjHSu8P\r\njEYwOwLGiBU/HVeJtnSJ9DgxxHenfusbxHb+dbkG6daoD/kp2PRiWoT3/MM9\r\niLqPXtmqspmIAEOmI+8mv/98jO0FmiqskUwpG70RA9zf4u+nxkUSRqFApSwP\r\nzUcMbj8lLy7RLzu0PBI1WKEibBIc+MnyucRDVsHt8V3rlIp9SlvJhgMTGshd\r\nn89etTes5IwUzQvx4X+UE5UTlMoOCdLjoDYOA8BfDQQUtPVRD0wcGYpp7NK1\r\n8/oaR7oEOF98itw7ECCpuzT+PyQrxkcsNjRajlYmsapXHt5vG9cVZXzZTJV0\r\nvd1/bpKPb7+eQYOA6I90GOkhl83+EX2XuKE=\r\n=5oWE\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"1835e8ccfe1737104e2d35e2a2147086e8582a08","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.189"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.189_1648705017660_0.0976154064661987","host":"s3://npm-registry-packages"}},"2.46.190":{"name":"@apollosproject/data-connector-postgres","version":"2.46.190","_id":"@apollosproject/data-connector-postgres@2.46.190","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0fc6816739f7fa4dab7b8d297dc08e49340445fd","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.190.tgz","fileCount":348,"integrity":"sha512-a0l+22FhsLoXwQVQU0nKNBu1oCOvWaVVtm41nO9g6U1hYnowpwxXuYd42U6IrQ4AcLqVQtRSGIfO2s2uqGy2KA==","signatures":[{"sig":"MEUCIQCZnz/RVgUXQcOTYjlLokhZgOKjOruBpcoSJnYWxdM3nAIgQs5tkTvuP07U0zPzqEgUUVsB9HJdIs+QELQSAhAV4aA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1133900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRT6kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKMQ/+J6/tQ0qfuInKM3sLbGSYy7tvfpWkfydNCbe2Rk5rw9esQAgr\r\nlAC4ZQkNSX/AKuaUOsgnF4YtOaZ2Aek5tGgb9ZAhfIiKf9UNGN1IWNoiTqWI\r\nFR/QpkQ8LjrBJpX9DwDASrgLKe9YQd5U3zDbnjeyWv6bITpoJ5MPNX+40cQ4\r\nB/Y7s5QUeVTLBJLwyWZhs2+AVB7taTjep+3x+bBqOMJ4yCMyGZL/CSyKeP0I\r\nnKoAJiKGkfNDHzfJfnWeQYDhCRgbvZLoNIXmdw9mru73PKCeEhzIGGlKVdxv\r\nxVWFFKS6F/N8TTBCUZoASYW03gpSzuQRkAmrZva1UwbmWm3q0UBs3zECQzzl\r\nheSdkkf5Dz/Dy1mly3Rs/otBS0wyNSSSwwKGPMNgnNN4KsDO27tnApZPsnzA\r\nK3BfeB24ULUUWomN/wICbJKHlxhyYERxyO9j0asJg6HreQHMj14pMOkd4ZBI\r\nkoPqY+RwIxY4P/aEpCT4z/sq7xnbuknqLob8qaQAkZAT4SvnOYTIhdhRyvLF\r\nbHnP03LStOMgA0fEWqKW3K+j3GutUjvVRomEw4jRg4mH5BwBlABvgJYxKr0I\r\nXV+815fgMBUFOPl8CUEC+GNYOblF8c8s32ZBRNQhY633YQ+JtrYCJneOMDTT\r\nTIPVemz0iimxa4cqdd7CNXdg9khov9OyrrA=\r\n=uWlD\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"019d5496d7370a150bd54d7e25a89f1b1b64d61b","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.190"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.190_1648705188334_0.7799967316529357","host":"s3://npm-registry-packages"}},"2.46.191":{"name":"@apollosproject/data-connector-postgres","version":"2.46.191","_id":"@apollosproject/data-connector-postgres@2.46.191","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"210fc080de80fbafcbbfc912db76b30901b73355","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.191.tgz","fileCount":348,"integrity":"sha512-oci/6K/TcUZtOWeCSSMUrPH7aQeVXwJNcfY+pV3Wjw0zxmjY3M1RQcVrkeg8VKMaox0tmhrNuvV/uT+olVgU1A==","signatures":[{"sig":"MEYCIQD8S8pRdo1D3muUYkfakZu9UXln8TVcGOK0E3oc5X0PcwIhAN6CSrUj6y9/ceI+m6QQJtYE2PJlXOTzEok+5rAkU/Uf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1134092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRT8/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/Hg/9FiJd+wzXH6zERLdveyQ0UL3LYKhEWe/+Hf7RB2Mu85xGyZg7\r\nBFKFyUQYnJvbZaTCSWRaJaCBwlRYqJBSpIqZewY5cofauwc4fIWcPi4wng8v\r\nX2jGevX+FpnYXni796QH8HUKNdi2ICFnglPgT7x/AMcluE7EjGBqrwVj7Pkm\r\nMraaDwyusWGUl3uyz9HBAvlGdILpRbJjK+kXbY7v7VBnHlBTq36SSXnWq445\r\noVFU68Ofa2sKj+2LITtIVsGoKX1C9mWTvnLi74vDPEB01quW+rPIMtf0O5ls\r\nowzBk1U69hNNd3e3XrCsrn05B7AbdgSFt0OVgw+tM5lEy2Iwqyl/XLOg7WU9\r\nVvTmjCSKDTGxlAgkCbzerL1SFqxn4vGt8F56VTWWU+fgfIhnfC1R9Qax6BUI\r\nQud6K4AE2eFR0/Kr9P2dK7EWe6eo9qCjv/vk1tlTLn8cCU71dfJ/VNxYyqWS\r\nMfEkeB5epwGTDWJNyta5oQOK1ziEVQMGZRWQ7D0f/gyu47rOeXNG6oUWZq6V\r\nV4QFBdoub4L+JejhULc+jgoSzsNru5ujyjjtelHJAp7Ws4n38QxFfVybwfGv\r\nqtTGAZKdPT6hph3kXK+gqXWfluZFkrtkE/YKPWrwvhNakwB7cfLkABIoMCWU\r\n5JLoApZsVvu7wfvhvJWEcgE89DKrkUxZKnM=\r\n=FuBC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8324b843464e04cd7cd545a37cb6383457a2660f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.191"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.191_1648705343064_0.13600840212013754","host":"s3://npm-registry-packages"}},"2.46.192":{"name":"@apollosproject/data-connector-postgres","version":"2.46.192","_id":"@apollosproject/data-connector-postgres@2.46.192","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d6ae92e87d2b9b74d805fc4d38ac3631296c5d56","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.192.tgz","fileCount":348,"integrity":"sha512-KcYtm6CRCOP8HT9ORvBSpONkJkkR1DTSSzkJJ6if50sI67+KPRT4z3fUCkFngzuoK+gF1l0lFz8IfHxgZkAJ9g==","signatures":[{"sig":"MEUCIH5hmOYePQxXAVPFRMV9uHQOZWhaXsUqXLoJuyVhFCQLAiEA3nOFWgs8sf2UVrYkysxTvHxIkKjnb7xF2NoDgwZv0Hc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1134284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRT/iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiVQ//dz8EjVzCQvcOrgvRviV1IEy6YWL8/acyNaULNrQNrXupPe9q\r\n1g5f9qyem0BCt/Fq3epi4W0EBeHHxTm8yFrEwgelZ5wzFVNHwHImd95LPSeS\r\n5ZDuQfQIM/tcvMvDioQLkOnS9Jphp0rk4rmqTIfoLUJnOhRmTJDBTyzXY/f5\r\nBUpRi96cHB4BisuvN3dVVi5oInYkxb1OAIPDfosViFDzhMfbvQuMAWNyLzIe\r\nb0yeywVLtVXmxsPgGyCe1vHZf3EnouircwuPRTyO1oxXx3vW1WWkNH6cjWFI\r\nIDgS0dtHncde3ac31Kk0G3fvQqMIIrquFi8WWrolmX0XW0J5mKI1/UuCqMdF\r\niCNPJkrVjcPldiXLfw2IVrQcp5dRe4WItxJlkSc+27fv0wGqbP5AFC6eLVY7\r\nevRjtzJrnLEOKuq8Z2GlCwk139aEV8HZ7pIh9sUi0UVvtc2Adno/CDc7cckN\r\n/YJ/RawovpjHj9bHVZFlbuYW6OHW5YbsP5toCtAtlnc1US+ePLEuLak4M954\r\nIMMlz25ssvkVV4V0Xs22BKBdatmWI90ZN0gwCUhsvaHfWif2bHKzbNGD0fTE\r\nTliyk5Rfw+0q1oCbVdgIqyTQucUJCQRoHZow1UdA2BgLaQ5YVb/A8hOZiEQp\r\nbCD8xhA2amCYAPHPoqKrUPnnvMb2VtdwV2o=\r\n=ZOVh\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"2d17456c3068820f95329c774a16a033a0fc7aac","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.192"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.192_1648705506656_0.9951639945403845","host":"s3://npm-registry-packages"}},"2.46.193":{"name":"@apollosproject/data-connector-postgres","version":"2.46.193","_id":"@apollosproject/data-connector-postgres@2.46.193","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"df80f05633a68c2b580a908ee3e92166be295092","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.193.tgz","fileCount":348,"integrity":"sha512-yXItkfEAsAXKWoF9AjtRHbnZIbkrl3iA6BeZM8jEWg1e9d26n/5IKmaHpy6uk3Rcuk6cgPovFrIFgUII97xmTg==","signatures":[{"sig":"MEQCIHktdBfF1aqA8c12jqUWSXstojDl8AqXJuH170An366DAiBGf8noyYYGK4Qxh5lvSxLgwlWJe82FO1Y9CRE6rQZoOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1134476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRUDRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojkA/+Oh86Hvy8AviDa5CX7608gsxvcYv7JJp+fj5ZJ2fC1Pp2nmD8\r\njbJkvIQqLmvZiVSO4OKrDWxXiUF8ramn2MUii0XUTOD+RDvjkOgSnhbb+roD\r\nu5k/YykottRMo+FQA+ADCD9juMuvc6jjYEoQT5Q0S7bfCY18AmCowypfjuLk\r\nLU+OMSYdTKWonEAcjJSg9QmI921MvPX+SK1gSxOmXLiEFyw7t4vwCY8CggGj\r\nC27N3gHX+0eK1C99RPAakaiFbd1+Rm5hsXPzUHWi/Zvb/EC3Adt2niDAWw0H\r\nWzcL4XVfQRfmFHqueehx+sgJ3hP5V9NmvV/NjCPAN15TG7wsLbe5vuCXeN0V\r\nU5qQXt6tFBCWMnu+YDF1ZTQ8SzhVuWItcHUvZSBERYdPo5hNItWDJp0X9dhU\r\nUxbw8Z+J6Xf0yWlPcAz+VwXnv8IkHdavw9VUc9NvAl26M6W+eBef5ekYzebZ\r\n1rcKb1X9I9chyXgjxySDaarPWhILVLhriON1khYmDSmll80C2rCTHAccOcDi\r\nBMycOXO60bNx55d1uSOwP1OMwBd9uwk7q4mXGULGjwUSnPCKdL+mxUoFykN8\r\n97JgWCnPlmhb1w1NXe4M8HCPECIj4hnNfU31wQdt3tzr1ZpJbBZA2FwaBzjD\r\ntLlYm4DuHfk6d2RfkUjJfH2HW2k0ZeDr9lc=\r\n=ClqG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"b6b952bf4ab5d216596a153f2ba2f554183bf736","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.193"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.193_1648705745641_0.03887512725572018","host":"s3://npm-registry-packages"}},"2.46.194":{"name":"@apollosproject/data-connector-postgres","version":"2.46.194","_id":"@apollosproject/data-connector-postgres@2.46.194","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a6e3b7d43ac41a70526e3da662f53788a1f7736a","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.194.tgz","fileCount":348,"integrity":"sha512-mx9gpTV10tEhFaqpH5SqYj4/JC8mNGPtfJRkRqw5wVjfIIWZJhqoDkpBemOkZiFQPj88rTjLG20hajOIYd8rZw==","signatures":[{"sig":"MEUCIHmwku+c6KgscFpUmgi/8hYePDSl7lwHxDeHlxwqZSeZAiEAjBIGxicRx6cGQQn/yVX+XgrHu9udvKKLGUS+tQpnOPk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1134668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRUGvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmjBAAh47+g66qjSXeGd9nGbyHZcou+im09c7xvP/4NAmQS5rJpbPq\r\n2+Zxa6yfOIebY+sbkxu+BhklhK/7wTSV/HFCDnRctCnn37fa9ptvTe/XUFIV\r\n8dsVUvArs2u1VkWP87gt3yP/oHbvw8Zn1YceMFSoX3OH9wuBxPhOI2z5shMj\r\nKvYmqhKmA2GJZT7p7a6NtSndepnkHkrEfzvcrjnhnDjYSSylrhuWAPc3rVft\r\nSeG7MiyeJe7jBYRSJVZQm+UzoJT0yrhQXhuQ9YEmMx9Rt7BUgOBgm4kjSttL\r\nS5UEpKMyLpxUuFq5TNDqy2MjN0O20RwxD/jtLNN7zqAADK5bwCe/6e44s1mI\r\neDZdRORXcsHeg2w/ROPQbeNZ9T165sWEl9/rmvsNsNlaFTzVunUCTvRsaLZU\r\nch8P54SgBX92wDGbLO7y4ADHbKG2GKXHLC7W9S1GzKbkBtlLVQ32PnIatX7/\r\nDPdk4wembCa1gC5kjKjqXUlfh/xWjp39xeAIIti7IYotPWnC9yjXrMougJTc\r\nfGeQrXr/mee6V5ZSgaOhX0OXtyqwpu9djNqvFSB4MU6mjKJzmOcXLd4ydgeg\r\nxjHnAVDJH/wm2vnLH9HbeuK+s1sa5NqGSzFJMQCziMh+9y8pDLJ+IKCpFg+r\r\nE+710HNBIUE27m/jDJjyeqiqfiz75NtWeH0=\r\n=AwFY\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"15d960e8182e5ee80ad2a9e7eae294e5f2c7efc8","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.194"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.194_1648705967683_0.013742892647948812","host":"s3://npm-registry-packages"}},"2.46.195":{"name":"@apollosproject/data-connector-postgres","version":"2.46.195","_id":"@apollosproject/data-connector-postgres@2.46.195","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"b3944bc36ed1e0e81fac7511e2463501258dc8db","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.195.tgz","fileCount":348,"integrity":"sha512-0gz4TYsvby80iH51foBXpqrusTeQuEpb2Mx5rNPReONoAp0xt6IlswmCIIIvckV5R+5lbOj696zWzGUs15eLGw==","signatures":[{"sig":"MEUCIQCvfSyaZ7f/2S/ZENHb/TYH7BpHqPRe1EbRtPYpTS1/EAIgDt5adNyxOoWHH2119svclVEn8a6qty9lshnYGepMNmA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1134860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRUJYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIKw//azBjtG1DF8sQxEvecFL2EfsruXeJUz5dLc1nmk64JMwYQOPI\r\nJTaGnaI2r1usPHM2zA1AQLwuQWZ9G1FaA5kUYOn0fZvAb5tl+E1VBaPmLZAG\r\nCIbqIHOHczfJ2n2oVPhTu5r4lso5ZzQy2cdhD4KKu3YPKn5SMLToS44S31Lp\r\nvpT3rdbtGhxsIuE8Z+K98BS6VL22m77dOMN1YoNVv5OqePK0UVEEy3rs9pvG\r\ne+cQAyOH9WzQlPA4BWa706MOfuq5/RS5krhJKOlc70KTk1prPnO1biM4Rcf4\r\nRJKKD/Vv1nLkl8ACiV3bbCG8+o5dtidiMrpLYmxeP6lAUGFHZU62Kj0KzciM\r\nNLtajPrtWdZrCtEpgsCJgtLCsaT7tLOxay+hlRLkmkTBxLNr9BezqM/dyKo8\r\nVqmrAN6buU5/DY0DnE54PBWeNZeUGU16MtRJqLOHIx5YpPIytDrpshPdetSj\r\n+zs9/FZHTyqGW0cveJ9K8kvhTXspIqgRuU2jlDlIYkMYP+qjoL5zTU/iW3xp\r\nJDGmvBqNrdte4XrqwQnYmAYY9Q0eaJEPC9aibJV9e/f8L0UnFdNyZnu3FRBE\r\ndPtEHsgG4j8hxDyLy5sJWWNBWKXiU0HUvA43SzFTep/ojhqYCPPicIG1P/XC\r\nJqRD76EU8eYn//ORn2NEGE/vg2AEiLxrYB4=\r\n=rZM4\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"dd119184bfcfa9a063ba8e869d65e703149b49cc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.195"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.195_1648706136063_0.9089398092124787","host":"s3://npm-registry-packages"}},"2.46.196":{"name":"@apollosproject/data-connector-postgres","version":"2.46.196","_id":"@apollosproject/data-connector-postgres@2.46.196","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"0dc38848f6b64c1b16a874f2967f6da1e8c76439","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.196.tgz","fileCount":348,"integrity":"sha512-yrXScB9uuQ5WkorgQ+ERxKF9jTb2NfvHlzRWsTHD/MvN7MpH64F92KyKlCBIMuWjROfRR8018ereaW1Z9Opnyg==","signatures":[{"sig":"MEQCIBNlYJleTr6ZvsTmJtY+qtcDvHoGwv1s8VOVjaIwztE5AiAFiWzLvDs3wb5yQ4LsCgHfgIdEuLvIDWblyaC9XU0MXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1135052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRUMTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZOBAAiGCGY4t9SUuug46GUSa2pObf4aMAwoae2MOM/iz69oWvKpCq\r\nPJ7WHfAAO5FxpQ5Sk1GJOh41XVXgMFdDqAyW0giDYg69yaEy7wHLqGp7usiQ\r\nPTmPHAGjsNXvWDOKWH8OpHGVyATXbj/dhngDNNka8LSeOX/ursGJTcCkI85F\r\n1kwIipJUfBcLLk+4LJIHAEUj1xQpTYkDwyc0jr0LhrY1tYASZqaLC18aLVgV\r\nZllIONP1B2RonYHdjtZVWOnuOzdPftXCJ36PgsCmLByuuiQwTsD5UIKE/pVy\r\nrGT+3wLIuUOxpNCRi1sCuYkzA5Yw4udfJ8uQF5eGtYChWsS/JA5zUhlg6lDy\r\nj2EtIlhisZsks0wMtpBVfDi6Fi9C5KQTSHdn1fa/x66RfsB69fFuib8mtUSk\r\naUSH5YS8NlSxTAq/HDgTD1vTlJcZFovaWimLQpuKGVSHNYQUzLP1EPngomPt\r\nhfrK6P6AQ7owROQRxh5RdvhMPpHprNvj7OErwUgYKnYTjVfKTmHY3J7bkwbC\r\nuEHHek3ggXajY+6F5SeS4dW07q1Unojy0j70flsz+fwKPwOvlat7kJCsxJ/O\r\nqPYaP+Nkg9YYo+es6l059lZaR9/aeFnltpbGbLcXXrR9/FpNxND8kyF4FlxU\r\nZhmDR6luMnlY1OPyxHCKYQ03JYdGf9Zx4To=\r\n=VmV1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d7b64afbb231f230124b1ebd32766e2ebf8fc176","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.196"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.196_1648706323063_0.17859955132722005","host":"s3://npm-registry-packages"}},"2.46.197":{"name":"@apollosproject/data-connector-postgres","version":"2.46.197","_id":"@apollosproject/data-connector-postgres@2.46.197","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"d56aff9c3cb801729c80b3c31e32421c9ffc70d5","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.197.tgz","fileCount":348,"integrity":"sha512-UstC7uXM15vHXJIpQWYM457fF0bDGesuHQvQZheTHGEeZY61nZFb24Fjg8vD9FbL2ELGJP1nrAhWLummOO0CkA==","signatures":[{"sig":"MEUCIQCeLjZ7clN/699vGIDAsjWeIravsWc0zKRc7Su1Iy8JSgIgXyqvB2NTnN2hAW1T4mQZMq0xPc3WBdWZcjFgJKwjFyQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1135244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRUPIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoL9A/+JLtjP0pXFYW2SG43KFf7MS1rV2cKbHTluRY/IetczGKFv+qF\r\nywrtPFdijMEG9MwqahxRmMOSwkzLbY2FVls3bKi11LSOgnSY3Wla05Nvtpn7\r\n0e3xkhbnKZvQwniO9ti1gkJAMKsiReQC8tEuKgaONyRrT37K+pEmQeG9QSoM\r\nLm64z3TV3TF4w21sSvf9cJwnLQJQdGMQyaORI8BUlqzMA7sYPeorIrAds2WA\r\nAk+0I8Zld2Vnq57rT3cUnuse1WDFMtWji8+TAitzE1g9EnTJSCBZopd3Wd7b\r\ngp0DSMhHKgpgJFujPvtKlBG20wSi03J1Y8e16erCryUZtC+yOGGLfYz+mvjA\r\nMa1GerIXVdNXOpEPc6rQ1JjgVhVhizBda454m2LEyZRjneOBIk8M5o5cvBga\r\nyZjU76EkbXzd/nT6ou2z6ov/EObBSsLGh7XcI3+qqgoGSr9ewRCbeiSUbGDp\r\n0IgHj+bObAG2RJ2xOGJvqR48qRGOtTZkQDIE9FqCGxji/O7gaj8JmPWominp\r\nIhJaue5RSV1dvLf+BvEulz2MG2+eVGoi4vQ6eo1w3lrBY5P33Us16T4maWX9\r\njw+1jIcAJjPHycwMEIRMUU07SgSDis0IHXHUKBk0UESAmE94QAUdQEc2QERD\r\nUnItK0XrCd/liZ2J6wVWfJtpZM1yOG5SFX4=\r\n=hTUG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"17ebd7c5630f1cd8074909f74083a395cc1fda49","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.197"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.197_1648706504702_0.10321486297192073","host":"s3://npm-registry-packages"}},"2.46.198":{"name":"@apollosproject/data-connector-postgres","version":"2.46.198","_id":"@apollosproject/data-connector-postgres@2.46.198","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ec0c9d4323690998ed30d45ae586177b0c58ad70","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.46.198.tgz","fileCount":348,"integrity":"sha512-IIzBUKetXwxkYhJLIOISYudNMCksxLT9rzwgQjdvY9OPbv2tjtggjo4eafezVbpDVkRMmarodCPf5wFCpHgL2g==","signatures":[{"sig":"MEUCIQD/Pwc61PdKOtzmS2kRXmGmuL1gTLEbcfD4Excf+iZsYgIgWPuG6Yhr2gUp/6Enjo7s0hoM40E3z2KAQH4rv1XqQ14=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1135436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRUS/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYEw//cp8wOgxXqAOZIyeKWo06acUCgeKCpG6HAsOMKGFz1MkNevrc\r\ntC748Pe/YHJPjTNXR1PSwntCqjxd54/OAqPnOi4fyxT7F8myrda4hBqfWbqL\r\nn+g0nzSFQCq87bkIlestwoqlstE/0SZYye/GoZDTGpnw0V4/VGML24AE7zck\r\nCD3hh+Y/3fQhi2+L+XV5zze4rcIxci2GXZcBO9e2BOcxARUl1L3pgIQrJh56\r\nOfJemBCJAD9iVHu5J79LjoT0EeS9EET6VwSr5rsNNBWce9jIbeFOB+JCkTdu\r\nyPDbVfC8h8Cfe6vCsRxmlTGd84ngoIXJ8QScP/1G5JwyrICVwbZoTJFe/EZN\r\nt9LOEzwRCOn3HeKU8b0/GUoCLU3at/vVV1mZbpkcNqKw/a5Tc0IvnMquFKCN\r\nq1BTHjazKBoTL+25inaifKjBcul8iTh62J8JhffSe3wpWaqMuxiEJMPqZ58R\r\n/C+/B630Qqj+0oI/8aM40Y9vaREfYKay1X59BCVudrfLZTczQlOWRD2QcfLO\r\nNDyBP+MjvkTYN/n9soufBVwLDAHK8H6XemP1w9iszfeCe8kmMgccl49/ZijF\r\nZSt/waGGs8idoAJlBVQtBRWbSeKgOs4Z+nIL+J2QhivfBZk4KvQcOeYkxkbb\r\nSRvj2mEA5Oaj3DjHJb9hV9EWF5+Ra+HABBo=\r\n=hHk1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"c601675711969aea9c21d88c5ef2c5731e044911","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.46.198"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.46.198_1648706751294_0.5422179921098862","host":"s3://npm-registry-packages"}},"2.47.0":{"name":"@apollosproject/data-connector-postgres","version":"2.47.0","_id":"@apollosproject/data-connector-postgres@2.47.0","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"24216cfeae14ec6b8ff07170a5c388c308187d6f","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.0.tgz","fileCount":348,"integrity":"sha512-c6/vscMZFhVhDODAX/Tt5sNg8xPjgg/VED9xhflfVBCsamyfUTQk2ivw6oDVyD9F3ODI8cnkMxAabMGkGofb5Q==","signatures":[{"sig":"MEYCIQDnGylSYPLU7uK/RLaB0aqzrgqm4gRy66+g2y81xDrGegIhAL9eBCHfBaaDH5DOP2S77LhSbm4eGuDz1fVVjRHp3+S+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1135619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiS1gVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4bQ/8CxW4Aq58rc+KrEqAd+Y7pUxlSlc/QpYXwaAxyU2Aam72mwaE\r\na1fdo2QCOO2gBV+pyFG6qwd/FXrZKl9/6oFDOQnzNgjZNFgA7oyS4dkHd5Th\r\niY+Bdv63bdW7uzPyWoRgOgJTeP7eALASLvr5PUlkp/93oTJQOVjQwDhpZQhA\r\nyp3/7J9G4yJUxnJRg4xlD9yoowhyDd1QDJz3VxZ45nUiwsxZ91Rz3m8pRArH\r\nUf1Pmjt8OirAFniA5oA8aBg8CN+ULUBoLpjqKuTLlZClt57BfqSD8XfWfbCz\r\nRVkJiAF3Y3eOuKlOQU6D0y+QGN7Sq9/2QLFMkW4D4YO+xUcJgFTWcVJnjy2h\r\nmizRZ/MCyEj7UDsqJAW4ZhFQVQ8jM7sDia59grhv4PDPpFH/DlZE0mGUksZx\r\nAWhxeQri7gDVcLCTR2lUwrousj3WAzgm8WZtisIeXtyJ2T16QRZWIdAvBewk\r\npW6bE8HECtSOWxwsZVJNqkTy/rMF15k8cCGU8uJO2oOBl/b3jHsyNHUnTEjk\r\nxjfZHFDokliH/HRaJvh5ZLrj1SZNB6sxZnJMtlKwELwmMc7Dca3fMVEBywDo\r\ngj8uQ6yAEt1HbqmDJe9n+GxT3R+uQiDsdArB63zqAc5JBnubEVnl/Uh9rKtZ\r\nf31+rV5Q2luy6cuDU4uHQhhlvYtLFLQlwhc=\r\n=Etnv\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"427bd1a733a4800f308f0ae87d0b61ad2275f819","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.0"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.0_1649104917733_0.6738760627180871","host":"s3://npm-registry-packages"}},"2.47.1":{"name":"@apollosproject/data-connector-postgres","version":"2.47.1","_id":"@apollosproject/data-connector-postgres@2.47.1","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"496e9f092cd713e047a371fd724c1fc7903de2d3","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.1.tgz","fileCount":348,"integrity":"sha512-euLPG6TjhIIv8Z4CLqMDGuwqMQvAybFoWhFbcUoI0i17oICIaDEz1FTb1tWuYykDcgGVnHX5z8rrrH4+GpKiXw==","signatures":[{"sig":"MEYCIQDeiwKI4lD6z2y0ZUrt/zUAWqsa5/K00yP0QDNUyE1AvAIhAOmUPd32S5jUVOQPetS7O0lzkeiywhkmlVj8gE9X16X6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1135805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTKWVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRPw/8CEvW3XMqEl5jYW4JCyZ+7foWP/Dy41jDkbTevIIVjTGNBGAQ\r\npoWRfQZh+pBmgvMp2dtV0IJQlb8az/2XxXc3U6mB0GmeQ2NvTHWecdiWo9A+\r\n5JOkJliFiHvIGN5OVD+Cr/dygDnkYDPUgei2iq1g0vy1OglXqRhAs4CG7MbR\r\nhNYN/ikwxx68qixmGhqb07JR25hSMlQKCkGtkh99kihoFj4WR3cqJIfOklaa\r\n4Vukf2VVVCj7Xb4wZQVb7JwjX6zthgYq8BKqMaR0rg7yqUV7K113obBcCvoW\r\nrzJWDmI/3fYg83yGPWfK8nqYaNZtGdelh5g851Ci7xXckKzhcBHP6J41e387\r\nMvhniHPdokG1rbjKNx9ks+GiC684hPMKAcKg8KA9+d75OcGGvOKKRIU1Bg5h\r\nrL5XGf81xIJIAlzgG/nDZTbTqt+1F3XbruCSko0vhcEsVSTjKYnqDaE34I6r\r\nYMJFrNII+orINBbJ/3IeO8n+lhguBkN3tJblN4YnvEcflurbWgyH9RUTxp1O\r\nMZTYSXBPqt2uGjoynynMFWqKVpNMv5VJbU2z5+6FStDD7k5tOuVg7DyY1zmv\r\nmXi09j35FoMHStk/KqHn5rpvWhCEvyLudRJbCvGy9h3MfmP/7KVfbcwpzh9I\r\nBcs6KABrZRen6vDpo/eI0xKx6+NL5uoPydA=\r\n=VSI7\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"d5ca95d54444537d3f21d3f76f68859c05e7bd72","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.1"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.1_1649190293671_0.9920513525327039","host":"s3://npm-registry-packages"}},"2.47.2":{"name":"@apollosproject/data-connector-postgres","version":"2.47.2","_id":"@apollosproject/data-connector-postgres@2.47.2","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"2022af2e7d7c74b1e15cc1e4182c602e878d64b0","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.2.tgz","fileCount":348,"integrity":"sha512-ZO/LAojMxSqCSUyiT6GRaZ3LuTQ6ytVTGl9yGCvp+F1s1Azd2pcqKfppSOqVWpoeUrDKpxLdteDRdf2DhbwTxA==","signatures":[{"sig":"MEUCIQCEgfbXgHvAVwulCb1ALnTqL3sNW/FByezP/G0b9PEwqAIgUcgxqxX9Svv2aMfIQ8gBr3aYNXHDS0Y6TfFijsYc0ow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1135991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVEvPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTLA//ZQr3LO6x972JX1DdleXTRks+FqLmMDxAfladJnTBrT0f+s6Y\r\ndaIXp1DznxcB78uIPSIlNUl5z/Cvqu/+/rHnUWp7v8l+AvgjPKg/R2sl49cO\r\nSNKVRo6EQoKg6t9eEe41x+DHuhqAdKmG3QR/cIYNrqZK4IPCDjtJJ6S9TMPK\r\n874vDMQSAIBF8muuyDb/+MZG+vrAzZoMfrOkhRpe/4S4YIdWzkQY/CG+gg+N\r\nyzBaHisaaUmQOx9D/VKl//HO8ZSR1Q+HrqeiXI6xfAFvAygJH9DhXkwzl9cP\r\n/ZG49Pqv9H4glZvGOtf5PiTNYn68oTQSOP/b3uIVkPT0xhWsMyFb6VgU09PQ\r\nVovdbRNyWcsN64vkxNi3DGL8HnaZV3q9Y2mqYldDjwu0zFIzY0dn8V2E0IPn\r\nPeba06LEHt2Uj0jhCbskfBtZQScylV0uYfkEggrC/OxSmhuvmsNp6OQfwh7u\r\nIIyeqn6W2ACIBZy3Y3Kt3l0tj8sitpuxlNgXYFc7FQBp8t5O1NI1lsbsvJz1\r\n9EbXjVAaoNYh4ICjMiTj8bjJPhWWH5u6CZtl/e+TPMPznrwiKEcrxTlvkW7o\r\npxSO5k2/yd4MG2dP2Hdb9oCaNDlINaob+cwNrPCBou7itJ9UnTANU2FMo3P8\r\ngYju3RXiWEA9Ewc/VDN2GnPt3ZNDn1GOLlE=\r\n=Vwp6\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"e4978d07bb64614660bd0ba39ae4eb4fc4dce289","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.2"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.2_1649691598851_0.8852697562086007","host":"s3://npm-registry-packages"}},"2.47.3":{"name":"@apollosproject/data-connector-postgres","version":"2.47.3","_id":"@apollosproject/data-connector-postgres@2.47.3","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"ff8610179bdbf1418694551d41dbb2afe2628662","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.3.tgz","fileCount":348,"integrity":"sha512-1Ood8nvLr2WI4O+o5WN/Y81cHMhoM5m6K4lxGVtTj/RVz+oi7fRTrbawnGShMr5Oz/ZgOYNzw+UMrTpHo1vt+Q==","signatures":[{"sig":"MEYCIQCSu6mZI9av6zdbxVcmXZdyy1A5zpO3dH/P/Z08sy60qwIhAIlco5Pii9aHqzsNplRup9x8lCLfgQfsTy7ZYxCI98T5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1137634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifABAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvYg//UOs5o/zFRikyETCc73kErxNw6jKKf5ptgzN3MSjw06Fq8gNY\r\n4UsD2fiHraxxxSYxrLSTBglXIXKF4smq76DbsKsF0mxBciU0QChlef5xZAdN\r\n3AdxeXvYYoctHHTO6Eo8swtXW4Gdv5VgeNsiyTaLU57pO6wJTddHtACoAyeT\r\nTHbwBfWE4Xqrs+xz7efuk8z7eDNiBXhSa9NaTSdcn6nGuMgrtCQvUAhzKlGQ\r\nHrskUbbE/YrGnCNRxD0mH+VcDmQZCj6LLSHQ6iM6lDeKLxNO5GBppT4RFCpO\r\nWq247SuutvCpRPanVbOzRcyKLM+vzJuQwtSMZz9DfHldW7YVWhP+eFb7hQaA\r\nP3Bxgm6g/PLP3VDJAqmjGnAPAtsC13gy9cHbhAmxx1XGeFlC/fKd3kzpBBv4\r\nw1UGbCaPjmN53nLPJVY5PM9u7aoh2n/o33+M2L4804Pa7AGmLvzv6J3Wxbko\r\nt5+LW8lHNSjYREn42SmekcFw9FdO7uwHlyXVzVWcU6nasPZ2p6fW1AI7FcAK\r\nvUJyR20UGYb4kG61MEiNN6wbGofogAEDa7CdvQusbrUYLn/y1E3UFmK0S4dQ\r\nnp+yVSsTWzum7TlRi5NzZuZMxesEeSyGRB4v2jZOd4Z3290UHrjDeTGubCgk\r\naZkVdibR/zSloigJoTz7796SwlTMaqruj34=\r\n=jd3t\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"fc237fc60a4636ab94dc6fb9cdf03eeef1371014","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.1+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.3"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.3_1652293696286_0.5078072578445945","host":"s3://npm-registry-packages"}},"2.47.4":{"name":"@apollosproject/data-connector-postgres","version":"2.47.4","_id":"@apollosproject/data-connector-postgres@2.47.4","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"a98524ea81135b1a44ec3ab1ca90f4a905b32ecf","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.4.tgz","fileCount":348,"integrity":"sha512-vvTtmE6eErFJPO6qy2kpZfIic8b7bDPJROS3CqRJa/21Umwq8DhaGzTE5mEzem4V1w7ZCS2+QOv8+SFL+k0Fyw==","signatures":[{"sig":"MEYCIQC8EfxO/9Uv5Tpcts4W1iduyVLc1bVP4fP2dUgHlPyxmwIhAPV8rI8CXMi7ICoNrt6AXA/DpD7TZDYI7PzA8tZa2CKD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1137820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioUtBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmptbg/9FJbd8TCeSSSFCXJXTeC1FIHYONCQsASBnlCxpqM7DzUoVQqU\r\nNbCvr6gDZULV2rVrj6aZ8VVwr/7vfBFczJAJnbGEW8Ga6N1V2c45TQGz25On\r\n3/kk/2u2S2LOllsR2nO8VxeLQaH6l8HlmH2EPng8zwIobGPI5RRRra2df89d\r\nRGDnRav0m1FZf03uQ1y6rFJQFNC/jk6uJEnBu2RPs+i9rVB9x7rGWZ3hznD4\r\nTxkDe6jqLwRUnj53pNqUBaWbphBnx960hKHEczi3r9uyobWd6qoff51aikoh\r\nC7O271dDyovy51u/2XUHNeMYovevuvMMqYZO7TOKHPbJAIlkGDtsAGMW7fJ7\r\njBVv3Tk1HARrq4mHz6IRWqsFEv+NRObrkT2LxfOcjK7svdfxMvgint9vgDaw\r\nXYT26qixSzQwS2Yun3cDHWlkgP0Q4uKUzpdXyyq8NdLs7I2aq/zpdOnaqDEx\r\nroG/FhI4j9MtxIAZ1742B37aV6Ihu0Rrgy+2SXDMH/64eU165DT4CQnzHZ9/\r\nwzXuRiwp0ycm7lmz9TRknXh76rs8ifI04zHDiNyJCnCT/aTGhKYc3J/TTkQl\r\npnZaeDSESSp7TWcgf7mLo58Zh4Pw+Wz9y/9D7Wew4KxIkDoUYB3oz58eSXE6\r\nIt/ZlCmOwbHcLm5cCBEBDgYLENfAKesT70Y=\r\n=q1zn\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6b5320dd89d0a1a28538717c369f7b7cc6e8dfee","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.4"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.4_1654737728733_0.5202003814874951","host":"s3://npm-registry-packages"}},"2.47.5":{"name":"@apollosproject/data-connector-postgres","version":"2.47.5","_id":"@apollosproject/data-connector-postgres@2.47.5","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"82ce0304f971079f3a9af7bfa2a667ba9ad83ce4","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.5.tgz","fileCount":348,"integrity":"sha512-FhyRPun/6frxHAag7/Wrq0HTrT4/nN8AXJr4k2BuWOZRUioVs4habS/gBglBYZzqQqBjz2siMDEdFdNNhYsCcQ==","signatures":[{"sig":"MEQCIGlyzAo13JDdEwc2DkpqE56ys4YsIfy6aFa3D2e1+DeMAiBjprj8ZfvOG2NGdAxhLSFZY1cviYpYWBIrUBJKlO33Qw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1138006,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJio37AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3bA/9HBx1vvGSRBo/rHfrWm9yZypUp0sWm+IGrDFP/PaFNx6Iaf2I\r\nE+/OnWh/8yJrU+Lj8qzTiCeiM84spNJDgLAb1jxzrkf/6vLXQda5H2rddhCR\r\nH4+RLO4H/3jHFtKv/BPjERQiyqUdNOJn8AU9HX/FVdFriQGwiCH7lXODI1rM\r\nbmHNkBKo91k1cM8+Vizp0Z0nLYUNdTnXwD8DMq/s3Ez02RuEJ3KfRIQOxtfn\r\nOzMFkzVy6HCQ4BriEVZ8jfEEr7qFF0aF1T4rt0/B7N05opDzk/Gxy4nXDpLw\r\nh9ghSFublGOZADo/MmmYIoEpkstBU9lV6+psEttE/PruLyH3XC20X7k2sqmJ\r\nAOPiLuGQwDnxMmZvQswcU38eY1z/tUf5y9dmKJoOr8d8RRrch4DxJ0qZOAwZ\r\nkDZr+MTFfR6Y/qF5LQJdlV5p8uULMfuM7gYmVrU+jnjH10sa3IxxnSdedPjj\r\nG8RdHbeHEELR7kKi9TQz9c3QgjOmH0sV3dwhPZf19A7L5r56hsUfaPNEUb5R\r\nk+MoKMZUlVvSsjAjIx9XW8HcXycO9JtHJnFstRgfwbKXdu52urGlWkaKaJmp\r\nSmmiQs5bSyBKbYix2cuiOEw3YvzfPEDMYcC57J8Y0C8c0Wt9RbdZ98Uq3qXY\r\nBxncxQp7YWbrguQNeBm82U2Sb9DOFScxal0=\r\n=vlRT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"6e3aac319270138bcc2e1ac5b0f0a866c16ab62f","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.5"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.5_1654881984709_0.9506363596074683","host":"s3://npm-registry-packages"}},"2.47.6":{"name":"@apollosproject/data-connector-postgres","version":"2.47.6","_id":"@apollosproject/data-connector-postgres@2.47.6","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"fc01fe96d6ba9874f84e45445c01d61c13968615","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.6.tgz","fileCount":348,"integrity":"sha512-FFiHIyOk4WDz83e86IDYfmWvTV7SHZzsgYH46pxkdcmfnqSLuwrWzprJaXWJi05FEvVA9XEW9rzQUGlOC4EfqA==","signatures":[{"sig":"MEYCIQDJqtUge6QuiAqq8sGFRb7NbLRpFQmRP+aJn6gHYeFBJQIhAOKlWPSdL+88b52gMI386nVhsobhKJQu/x2tg6oVm22Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1138192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixuVkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp06w//Z2xoMogbUnkSpigboZwLTjNAWtlTHXcsmuQoHLuXwvgrPpIv\r\nRgCEa6cejNWYz9C2ej75qQFROUzUqvukaiNX7xzbe+h08xGLINaF7DyJYaCl\r\nbILxKSLxndlN0ZcOmJLcXoU5ep970F9pnwjt1lO7unAsXwNPcWXMAIYFWPbj\r\n6KpiFCpRzqhLz6BMAqmVc9QfGlKjWtm/aXsMA/77cg0g4Bks03biBloKJ4pl\r\nOjPvUqcica+he4SRhEpIvBGDp3veOn5pTCc2G/l0cSHUF8kZzgmiN9nMk2vD\r\nLa4q0n1aodvlgfY+oO9m9ZbC0RFN3bMIPrQFD8N6UirmU4xqAi8iB2s0+xoz\r\n7AROhHJLdkcmZB6PyVdGhWRiikqUb7p9JZt3Wy0jx8P6II6Df0Q6nLdX9D/1\r\nF26a+k8+/+IvJah1O3nQvNq2/ttMlIuS/0DZaM3wCmlKJgtMNI7C1LKotesB\r\n7h7lf6ILkWZUrYpvyC0Ge99bsHq1Akt3uW453ictYazp14KMGplwHL5yOshb\r\n/CXqiSJMPsSpIF8XAix0WA1Pkdgq5JVI26md0rSsEiySAPH+rxVNp0XO/dTB\r\n1GZhK1pWFqa9z+5VpAOmc9/CH5gwHdw7+GuUd+/tDTDThOl6DrfCnhpFXxrj\r\nj4E/wYRgqBbXVO2BGeGJGGXXlWaMBW2E06U=\r\n=SkXX\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a003460491c6701bc0c5180dc27f0fe27a37c9ce","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.19.3","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.6"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.6_1657202020537_0.028660961769967352","host":"s3://npm-registry-packages"}},"2.47.7":{"name":"@apollosproject/data-connector-postgres","version":"2.47.7","_id":"@apollosproject/data-connector-postgres@2.47.7","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"cee98237901c9360c6d9d73120313a46b314640b","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.7.tgz","fileCount":348,"integrity":"sha512-YFCbLL/N2Loa3kp3y76xnbYFrcmzAOHZSWPT04rX4oJzcl+xzMTSfriYk6Y+kpv8p3UGfpWyrgJuLKfEPeCrLw==","signatures":[{"sig":"MEYCIQD9M3b6QK7IvmWI0wHDdr1OhBTNrFv+SMKrqQVJkW1g/AIhANQ6+qhnPfdXf2Tqd2RSvsm/27ckRb+V6GyASsMphbuq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1138378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3/ukACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxJg//RREg4sPMj4tYVn9rEV/yxYdCMcNk28jUpuSDT7aFVnCtMjH/\r\nOZ5Tett505o7ZAq4kKxeWrEKFycd73FECL8CYLxH5UPASr7cwInBglwwNmkk\r\n4bRXM7vmKIDLSyojCePC/+V0eXaxfAmKfHM+zbV43A0KzAup0l4l8kAs6/lS\r\nAEzsdZptzruuZywN/6Ae0wdTaDrxXm8SDEURCFFRP6YpxCH18lV8d+bLNLvC\r\n+vCEOJVwaHf+k+otZJvmBAFviUHAxmZG+JyIk3Zb4QsWDtoPCxL5cDLcMIPY\r\nsvwFsiqSKc1diCaEEsFCFYUi/R8ipoYasPDNhk/ZkZkNXhDKAA66YmF90rLk\r\nuQ70V1v4pi3fg75hC9nQOHOas2WqTJajrSG0P0MWgrwEG1bhp0CVH3XD8hlf\r\nTUv3BM4luhCTB/9vr1BFjSLEJUqCPTPcNSYiW538obHoh+qNiXc9OVEBxs0A\r\n/ynbuHXFSQg7xIO3mUSr5C7KXy1QbA3IHhzALaZs1SnN0NU/sIICDjN2nxc+\r\nc9MSgEyiS0//F7+8q9PHRNhTUg7s/614vGdExndqVSMY3kAGhmZBQgC0YSai\r\nE2fMd7L6KBG269GiVG3LEn74p/sWj+XL6HMaBHnWejen2edNv94kCinFEA8J\r\nd0LiA7/mMQ5Ut2Wxh7J9jGqmh24alRjmawY=\r\n=/+uE\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"8d384fc93c44177d51a39a1d7150534180c0ef5d","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"didevshop","email":"npm@differential.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"14.20.0","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.7"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.7_1658846116243_0.6084664685486354","host":"s3://npm-registry-packages"}},"2.47.9":{"name":"@apollosproject/data-connector-postgres","version":"2.47.9","_id":"@apollosproject/data-connector-postgres@2.47.9","maintainers":[{"name":"yungvincenzo","email":"vince@classyh.at"},{"name":"conrad_vanl","email":"hi@convan.me"},{"name":"redreceipt","email":"micneeley14@gmail.com"},{"name":"didevshop","email":"npm@differential.com"}],"homepage":"https://github.com/apollosproject/apollos-apps#readme","bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"dist":{"shasum":"7799926be0677b3c40cd7dc6caa691ebb5bb4642","tarball":"https://registry.npmjs.org/@apollosproject/data-connector-postgres/-/data-connector-postgres-2.47.9.tgz","fileCount":348,"integrity":"sha512-O2f5OVyktGc6+g/evp0A92uKZWz84oTOmiL+sxCYPQ5RnXPZ+j+FoZC2VJIrdEFPm8hDSo5ZHttWevHt04IxWQ==","signatures":[{"sig":"MEUCIQCEWTN887Yw+2zYBy//fVB0UaacWxQKlqBzK95qyxpPdAIge1Iu/LMPShH3aMyaISwaMXbyy34ewe9TKKY4lSJS4Ew=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1138750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLGlNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobKhAAhhDiFTS1h5ijIOcVdtbZ8sWlgvm+IKDyTE/hE0IGUAbpAetA\r\nzCZ4lP1mOGj/+HQ62+6a1AZZ3QDs2bEl/jN1QtOVwB74N32dFkbzrHCnt/0E\r\nT3oYhkhVOx+ezgDAD4+RW+ruEt7nBUjBvUQt5yBW72DoRaNzia2bDjnG0ZMr\r\n3QsRFx8x3m5AEgS4KEfJrJJEicR0Ek43K0JhCLe6BpRABINyBfq9sB5vnPHo\r\nA5cjn7XRWmyG7QTtPjq8cqKYYHdD0X2qh/2veapnczUIJoeVVhPPklgAFIz+\r\nGu3V8FicCOR5Scoad68nVnX686ZyqYgA8KEgWKC8HrO6yABEkSvXQgwi4XDj\r\nXNlaW+muqNkB3YVXG6EPLs9Ie30z9BuXvWBvpCKSSmAxnFXTCazg6odEdtMP\r\nbMhCbg+jZYViV7YBAr6E+PLW6/XBdKIXexaYH0cNXJMjAJhxw+ewzdAaWpJU\r\nkQJaeVd0Zw5wiISTTO5Lh7u+bFf6K9P4DwWDUg/yyfKOO3GzK2vvlk9ObFxX\r\ndUjsMo8hUdexm1m5K3f6+NiSRpazXIN6LKMm0N/TXaeKjfsZ46WHuZOtwJ6h\r\nrZwXeuJSf9jJWe+Q0jkuwW3ds5l1pqsvZ750S6A5KQJxb3T1Y193ISGbBCtj\r\nGzhfWkJxGllIVsuFYfc0hDkwKb+XMSs+nGw=\r\n=HTjC\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}","<rootDir>/src/**/?(*.)(spec|test|tests).{js,jsx,mjs}"],"setupFiles":["jest-date-mock"],"globalSetup":"./jest.setup.js","globalTeardown":"./jest.teardown.js","collectCoverage":true,"testEnvironment":"node","coverageReporters":["json","lcovonly","clover"],"collectCoverageFrom":["src/**/*.{js,jsx}"]},"main":"lib/index.js","readme":"# `@apollosproject/data-connector-postgres`\n\nProvides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)\n\n\n## Setup\n\nModels can be created by calling and exporting the `defineModel` function, and then optionally by calling and exporting the `configureModel` function. The `defineModel` is used to setup the schema of your database model, while the `configureModel` function can be used to setup relationships between other models (ie: defining foreign keys). These are two seperate functions so that circular import issues caused by models needing to import each other can be avoided. Below is an example of a `models.js` file. \n\n```\n// model.js\n\nimport { DataTypes } from 'sequelize';\nimport { defineModel, configureModel } from '../postgres';\n\nconst createModel = defineModel({\n  modelName: 'content_item',\n  attributes: {\n    title: DataTypes.TEXT,\n    summary: DataTypes.TEXT,\n    coverImageUrl: DataTypes.STRING,\n    publishedAt: DataTypes.DATE,\n    htmlContent: DataTypes.TEXT,\n  },\n  external: true,\n});\n\nconst setupModel = configureModel(({ sequelize }) => {\n  // eslint-disable-next-line camelcase\n  const { content_item, media } = sequelize.models;\n  content_item.hasMany(media, {\n    foreignKey: 'mediableId',\n    constraints: false,\n    scope: {\n      mediableType: 'content_item',\n    },\n  });\n  media.belongsTo(content_item, {\n    foreignKey: 'mediableId',\n    constraints: false,\n  });\n\n  content_item.belongsTo(media, {\n    scope: { mediableType: 'image' },\n    foreignKey: 'coverImageId',\n    as: 'coverImage',\n  });\n\n  content_item.belongsTo(content_item, {\n    foreignKey: 'parentId',\n    as: 'parent',\n    constraints: false,\n  });\n\n  content_item.hasMany(content_item, {\n    foreignKey: 'parentId',\n    as: 'children',\n    constraints: false,\n  });\n});\n\nexport { createModel, setupModel };\n```\n\n```\n// index.js\nexport * as models from './model';\n```\n\n\nAnd then in your `dataSource`\n\n```\nimport ApollosConfig from '@apollosproject/config';\nimport { PostgresDataSource } from '../postgres';\n\nexport default class ContentItem extends PostgresDataSource {\n  initialize(...args) {\n    super.initialize(...args);\n    this.model = this.sequelize.models.content_item;\n  }\n}\n```\n\n## Usage\n\nYou can use the postgres datasource like you would any other Datasource. In order for your schema to updated to match the config you have created in your models, you'll need to sync. The easiest way to do that is import `sync` from `@apollosproject/data-connector-postgres` and call it on app boot.\n","engines":{"node":">=14"},"gitHead":"a47ced4d09c147f24c98807d2ea58fba577663fc","scripts":{"lint":"eslint ./src --ext .js","test":"TZ=UTC jest","build":"NODE_ENV=production rm -rf ./lib && mkdir -p lib && babel ./src -d ./lib -s"},"_npmUser":{"name":"redreceipt","email":"micneeley14@gmail.com"},"repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","directories":{},"_nodeVersion":"16.13.1","dependencies":{"pg":"^8.5.1","umzug":"^3.0.0-beta.15","hypher":"^0.2.5","lodash":"^4.17.11","pg-hstore":"^2.3.3","sequelize":"^6.3.5","hyphenation.en-us":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","sequelize-mock":"^0.10.2","@apollosproject/babel-preset-apollos":"^2.47.9"},"peerDependencies":{"@apollosproject/config":"*","@apollosproject/data-schema":"*","@apollosproject/server-core":"*"},"_npmOperationalInternal":{"tmp":"tmp/data-connector-postgres_2.47.9_1663854925301_0.3766708340412399","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-01-07T16:22:19.083Z","modified":"2026-01-30T18:39:09.212Z","2.0.0-alpha.15":"2021-01-07T16:22:19.378Z","2.0.0-alpha.1":"2021-01-20T17:06:11.193Z","2.0.0-beta.1":"2021-01-22T21:26:04.302Z","2.0.0-beta.2":"2021-01-27T18:57:52.960Z","2.0.0-2.0.0-alpha.16.0":"2021-01-27T20:37:12.757Z","1.8.0-alpha.8":"2021-02-03T14:42:29.201Z","2.0.0-beta.3":"2021-02-03T14:47:44.662Z","2.0.0-beta.4":"2021-02-03T16:12:34.354Z","1.8.0-alpha.11":"2021-02-03T16:30:17.661Z","2.0.0":"2021-02-03T20:25:18.831Z","2.0.1-alpha.0":"2021-02-03T21:08:08.557Z","2.0.1-canary.6":"2021-02-08T19:37:24.932Z","2.0.1-canary.7":"2021-02-09T15:48:52.829Z","2.0.1-canary.8":"2021-02-09T19:50:03.648Z","2.0.1-canary.12":"2021-02-11T13:19:51.303Z","2.0.1-canary.13":"2021-02-11T14:57:53.156Z","2.0.1-canary.15":"2021-02-11T21:15:09.084Z","2.0.1-canary.0":"2021-02-12T17:41:00.083Z","2.0.1-canary.2":"2021-02-15T15:20:53.309Z","3.0.0-canary.2":"2021-02-15T17:16:37.852Z","2.0.1-canary.14":"2021-02-23T14:35:22.693Z","2.0.1-canary.16":"2021-02-23T17:07:32.057Z","2.0.1-canary.17":"2021-02-23T20:03:14.247Z","2.0.1-canary.20":"2021-02-24T21:26:52.359Z","2.1.0":"2021-02-26T17:22:44.014Z","2.1.1":"2021-02-26T17:26:47.050Z","2.1.2-canary.6":"2021-03-03T16:58:36.019Z","2.2.0":"2021-03-04T18:28:47.130Z","2.2.1-canary.3":"2021-03-08T13:25:51.508Z","2.2.1-canary.4":"2021-03-08T13:49:48.452Z","2.2.1-canary.5":"2021-03-09T14:13:43.607Z","2.2.1-canary.7":"2021-03-10T19:43:36.769Z","2.2.1-canary.8":"2021-03-10T20:32:42.628Z","2.2.1-canary.9":"2021-03-10T21:36:49.522Z","2.2.1-canary.10":"2021-03-11T15:32:13.128Z","2.2.1-canary.12":"2021-03-11T18:14:42.103Z","2.3.0":"2021-03-11T19:13:01.886Z","2.3.1-canary.0":"2021-03-11T19:55:28.660Z","2.3.1":"2021-03-11T20:27:03.302Z","2.3.2-canary.0":"2021-03-11T21:13:12.166Z","2.3.2-canary.2":"2021-03-15T15:22:28.464Z","2.3.2-canary.3":"2021-03-15T18:16:59.285Z","2.3.2-canary.4":"2021-03-16T15:08:35.944Z","2.3.2-canary.5":"2021-03-16T18:05:51.052Z","2.3.2-canary.7":"2021-03-17T00:29:55.293Z","2.3.2-canary.8":"2021-03-17T14:33:19.519Z","2.4.0":"2021-03-18T00:23:46.996Z","2.4.1-canary.1":"2021-03-18T15:49:50.566Z","2.4.1-canary.2":"2021-03-18T19:38:01.366Z","2.4.1-canary.3":"2021-03-18T20:45:14.960Z","2.4.1-canary.4":"2021-03-21T01:57:11.192Z","2.4.1-canary.5":"2021-03-22T15:53:48.933Z","2.4.1-canary.7":"2021-03-22T17:58:55.093Z","2.5.0":"2021-03-22T18:59:51.793Z","2.5.1-canary.1":"2021-03-23T14:59:33.357Z","2.5.1-canary.4":"2021-03-23T20:42:22.675Z","2.6.0":"2021-03-24T20:00:09.840Z","2.6.1-canary.6":"2021-03-25T17:13:34.470Z","2.7.0":"2021-03-25T17:37:32.286Z","2.7.1-canary.0":"2021-03-25T17:39:19.060Z","2.7.1-canary.2":"2021-03-26T19:31:43.212Z","2.8.0":"2021-03-29T12:27:54.080Z","2.8.1-canary.0":"2021-03-29T12:29:46.381Z","2.8.1-canary.6":"2021-03-29T20:14:37.443Z","2.9.0":"2021-03-30T12:15:55.818Z","2.9.1-canary.0":"2021-03-30T12:17:43.092Z","2.9.1-canary.1":"2021-03-30T15:48:37.697Z","2.9.1-canary.7":"2021-03-31T20:50:49.653Z","2.9.1-canary.8":"2021-04-05T14:21:50.032Z","2.9.1-canary.10":"2021-04-05T18:53:47.016Z","2.10.0":"2021-04-06T14:44:48.564Z","2.10.1-canary.1":"2021-04-06T15:57:20.326Z","2.11.0":"2021-04-12T17:34:48.512Z","2.11.1-canary.6":"2021-04-14T15:46:04.984Z","2.11.1-canary.8":"2021-04-14T16:46:33.773Z","2.12.0":"2021-04-22T18:56:43.130Z","2.12.1-canary.2":"2021-04-23T01:07:24.211Z","2.13.0":"2021-04-23T13:44:06.006Z","2.13.1":"2021-04-28T13:56:47.390Z","2.13.2-canary.23":"2021-05-14T12:21:13.221Z","2.14.0":"2021-05-14T15:38:33.873Z","2.14.1-canary.4":"2021-05-18T18:09:00.392Z","2.14.1-canary.7":"2021-05-19T13:42:45.376Z","2.15.0":"2021-05-19T14:06:21.865Z","2.15.1-canary.2":"2021-05-19T18:03:44.858Z","2.15.1-canary.4":"2021-05-19T19:08:11.444Z","2.16.0":"2021-05-20T14:13:06.560Z","2.16.1-canary.4":"2021-05-21T19:42:13.508Z","2.17.0":"2021-05-24T18:42:22.963Z","2.18.0":"2021-05-27T18:23:40.305Z","2.18.1":"2021-06-01T17:57:29.090Z","2.18.2-canary.1":"2021-06-03T15:11:23.937Z","2.18.2-canary.4":"2021-06-04T19:43:35.868Z","2.18.2-canary.5":"2021-06-07T12:47:23.248Z","2.19.0":"2021-06-07T13:52:01.572Z","2.19.1-canary.7":"2021-06-11T14:51:29.171Z","2.20.0":"2021-06-14T12:45:01.437Z","2.21.0":"2021-06-16T20:52:06.151Z","2.21.1":"2021-06-17T15:47:16.244Z","2.21.2":"2021-06-18T17:53:44.657Z","2.21.3-canary.1":"2021-06-23T17:28:05.890Z","2.21.3-canary.2":"2021-06-23T17:54:24.240Z","2.22.0":"2021-06-23T18:29:14.965Z","2.22.1-canary.2":"2021-06-23T19:04:17.839Z","2.22.1-canary.4":"2021-06-24T17:20:57.469Z","2.23.0":"2021-06-24T18:04:18.708Z","2.23.1":"2021-06-24T18:54:14.718Z","2.23.2-canary.3":"2021-06-25T19:05:42.796Z","2.24.0":"2021-06-28T14:21:43.973Z","2.24.1-canary.1":"2021-06-28T18:31:08.933Z","2.24.1-canary.2":"2021-06-29T11:46:24.197Z","2.24.1-canary.7":"2021-06-30T14:26:27.848Z","2.24.1-canary.8":"2021-06-30T15:20:16.475Z","2.25.0":"2021-06-30T16:26:07.511Z","2.25.1-canary.1":"2021-06-30T18:52:54.945Z","2.25.1-canary.8":"2021-07-02T19:37:44.456Z","2.25.1-canary.10":"2021-07-06T14:26:51.744Z","2.25.1-canary.11":"2021-07-07T02:10:33.352Z","2.25.1-canary.12":"2021-07-07T12:21:10.337Z","2.25.1-canary.13":"2021-07-07T13:42:41.483Z","2.25.1-canary.15":"2021-07-09T14:22:04.735Z","2.25.1-canary.16":"2021-07-09T15:44:53.977Z","2.25.1-canary.17":"2021-07-09T16:07:32.347Z","2.26.0":"2021-07-09T18:14:08.267Z","2.26.1-canary.6":"2021-07-19T17:10:39.007Z","2.27.0":"2021-07-19T17:12:06.489Z","2.27.1-canary.1":"2021-07-19T19:15:13.160Z","2.27.1-canary.2":"2021-07-20T11:50:16.375Z","2.27.1-canary.3":"2021-07-20T13:05:23.718Z","2.27.1":"2021-07-20T13:23:12.207Z","2.27.2-canary.1":"2021-07-20T14:12:07.122Z","2.27.2-canary.2":"2021-07-20T14:46:21.758Z","2.27.2":"2021-07-20T19:41:49.830Z","2.27.3-canary.3":"2021-07-22T01:29:37.745Z","2.27.3-canary.4":"2021-07-22T19:06:20.920Z","2.27.3-canary.7":"2021-07-27T21:19:00.526Z","2.27.3-canary.9":"2021-08-02T17:37:19.440Z","2.28.0":"2021-08-04T14:52:32.570Z","2.28.1-canary.0":"2021-08-04T14:54:15.671Z","2.28.1-canary.3":"2021-08-05T18:08:33.253Z","2.29.0":"2021-08-05T18:32:26.366Z","2.29.1-canary.0":"2021-08-05T18:34:12.002Z","2.29.1":"2021-08-06T14:17:34.305Z","2.29.2-canary.0":"2021-08-06T14:19:21.724Z","2.29.2":"2021-08-06T15:38:37.913Z","2.29.3-canary.0":"2021-08-06T15:40:18.474Z","2.29.3-canary.7":"2021-08-10T19:57:56.634Z","2.29.3":"2021-08-11T14:52:11.717Z","2.29.4-canary.0":"2021-08-11T14:54:07.475Z","2.29.4-canary.1":"2021-08-11T19:42:45.956Z","2.29.4-canary.2":"2021-08-12T16:57:01.176Z","2.29.4-canary.3":"2021-08-12T22:40:42.834Z","2.29.4-canary.6":"2021-08-13T15:20:46.322Z","2.29.4-canary.7":"2021-08-13T16:31:17.696Z","2.29.4-canary.9":"2021-08-13T17:11:00.163Z","2.29.4-canary.10":"2021-08-13T18:21:28.729Z","2.29.4-canary.11":"2021-08-13T19:01:17.101Z","2.29.4-canary.12":"2021-08-13T19:28:56.983Z","2.29.4-canary.13":"2021-08-16T13:14:14.642Z","2.29.4-canary.17":"2021-08-17T02:55:29.535Z","2.30.0":"2021-08-17T14:10:11.301Z","2.30.1-canary.0":"2021-08-17T20:05:44.534Z","2.30.1-canary.1":"2021-08-18T00:55:21.651Z","2.30.1-canary.3":"2021-08-18T14:50:43.047Z","2.30.1-canary.12":"2021-08-25T15:56:41.304Z","2.30.1-canary.13":"2021-08-25T16:59:40.568Z","2.31.0":"2021-08-26T20:08:56.186Z","2.31.1-canary.2":"2021-08-30T18:18:47.108Z","2.31.1-canary.5":"2021-08-31T18:12:42.424Z","2.31.1-canary.6":"2021-08-31T20:02:08.893Z","2.31.1-canary.7":"2021-09-02T15:35:47.760Z","2.31.1-canary.9":"2021-09-03T19:13:28.955Z","2.32.0":"2021-09-03T19:28:16.277Z","2.32.1":"2021-09-07T15:49:36.404Z","2.32.2-canary.0":"2021-09-08T14:06:13.877Z","2.32.2":"2021-09-09T17:42:49.502Z","2.32.3-canary.1":"2021-09-11T02:38:06.491Z","2.32.3-canary.2":"2021-09-13T19:02:01.787Z","2.32.3-canary.3":"2021-09-14T14:42:40.529Z","2.32.3-canary.4":"2021-09-15T12:54:14.024Z","2.33.0":"2021-09-15T15:32:23.326Z","2.33.1":"2021-09-15T21:25:41.755Z","2.33.2-canary.0":"2021-09-16T19:26:43.412Z","2.33.2":"2021-09-17T17:42:53.858Z","2.33.3-canary.0":"2021-09-17T18:16:57.263Z","2.33.3-canary.1":"2021-09-20T18:48:54.327Z","2.33.3":"2021-09-22T14:31:53.201Z","2.33.4-canary.0":"2021-09-22T17:58:24.386Z","2.33.4-canary.4":"2021-09-23T19:05:55.582Z","2.33.4-canary.7":"2021-09-24T16:47:52.463Z","2.33.4":"2021-09-27T13:38:05.566Z","2.33.5-canary.7":"2021-09-30T19:32:26.916Z","2.34.0":"2021-10-01T18:36:36.390Z","2.34.1-canary.0":"2021-10-04T18:30:57.474Z","2.35.0":"2021-10-12T13:40:57.185Z","2.35.1-canary.6":"2021-10-21T19:10:28.166Z","2.36.0":"2021-10-21T20:32:01.237Z","2.36.1":"2021-10-22T21:02:58.544Z","2.36.2-canary.2":"2021-10-26T15:17:30.378Z","2.36.2-canary.4":"2021-10-27T15:53:18.792Z","2.36.2":"2021-10-28T00:49:18.626Z","2.36.3-canary.0":"2021-10-29T13:35:21.360Z","2.36.3":"2021-10-29T13:36:35.543Z","2.36.4-canary.0":"2021-11-05T21:56:41.278Z","2.36.4-canary.2":"2021-11-09T16:26:36.915Z","2.37.0":"2021-11-12T17:20:42.013Z","2.37.1-canary.1":"2021-11-15T14:03:39.766Z","2.38.0":"2021-11-15T16:53:01.377Z","2.38.1-canary.4":"2021-11-16T21:09:56.824Z","2.38.1-canary.5":"2021-11-17T01:45:04.788Z","2.38.1-canary.8":"2021-11-22T18:02:49.304Z","2.39.0":"2021-11-22T19:41:47.862Z","2.39.1-canary.1":"2021-11-29T21:38:31.107Z","2.39.1-canary.3":"2021-11-30T13:49:21.950Z","2.39.1-canary.5":"2021-11-30T19:58:44.507Z","2.39.1-canary.6":"2021-11-30T20:26:49.144Z","2.39.1-canary.7":"2021-11-30T20:45:13.771Z","2.39.1-canary.9":"2021-12-03T19:40:02.456Z","2.39.1-canary.10":"2021-12-03T19:57:19.296Z","2.39.1-canary.17":"2021-12-06T18:41:37.110Z","2.40.0":"2021-12-07T01:55:59.455Z","2.40.1-canary.3":"2021-12-08T19:41:46.212Z","2.41.0":"2021-12-10T17:03:44.543Z","2.41.1-canary.3":"2021-12-20T16:34:36.090Z","2.41.1-canary.5":"2021-12-22T19:16:42.249Z","2.41.1-canary.8":"2022-01-03T18:32:43.981Z","2.41.1-canary.9":"2022-01-03T20:05:54.639Z","2.41.1-canary.10":"2022-01-03T21:27:11.045Z","2.41.1-canary.11":"2022-01-03T22:01:17.919Z","2.41.1-canary.14":"2022-01-06T17:25:44.106Z","2.41.1-canary.18":"2022-01-11T15:56:07.921Z","2.42.0":"2022-01-11T16:32:42.795Z","2.42.1-canary.0":"2022-01-12T17:07:52.748Z","3.0.0-canary.3":"2022-01-12T21:05:11.583Z","3.0.0-canary.4":"2022-01-13T16:33:53.766Z","3.0.0-canary.5":"2022-01-13T19:54:55.041Z","3.0.0-canary.6":"2022-01-13T21:13:02.751Z","3.0.0-canary.7":"2022-01-14T01:35:09.929Z","3.0.0-canary.8":"2022-01-14T14:19:34.318Z","2.42.1-canary.1":"2022-01-14T15:44:19.279Z","3.0.0-canary.10":"2022-01-18T13:24:05.392Z","3.0.0-canary.11":"2022-01-20T15:07:01.662Z","3.0.0-canary.12":"2022-01-21T15:55:01.025Z","3.0.0-canary.13":"2022-01-21T20:08:47.264Z","3.0.0-canary.15":"2022-01-21T21:35:44.665Z","3.0.0-canary.16":"2022-01-21T22:19:53.123Z","2.42.1-canary.9":"2022-01-24T14:39:44.560Z","3.0.0-canary.20":"2022-01-25T15:30:08.511Z","3.0.0-canary.21":"2022-01-25T15:48:21.154Z","3.0.0-canary.22":"2022-01-25T16:42:02.671Z","3.0.0-canary.25":"2022-01-27T16:04:29.469Z","2.42.1-canary.18":"2022-01-27T19:48:24.382Z","2.42.1-canary.19":"2022-01-27T20:34:07.430Z","3.0.0-canary.27":"2022-01-27T20:35:55.241Z","3.0.0-canary.28":"2022-01-27T23:04:17.321Z","2.43.0":"2022-01-27T23:06:29.582Z","2.43.1-canary.5":"2022-01-31T23:27:08.798Z","3.0.0-canary.32":"2022-02-01T13:57:49.695Z","3.0.0-canary.33":"2022-02-01T15:28:59.834Z","3.0.0-canary.34":"2022-02-01T19:57:20.670Z","2.43.1":"2022-02-01T22:43:34.540Z","3.0.0-canary.35":"2022-02-02T14:09:40.368Z","3.0.0-canary.36":"2022-02-02T15:16:12.221Z","3.0.0-canary.40":"2022-02-03T15:15:38.634Z","3.0.0-canary.41":"2022-02-03T16:44:08.370Z","2.43.2-canary.6":"2022-02-03T18:18:48.558Z","3.0.0-canary.43":"2022-02-03T21:02:16.913Z","3.0.0-canary.47":"2022-02-07T14:35:49.937Z","3.0.0-canary.48":"2022-02-08T20:59:05.989Z","3.0.0-canary.50":"2022-02-16T13:42:48.888Z","3.0.0-canary.51":"2022-02-16T14:07:32.013Z","3.0.0-canary.52":"2022-02-17T17:37:53.627Z","3.0.0-canary.53":"2022-02-21T17:50:15.039Z","3.0.0-canary.54":"2022-02-21T18:30:24.600Z","3.0.0-canary.55":"2022-02-22T14:11:33.836Z","3.0.0-canary.58":"2022-02-23T20:22:06.123Z","3.0.0-canary.59":"2022-02-25T14:54:40.399Z","2.44.0":"2022-03-03T17:35:29.476Z","2.44.1":"2022-03-03T22:03:46.595Z","2.44.2":"2022-03-04T16:46:16.917Z","2.44.3":"2022-03-14T14:35:51.278Z","2.44.4":"2022-03-15T23:10:40.984Z","2.45.0":"2022-03-22T19:52:58.214Z","2.45.1":"2022-03-29T13:32:32.164Z","2.46.0":"2022-03-29T18:29:23.194Z","2.46.1":"2022-03-30T15:10:47.110Z","2.46.2":"2022-03-30T19:37:04.234Z","2.46.3":"2022-03-30T19:40:06.185Z","2.46.4":"2022-03-30T19:43:46.542Z","2.46.5":"2022-03-30T19:46:53.124Z","2.46.6":"2022-03-30T19:50:24.746Z","2.46.7":"2022-03-30T19:53:09.145Z","2.46.8":"2022-03-30T19:55:48.341Z","2.46.9":"2022-03-30T19:58:42.100Z","2.46.10":"2022-03-30T20:01:35.686Z","2.46.11":"2022-03-30T20:04:09.690Z","2.46.12":"2022-03-30T20:07:10.962Z","2.46.13":"2022-03-30T20:10:30.316Z","2.46.14":"2022-03-30T20:13:29.776Z","2.46.15":"2022-03-30T20:16:32.447Z","2.46.16":"2022-03-30T20:19:26.714Z","2.46.17":"2022-03-30T20:23:16.089Z","2.46.18":"2022-03-30T20:26:01.428Z","2.46.19":"2022-03-30T20:28:54.183Z","2.46.20":"2022-03-30T20:32:22.924Z","2.46.21":"2022-03-30T20:36:31.550Z","2.46.22":"2022-03-30T20:39:22.724Z","2.46.23":"2022-03-30T20:43:02.884Z","2.46.24":"2022-03-30T20:45:42.796Z","2.46.25":"2022-03-30T20:48:48.875Z","2.46.26":"2022-03-30T20:52:04.978Z","2.46.27":"2022-03-30T20:54:55.545Z","2.46.28":"2022-03-30T20:58:50.945Z","2.46.29":"2022-03-30T21:01:30.594Z","2.46.30":"2022-03-30T21:04:59.039Z","2.46.31":"2022-03-30T21:08:15.033Z","2.46.32":"2022-03-30T21:10:54.918Z","2.46.33":"2022-03-30T21:14:01.356Z","2.46.34":"2022-03-30T21:17:41.644Z","2.46.35":"2022-03-30T21:20:47.315Z","2.46.36":"2022-03-30T21:23:40.115Z","2.46.37":"2022-03-30T21:27:25.003Z","2.46.38":"2022-03-30T21:30:00.362Z","2.46.39":"2022-03-30T21:34:01.565Z","2.46.40":"2022-03-30T21:37:54.920Z","2.46.41":"2022-03-30T21:40:50.912Z","2.46.42":"2022-03-30T21:43:58.046Z","2.46.43":"2022-03-30T21:47:09.165Z","2.46.44":"2022-03-30T21:51:35.457Z","2.46.45":"2022-03-30T21:55:23.504Z","2.46.46":"2022-03-30T21:57:59.562Z","2.46.47":"2022-03-30T22:01:48.877Z","2.46.48":"2022-03-30T22:04:14.319Z","2.46.49":"2022-03-30T22:07:58.156Z","2.46.50":"2022-03-30T22:11:29.696Z","2.46.51":"2022-03-30T22:14:02.655Z","2.46.52":"2022-03-30T22:17:35.275Z","2.46.53":"2022-03-30T22:20:17.448Z","2.46.54":"2022-03-30T22:23:56.802Z","2.46.55":"2022-03-30T22:27:23.008Z","2.46.56":"2022-03-30T22:30:32.948Z","2.46.57":"2022-03-30T22:33:57.943Z","2.46.58":"2022-03-30T22:36:30.854Z","2.46.59":"2022-03-30T22:40:22.407Z","2.46.60":"2022-03-30T22:43:23.840Z","2.46.61":"2022-03-30T22:46:18.252Z","2.46.62":"2022-03-30T22:48:53.966Z","2.46.63":"2022-03-30T22:51:34.990Z","2.46.64":"2022-03-30T22:54:27.631Z","2.46.65":"2022-03-30T22:57:02.160Z","2.46.66":"2022-03-30T22:59:41.213Z","2.46.67":"2022-03-30T23:02:56.397Z","2.46.68":"2022-03-30T23:06:18.874Z","2.46.69":"2022-03-30T23:10:29.779Z","2.46.70":"2022-03-30T23:14:01.112Z","2.46.71":"2022-03-30T23:16:47.585Z","2.46.72":"2022-03-30T23:19:59.575Z","2.46.73":"2022-03-30T23:23:46.086Z","2.46.74":"2022-03-30T23:27:11.950Z","2.46.75":"2022-03-30T23:29:59.313Z","2.46.76":"2022-03-30T23:33:54.510Z","2.46.77":"2022-03-30T23:37:03.149Z","2.46.78":"2022-03-30T23:39:41.060Z","2.46.79":"2022-03-30T23:42:41.757Z","2.46.80":"2022-03-30T23:46:37.138Z","2.46.81":"2022-03-30T23:50:24.477Z","2.46.82":"2022-03-30T23:53:59.176Z","2.46.83":"2022-03-30T23:57:08.006Z","2.46.84":"2022-03-30T23:59:42.340Z","2.46.85":"2022-03-31T00:03:30.136Z","2.46.86":"2022-03-31T00:06:03.495Z","2.46.87":"2022-03-31T00:10:17.873Z","2.46.88":"2022-03-31T00:14:01.441Z","2.46.89":"2022-03-31T00:17:30.118Z","2.46.90":"2022-03-31T00:21:36.829Z","2.46.91":"2022-03-31T00:25:28.862Z","2.46.92":"2022-03-31T00:29:14.746Z","2.46.93":"2022-03-31T00:32:09.875Z","2.46.94":"2022-03-31T00:35:54.361Z","2.46.95":"2022-03-31T00:39:40.266Z","2.46.96":"2022-03-31T00:42:38.414Z","2.46.97":"2022-03-31T00:46:38.933Z","2.46.98":"2022-03-31T00:49:47.355Z","2.46.99":"2022-03-31T00:52:58.678Z","2.46.100":"2022-03-31T00:55:46.656Z","2.46.101":"2022-03-31T00:59:14.453Z","2.46.102":"2022-03-31T01:02:55.373Z","2.46.103":"2022-03-31T01:05:54.612Z","2.46.104":"2022-03-31T01:09:31.214Z","2.46.105":"2022-03-31T01:12:55.356Z","2.46.106":"2022-03-31T01:16:30.030Z","2.46.107":"2022-03-31T01:19:37.876Z","2.46.108":"2022-03-31T01:22:47.226Z","2.46.109":"2022-03-31T01:26:06.559Z","2.46.110":"2022-03-31T01:29:19.420Z","2.46.111":"2022-03-31T01:32:14.672Z","2.46.112":"2022-03-31T01:36:02.688Z","2.46.113":"2022-03-31T01:39:23.152Z","2.46.114":"2022-03-31T01:41:59.884Z","2.46.115":"2022-03-31T01:45:46.742Z","2.46.116":"2022-03-31T01:49:13.478Z","2.46.117":"2022-03-31T01:53:00.220Z","2.46.118":"2022-03-31T01:56:30.393Z","2.46.119":"2022-03-31T01:59:31.017Z","2.46.120":"2022-03-31T02:02:07.495Z","2.46.121":"2022-03-31T02:04:58.688Z","2.46.122":"2022-03-31T02:07:43.341Z","2.46.123":"2022-03-31T02:10:25.268Z","2.46.124":"2022-03-31T02:13:09.944Z","2.46.125":"2022-03-31T02:17:04.747Z","2.46.126":"2022-03-31T02:20:13.740Z","2.46.127":"2022-03-31T02:23:36.520Z","2.46.128":"2022-03-31T02:26:48.973Z","2.46.129":"2022-03-31T02:30:39.533Z","2.46.130":"2022-03-31T02:33:51.796Z","2.46.131":"2022-03-31T02:36:29.422Z","2.46.132":"2022-03-31T02:39:53.228Z","2.46.133":"2022-03-31T02:42:29.391Z","2.46.134":"2022-03-31T02:46:53.984Z","2.46.135":"2022-03-31T02:49:09.925Z","2.46.136":"2022-03-31T02:52:37.838Z","2.46.137":"2022-03-31T02:55:35.465Z","2.46.138":"2022-03-31T02:58:13.681Z","2.46.139":"2022-03-31T03:00:51.735Z","2.46.140":"2022-03-31T03:04:19.320Z","2.46.141":"2022-03-31T03:06:48.290Z","2.46.142":"2022-03-31T03:10:45.485Z","2.46.143":"2022-03-31T03:13:59.969Z","2.46.144":"2022-03-31T03:16:36.098Z","2.46.145":"2022-03-31T03:20:24.283Z","2.46.146":"2022-03-31T03:23:52.048Z","2.46.147":"2022-03-31T03:27:24.658Z","2.46.148":"2022-03-31T03:30:20.616Z","2.46.149":"2022-03-31T03:33:31.014Z","2.46.150":"2022-03-31T03:36:32.406Z","2.46.151":"2022-03-31T03:40:26.827Z","2.46.152":"2022-03-31T03:44:03.186Z","2.46.153":"2022-03-31T03:46:42.618Z","2.46.154":"2022-03-31T03:49:25.418Z","2.46.155":"2022-03-31T03:52:10.920Z","2.46.156":"2022-03-31T03:55:11.744Z","2.46.157":"2022-03-31T03:59:11.689Z","2.46.158":"2022-03-31T04:02:40.099Z","2.46.159":"2022-03-31T04:05:19.624Z","2.46.160":"2022-03-31T04:09:15.798Z","2.46.161":"2022-03-31T04:11:52.059Z","2.46.162":"2022-03-31T04:14:31.695Z","2.46.163":"2022-03-31T04:17:44.807Z","2.46.164":"2022-03-31T04:21:06.257Z","2.46.165":"2022-03-31T04:23:41.218Z","2.46.166":"2022-03-31T04:26:29.544Z","2.46.167":"2022-03-31T04:29:11.575Z","2.46.168":"2022-03-31T04:32:38.353Z","2.46.169":"2022-03-31T04:35:14.434Z","2.46.170":"2022-03-31T04:38:14.064Z","2.46.171":"2022-03-31T04:41:00.493Z","2.46.172":"2022-03-31T04:45:09.438Z","2.46.173":"2022-03-31T04:48:09.277Z","2.46.174":"2022-03-31T04:51:36.197Z","2.46.175":"2022-03-31T04:54:43.057Z","2.46.176":"2022-03-31T04:57:43.244Z","2.46.177":"2022-03-31T05:00:36.112Z","2.46.178":"2022-03-31T05:03:40.394Z","2.46.179":"2022-03-31T05:07:23.473Z","2.46.180":"2022-03-31T05:11:18.396Z","2.46.181":"2022-03-31T05:14:16.756Z","2.46.182":"2022-03-31T05:17:26.538Z","2.46.183":"2022-03-31T05:19:50.807Z","2.46.184":"2022-03-31T05:22:26.234Z","2.46.185":"2022-03-31T05:25:04.946Z","2.46.186":"2022-03-31T05:27:48.729Z","2.46.187":"2022-03-31T05:31:31.924Z","2.46.188":"2022-03-31T05:34:01.505Z","2.46.189":"2022-03-31T05:36:57.920Z","2.46.190":"2022-03-31T05:39:48.532Z","2.46.191":"2022-03-31T05:42:23.290Z","2.46.192":"2022-03-31T05:45:06.883Z","2.46.193":"2022-03-31T05:49:05.799Z","2.46.194":"2022-03-31T05:52:47.873Z","2.46.195":"2022-03-31T05:55:36.274Z","2.46.196":"2022-03-31T05:58:43.319Z","2.46.197":"2022-03-31T06:01:44.919Z","2.46.198":"2022-03-31T06:05:51.496Z","2.47.0":"2022-04-04T20:41:57.921Z","2.47.1":"2022-04-05T20:24:53.833Z","2.47.2":"2022-04-11T15:39:59.058Z","2.47.3":"2022-05-11T18:28:16.583Z","2.47.4":"2022-06-09T01:22:09.001Z","2.47.5":"2022-06-10T17:26:24.915Z","2.47.6":"2022-07-07T13:53:40.873Z","2.47.7":"2022-07-26T14:35:16.504Z","2.47.9":"2022-09-22T13:55:25.513Z"},"bugs":{"url":"https://github.com/apollosproject/apollos-apps/issues"},"homepage":"https://github.com/apollosproject/apollos-apps#readme","repository":{"url":"git://github.com/apollosproject/apollos-apps.git","type":"git"},"description":"Provides a data-connector to manage and read/write data stored in postgres (or potentially other SQL databases)","maintainers":[{"email":"vince@classyh.at","name":"yungvincenzo"},{"email":"hi@convan.me","name":"conrad_vanl"},{"email":"micneeley14@gmail.com","name":"redreceipt"},{"email":"npm@differential.com","name":"didevshop"},{"email":"nick@differential.com","name":"nick-di"},{"email":"apps@apollos.app","name":"apollosadmin"},{"email":"nathan@differential.com","name":"nathanlewis.differential"}],"readme":"","readmeFilename":""}