{
"info": {
"author": "TransferWise",
"author_email": "",
"bugtrack_url": null,
"classifiers": [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only"
],
"description": "# pipelinewise-target-postgres\n\n[](https://badge.fury.io/py/pipelinewise-target-postgres)\n[](https://pypi.org/project/pipelinewise-target-postgres/)\n[](https://opensource.org/licenses/Apache-2.0)\n\n[Singer](https://www.singer.io/) target that loads data into Snowflake following the [Singer spec](https://github.com/singer-io/getting-started/blob/master/docs/SPEC.md).\n\nThis is a [PipelineWise](https://transferwise.github.io/pipelinewise) compatible target connector.\n\n## How to use it\n\nThe recommended method of running this target is to use it from [PipelineWise](https://transferwise.github.io/pipelinewise). When running it from PipelineWise you don't need to configure this tap with JSON files and most of things are automated. Please check the related documentation at [Target Postgres](https://transferwise.github.io/pipelinewise/connectors/targets/postgres.html)\n\nIf you want to run this [Singer Target](https://singer.io) independently please read further.\n\n### Install\n\nFirst, make sure Python 3 is installed on your system or follow these\ninstallation instructions for [Mac](http://docs.python-guide.org/en/latest/starting/install3/osx/) or\n[Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-ubuntu-16-04).\n\nIt's recommended to use a virtualenv:\n\n```bash\n python3 -m venv venv\n pip install pipelinewise-target-postgres\n```\n\nor\n\n```bash\n python3 -m venv venv\n . venv/bin/activate\n pip install --upgrade pip\n pip install .\n```\n\n### To run\n\nLike any other target that's following the singer specificiation:\n\n`some-singer-tap | target-postgres --config [config.json]`\n\nIt's reading incoming messages from STDIN and using the properites in `config.json` to upload data into Postgres.\n\n**Note**: To avoid version conflicts run `tap` and `targets` in separate virtual environments.\n\n### Configuration settings\n\nRunning the the target connector requires a `config.json` file. An example with the minimal settings:\n\n ```json\n {\n \"host\": \"localhost\",\n \"port\": 5432,\n \"user\": \"my_user\",\n \"password\": \"secret\",\n \"dbname\": \"my_db_name\",\n \"default_target_schema\": \"my_target_schema\"\n }\n ```\n\nFull list of options in `config.json`:\n\n| Property | Type | Required? | Description |\n|-------------------------------------|---------|------------|---------------------------------------------------------------|\n| host | String | Yes | PostgreSQL host |\n| port | Integer | Yes | PostgreSQL port |\n| user | String | Yes | PostgreSQL user |\n| password | String | Yes | PostgreSQL password |\n| dbname | String | Yes | PostgreSQL database name |\n| batch_size | Integer | | (Default: 100000) Maximum number of rows in each batch. At the end of each batch, the rows in the batch are loaded into Snowflake. |\n| default_target_schema | String | | Name of the schema where the tables will be created. If `schema_mapping` is not defined then every stream sent by the tap is loaded into this schema. |\n| default_target_schema_select_permission | String | | Grant USAGE privilege on newly created schemas and grant SELECT privilege on newly created \n| schema_mapping | Object | | Useful if you want to load multiple streams from one tap to multiple Snowflake schemas.
If the tap sends the `stream_id` in `-` format then this option overwrites the `default_target_schema` value. Note, that using `schema_mapping` you can overwrite the `default_target_schema_select_permission` value to grant SELECT permissions to different groups per schemas or optionally you can create indices automatically for the replicated tables.
**Note**: This is an experimental feature and recommended to use via PipelineWise YAML files that will generate the object mapping in the right JSON format. For further info check a [PipelineWise YAML Example](https://transferwise.github.io/pipelinewise/connectors/taps/mysql.html#configuring-what-to-replicate). |\n| add_metadata_columns | Boolean | | (Default: False) Metadata columns add extra row level information about data ingestions, (i.e. when was the row read in source, when was inserted or deleted in postgres etc.) Metadata columns are creating automatically by adding extra columns to the tables with a column prefix `_SDC_`. The column names are following the stitch naming conventions documented at https://www.stitchdata.com/docs/data-structure/integration-schemas#sdc-columns. Enabling metadata columns will flag the deleted rows by setting the `_SDC_DELETED_AT` metadata column. Without the `add_metadata_columns` option the deleted rows from singer taps will not be recongisable in Snowflake. |\n| hard_delete | Boolean | | (Default: False) When `hard_delete` option is true then DELETE SQL commands will be performed in Snowflake to delete rows in tables. It's achieved by continuously checking the `_SDC_DELETED_AT` metadata column sent by the singer tap. Due to deleting rows requires metadata columns, `hard_delete` option automatically enables the `add_metadata_columns` option as well. |\n\n\n### To run tests:\n\n1. Define environment variables that requires running the tests\n```\n export TARGET_POSTGRES_HOST=\n export TARGET_POSTGRES_PORT=\n export TARGET_POSTGRES_USER=\n export TARGET_POSTGRES_PASSWORD=\n export TARGET_POSTGRES_DBNAME=\n export TARGET_POSTGRES_SCHEMA=\n```\n\n2. Install python dependencies in a virtual env and run nose unit and integration tests\n```\n python3 -m venv venv\n . venv/bin/activate\n pip install --upgrade pip\n pip install .\n pip install nose\n```\n\n3. To run unit tests:\n```\n nosetests --where=tests/unit\n```\n\n4. To run integration tests:\n```\n nosetests --where=tests/integration\n```\n\n### To run pylint:\n\n1. Install python dependencies and run python linter\n```\n python3 -m venv venv\n . venv/bin/activate\n pip install --upgrade pip\n pip install .\n pip install pylint\n pylint target_postgres -d C,W,unexpected-keyword-arg,duplicate-code\n```\n\n## License\n\nApache License Version 2.0\n\nSee [LICENSE](LICENSE) to see the full text.",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/transferwise/pipelinewise-target-postgres",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "pipelinewise-target-postgres",
"package_url": "https://pypi.org/project/pipelinewise-target-postgres/",
"platform": "",
"project_url": "https://pypi.org/project/pipelinewise-target-postgres/",
"project_urls": {
"Homepage": "https://github.com/transferwise/pipelinewise-target-postgres"
},
"release_url": "https://pypi.org/project/pipelinewise-target-postgres/1.0.4/",
"requires_dist": null,
"requires_python": "",
"summary": "Singer.io target for loading data to PostgreSQL - PipelineWise compatible",
"version": "1.0.4"
},
"last_serial": 5911877,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "1680bef270a217500ff8d9a59efc351a",
"sha256": "4f1878db85511d1c3a742275a71bb560ec960135e9f4fcb634e67b271b893e28"
},
"downloads": -1,
"filename": "pipelinewise-target-postgres-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "1680bef270a217500ff8d9a59efc351a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11415,
"upload_time": "2019-06-02T23:47:15",
"url": "https://files.pythonhosted.org/packages/a1/bf/f1f3d4190fd6552bbd1ca23400a2f4276a91a87939931cbfd8c963d1135a/pipelinewise-target-postgres-1.0.0.tar.gz"
}
],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "e871f97bc2acae88a6e1976c555b84d0",
"sha256": "00cb6f60be4cefb8a59d1095ee3a4768b56728f0b37603ab1e1c21aca9e2f763"
},
"downloads": -1,
"filename": "pipelinewise-target-postgres-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "e871f97bc2acae88a6e1976c555b84d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11673,
"upload_time": "2019-08-12T11:14:24",
"url": "https://files.pythonhosted.org/packages/72/65/91aaa9835c0fea725b9f9c79030d31392bbe05d9b237f053fbca8bb62b6f/pipelinewise-target-postgres-1.0.1.tar.gz"
}
],
"1.0.2": [
{
"comment_text": "",
"digests": {
"md5": "85d54182bf1a8a2a5c66e3c4f458c58b",
"sha256": "91b36f0d4d0fc6d58a9d2ac9bc09779cb36c7652f5ba1bf6a236c0ea36d8cf73"
},
"downloads": -1,
"filename": "pipelinewise-target-postgres-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "85d54182bf1a8a2a5c66e3c4f458c58b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11750,
"upload_time": "2019-08-16T15:55:59",
"url": "https://files.pythonhosted.org/packages/79/4a/7d7fe0e7b8c46d8fed42c740070ce766c53268bc19f7dd140e3a430289be/pipelinewise-target-postgres-1.0.2.tar.gz"
}
],
"1.0.3": [
{
"comment_text": "",
"digests": {
"md5": "67725f74af840cb9a2c9a22af384e317",
"sha256": "b36179401f85594537f52f50b5fc029d0a8654f3880a30d237dcf414c79eaef5"
},
"downloads": -1,
"filename": "pipelinewise-target-postgres-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "67725f74af840cb9a2c9a22af384e317",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11765,
"upload_time": "2019-09-01T10:29:42",
"url": "https://files.pythonhosted.org/packages/be/6a/e97185437f5d146ba50b9e8315811a87eb1c6ddf04c21de05a82a6dce76e/pipelinewise-target-postgres-1.0.3.tar.gz"
}
],
"1.0.4": [
{
"comment_text": "",
"digests": {
"md5": "3cf00ea20afc88cd536a2c3b8921fffc",
"sha256": "5acfb1bb0deaf68e51651ef16300146f8799aabeb2f398549ab56f61deb9edfc"
},
"downloads": -1,
"filename": "pipelinewise-target-postgres-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "3cf00ea20afc88cd536a2c3b8921fffc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11739,
"upload_time": "2019-10-01T12:10:54",
"url": "https://files.pythonhosted.org/packages/cd/c1/3175ad1fcc946dd92c4dcaea39b55705a4b9ce928d34bc558ff00ca37df8/pipelinewise-target-postgres-1.0.4.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "3cf00ea20afc88cd536a2c3b8921fffc",
"sha256": "5acfb1bb0deaf68e51651ef16300146f8799aabeb2f398549ab56f61deb9edfc"
},
"downloads": -1,
"filename": "pipelinewise-target-postgres-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "3cf00ea20afc88cd536a2c3b8921fffc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11739,
"upload_time": "2019-10-01T12:10:54",
"url": "https://files.pythonhosted.org/packages/cd/c1/3175ad1fcc946dd92c4dcaea39b55705a4b9ce928d34bc558ff00ca37df8/pipelinewise-target-postgres-1.0.4.tar.gz"
}
]
}