{"id":15118680,"url":"https://github.com/michal-kapala/pocketbase-import","last_synced_at":"2026-04-02T18:05:43.511Z","repository":{"id":116633433,"uuid":"610041753","full_name":"michal-kapala/pocketbase-import","owner":"michal-kapala","description":"Data import utilities for PocketBase","archived":false,"fork":false,"pushed_at":"2025-12-04T14:08:22.000Z","size":23,"stargazers_count":62,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-07T06:48:45.403Z","etag":null,"topics":["data-import","pocketbase"],"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/michal-kapala.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-06T00:40:48.000Z","updated_at":"2025-11-26T09:35:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"f34c21df-d31d-4f1f-8d95-9b8f53139e12","html_url":"https://github.com/michal-kapala/pocketbase-import","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/michal-kapala/pocketbase-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michal-kapala%2Fpocketbase-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michal-kapala%2Fpocketbase-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michal-kapala%2Fpocketbase-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michal-kapala%2Fpocketbase-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michal-kapala","download_url":"https://codeload.github.com/michal-kapala/pocketbase-import/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michal-kapala%2Fpocketbase-import/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["data-import","pocketbase"],"created_at":"2024-09-26T01:53:34.221Z","updated_at":"2026-02-18T04:03:08.425Z","avatar_url":"https://github.com/michal-kapala.png","language":"TypeScript","funding_links":[],"categories":["Tools/Plugin","TypeScript"],"sub_categories":["Other"],"readme":"# Overview\n\nPocketBase data import tools for CSV and JSON files made using\n[PocketBase JS SDK](https://github.com/pocketbase/js-sdk).\n\nAutomatically creates typed PocketBase collection and populates it with data.\n\nColumns conflicting with PocketBase's autogenerated system fields (`id`,\n`created`, `updated`; case-insensitive check, target column name's case is not\naffected) are prefixed with `_`. Collection conflict will cause the import to\nfail without any changes to the database.\n\nNo rules, options or constraints are set for the new collection (see the import\nlog for a full structure). You can modify them after the import from\nPocketBase's dashboard.\n\n## Types\n\n`pocketbase-import` detects types using regular expressions. Currently supported\nPocketBase types are:\n\n- `Bool`\n- `Number`\n- `Plain text`\n- `Email`\n- `DateTime`\n- `JSON`\n- `Url`\n\n# Configuration\n\nInstall the latest [Deno runtime](https://deno.com/) to run the scripts.\n\nIn the root directory create `.env` file with the following environment\nvariables:\n\n- `ADMIN_EMAIL` (required) - superadmin email\n- `ADMIN_PASSWORD` (required) - superadmin password\n- `POCKETBASE_URL` (optional) - PocketBase app URL, defaults to local instance\n\nPlace your import files inside of `input` directory.\n\nMake sure the target PocketBase instance is running and pointed to by\n`POCKETBASE_URL`.\n\nFor versions `\u003e=0.23.2`, enable and configure [batch API](https://pocketbase.io/docs/api-records/#batch-createupdateupsertdelete-records) access - go to *Settings \u003e Application* in PocketBase dashboard (see below). Adjust the parameters to your performance requirements or use the defaults for small/middle-sized datasets.\n\n![Batch API settings](https://github.com/user-attachments/assets/3205bf36-1e86-471b-a1b9-c28c6b118065)\n\n# Options\n\nYou can change the default import options to your needs:\n\n| Name      | Files    | Required | Description                                                                                                  | Example use         |\n| --------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------ | ------------------- |\n| input     | CSV/JSON | Yes      | The name of the input file (with extension)                                                                  | --input=example.csv |\n| id        | CSV/JSON | No       | Indicates that `_id` column should be typed as plain text, the type is detected by default                   | --id                |\n| max_batch | CSV/JSON | No       | Max batch request size in rows, should not exceed PocketBase's `Max allowed batch requests`. Defaults to 50. | --max_batch=100     |\n| lf        | CSV      | No       | LF (`\\n`) EOL character will be used instead of default CRLF (`\\r\\n`)                                        | --lf                |\n| delimiter | CSV      | No       | Column value separator, defaults to `,`                                                                      | --delimiter=\";\"     |\n| quote     | CSV      | No       | Value quote character, defaults to `'`                                                                       | --quote=\"~\"         |\n\n# CSV\n\nThe import is **not** multiline-safe, so if you have a file with strings\nspanning across multiple lines the best option for you is to convert the input\nfile to JSON with tools like\n[DB Browser for SQLite](https://sqlitebrowser.org/).\n\n## Examples\n\nBasic import (root directory):\n\n```\ndeno run csv.ts --input=example.csv\n```\n\nImport without permission prompts and with max batch request size of 1 row:\n\n```\ndeno run --allow-read --allow-env --allow-net csv.ts --input=example.csv --max_batch=1\n```\n\nImport without permission prompts and with `_id` column as text:\n\n```\ndeno run --allow-read --allow-env --allow-net csv.ts --input=example.csv --id\n```\n\nImport with custom parser options (you need to adjust `example.csv`):\n\n```\ndeno run csv.ts --input=example.csv --delimiter=\";\" --quote=\"~\" --lf\n```\n\n# JSON\n\nThe required data format is an array of row objects.\n\n## Examples\n\nBasic import (root directory):\n\n```\ndeno run json.ts --input=example.json\n```\n\nImport without permission prompts and with max batch request size of 1 row:\n\n```\ndeno run --allow-read --allow-env --allow-net json.ts --input=example.json --max_batch=1\n```\n\nImport without permission prompts and with `_id` column as text:\n\n```\ndeno run --allow-read --allow-env --allow-net json.ts --input=example.json --id\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichal-kapala%2Fpocketbase-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichal-kapala%2Fpocketbase-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichal-kapala%2Fpocketbase-import/lists"}