{"id":25492400,"url":"https://github.com/peeeuzin/pgbulk","last_synced_at":"2025-04-10T00:16:17.106Z","repository":{"id":275835737,"uuid":"926586725","full_name":"peeeuzin/pgbulk","owner":"peeeuzin","description":"A library for populate large amounts of data to PostgreSQL database with TypeScript","archived":false,"fork":false,"pushed_at":"2025-03-19T21:35:31.000Z","size":260,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:16:13.223Z","etag":null,"topics":["bulk-insert","nodejs","postgresql","sql","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/peeeuzin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T14:20:15.000Z","updated_at":"2025-03-19T21:35:18.000Z","dependencies_parsed_at":"2025-02-04T21:29:48.991Z","dependency_job_id":null,"html_url":"https://github.com/peeeuzin/pgbulk","commit_stats":null,"previous_names":["peeeuzin/populate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peeeuzin%2Fpgbulk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peeeuzin%2Fpgbulk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peeeuzin%2Fpgbulk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peeeuzin%2Fpgbulk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peeeuzin","download_url":"https://codeload.github.com/peeeuzin/pgbulk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131315,"owners_count":21052819,"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":["bulk-insert","nodejs","postgresql","sql","typescript"],"created_at":"2025-02-18T22:29:39.717Z","updated_at":"2025-04-10T00:16:17.071Z","avatar_url":"https://github.com/peeeuzin.png","language":"TypeScript","readme":"# pgbulk\n[![GitHub License](https://img.shields.io/github/license/peeeuzin/populate)](https://github.com/peeeuzin/pgbulk/blob/main/LICENSE)\n[![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr/peeeuzin/populate)](https://github.com/peeeuzin/pgbulk/pulls)\n\n## What's pgbulk?\nA library for bulk inserts into PostgreSQL with TypeScript, you just need to parse it.\n\nPopulate can be used for bulk insert CSV files into PostgreSQL with performance.\n\n## Installation\nYou can install the package using npm:\n```bash\n# npm\nnpm install pgbulk \n\n# yarn\nyarn add pgbulk\n\n# pnpm\npnpm add pgbulk\n```\n\n## Example\n```ts\nimport { PGBulk } from 'pgbulk';\n\nclass Users extends PGBulk {\n  constructor(connectionURL: string) {\n    super({\n      connection: {\n        connectionString: connectionURL,\n      },\n      strategy: \"csv\",\n      tables: {\n        users: [\n          {\n            databaseColumn: \"id\",\n            type: \"TEXT\",\n          },\n\n          {\n            databaseColumn: \"name\",\n            type: \"TEXT\",\n          },\n\n          {\n            databaseColumn: \"nickname\",\n            csvColumn: \"aka\",\n            type: \"TEXT\",\n          },\n        ]\n      },\n      allowDisableIndexes: true,\n      allowDisableForeignKeys: true,\n    })\n\n    this.register(\"pathto/data\", \"users-*.csv\");\n  },\n\n  await parse(row: Row) {\n    // do some parsing thing\n    // ...\n    return row\n  }\n}\n\nconst usersPopulate = new Users(\"\u003cpostgres_url\u003e\");\n\nawait usersPopulate.start();\nawait usersPopulate.finish();\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeeeuzin%2Fpgbulk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeeeuzin%2Fpgbulk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeeeuzin%2Fpgbulk/lists"}