{"id":20023446,"url":"https://github.com/niku/embulk-plugin-postgres","last_synced_at":"2025-03-02T04:17:27.219Z","repository":{"id":26945196,"uuid":"30407875","full_name":"niku/embulk-plugin-postgres","owner":"niku","description":"This Embulk plugin for postgresql","archived":false,"fork":false,"pushed_at":"2015-02-06T11:32:32.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T16:41:35.382Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-06T10:48:16.000Z","updated_at":"2015-02-06T11:33:51.000Z","dependencies_parsed_at":"2022-09-02T00:51:07.131Z","dependency_job_id":null,"html_url":"https://github.com/niku/embulk-plugin-postgres","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niku%2Fembulk-plugin-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niku%2Fembulk-plugin-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niku%2Fembulk-plugin-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niku%2Fembulk-plugin-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niku","download_url":"https://codeload.github.com/niku/embulk-plugin-postgres/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241455454,"owners_count":19965611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T08:46:27.895Z","updated_at":"2025-03-02T04:17:27.201Z","avatar_url":"https://github.com/niku.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Embulk output plugin for PostgreSQL\n\nThis [Embulk](https://github.com/embulk/embulk) output plugin writes records to columns of a table.\n\n## Configuration\n\n- **host** host name of the PostgreSQL server (string, required)\n- **port** port of the PostgreSQL server (integer, default: 5432)\n- **username** login user name (string, required)\n- **password** login password (string, default: \"\")\n- **database** destination database name (string, required)\n- **table** destination table name (string, required)\n\n### Example\n\n```yaml\nout:\n  type: postgres\n  host: localhost\n  username: niku\n  database: embulk_test\n  table: load01\n```\n\n## How to execute example\n\n### prepare db and table\n\n```shell\n$ createdb -Eutf8 embulk_test\n$ psql -d embulk_test -c 'CREATE TABLE load01(id integer, account integer, time timestamp, purchase timestamp, comment varchar);'\n```\n\n### prepare embulk\n\n```\n$ curl https://bintray.com/artifact/download/embulk/maven/embulk-0.3.2.jar -L -o embulk.jar\n$ java -jar embulk.jar bundle ./embulk_bundle\n$ echo 'gem \"embulk-plugin-postgres\", github: \"niku/embulk-plugin-postgres\"' \u003e\u003e ./embulk_bundle/Gemfile\n$ java -jar embulk.jar bundle ./embulk_bundle\n$ java -jar embulk.jar -b ./embulk_bundle example ./try1\n$ java -jar embulk.jar -b ./embulk_bundle guess ./try1/example.yml -o config.yml\n```\n\n### rewrite config.yaml\n\n```yaml\nin:\n  type: file\n  paths: [/Users/niku/try1/csv]\n  decoders:\n  - {type: gzip}\n  parser:\n    charset: UTF-8\n    newline: CRLF\n    type: csv\n    delimiter: ','\n    quote: '\"'\n    header_line: true\n    columns:\n    - {name: id, type: long}\n    - {name: account, type: long}\n    - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}\n    - {name: purchase, type: timestamp, format: '%Y%m%d'}\n    - {name: comment, type: string}\nexec: {}\nout:\n  type: postgres\n  host: localhost\n  username: niku\n  database: embulk_test\n  table: load01\n```\n\n### execute embulk\n\n```\n$ java -jar embulk.jar -b ./embulk_bundle run config.yml\n```\n\n### check db\n\n```\n$ psql -d embulk_test -c 'SELECT * FROM load01;'\n id | account |        time         |      purchase       |          comment\n----+---------+---------------------+---------------------+----------------------------\n  1 |   32864 | 2015-01-27 19:23:49 | 2015-01-27 00:00:00 | embulk\n  2 |   14824 | 2015-01-27 19:01:23 | 2015-01-27 00:00:00 | embulk jruby\n  3 |   27559 | 2015-01-28 02:20:02 | 2015-01-28 00:00:00 | embulk core\n  4 |   11270 | 2015-01-29 11:54:36 | 2015-01-29 00:00:00 | Embulk \"csv\" parser plugin\n  (4 rows)\n```\n\nYay!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniku%2Fembulk-plugin-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniku%2Fembulk-plugin-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniku%2Fembulk-plugin-postgres/lists"}