{"id":15494365,"url":"https://github.com/minodisk/zoq","last_synced_at":"2025-04-22T20:23:20.016Z","repository":{"id":53863838,"uuid":"521512775","full_name":"minodisk/zoq","owner":"minodisk","description":"Convert Zod to BigQuery Schema","archived":false,"fork":false,"pushed_at":"2023-01-17T13:59:02.000Z","size":936,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T18:36:29.336Z","etag":null,"topics":["bigquery","bigquery-schema","bigquery-schema-converter","zod"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/zoq","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minodisk.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":"2022-08-05T05:20:39.000Z","updated_at":"2025-02-13T17:41:10.000Z","dependencies_parsed_at":"2023-02-10T09:50:30.291Z","dependency_job_id":null,"html_url":"https://github.com/minodisk/zoq","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minodisk%2Fzoq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minodisk%2Fzoq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minodisk%2Fzoq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minodisk%2Fzoq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minodisk","download_url":"https://codeload.github.com/minodisk/zoq/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250316585,"owners_count":21410568,"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":["bigquery","bigquery-schema","bigquery-schema-converter","zod"],"created_at":"2024-10-02T08:13:55.781Z","updated_at":"2025-04-22T20:23:19.980Z","avatar_url":"https://github.com/minodisk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zoq [![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fminodisk%2Fzoq%2Fbadge%3Fref%3Dmain\u0026style=flat-square)](https://actions-badge.atrox.dev/minodisk/zoq/goto?ref=main) [![NPM](https://img.shields.io/npm/v/zoq?style=flat-square)](https://www.npmjs.com/package/zoq) [![Codecov](https://img.shields.io/codecov/c/github/minodisk/zoq?style=flat-square)](https://app.codecov.io/gh/minodisk/zoq/)\n\nConvert [Zod](https://github.com/colinhacks/zod) to [BigQuery Schema](https://cloud.google.com/bigquery/docs/schemas).\n\n## Installation\n\n```bash\nnpm install -S zoq\n```\n\n## Usage\n\n```TypeScript\nimport { BigQuery } from \"@google-cloud/bigquery\";\nimport { z } from \"zod\";\nimport { convert, RegExpDate, RegExpTime } from \"zoq\";\n\nasync function createTable() {\n  const definition = z.object({\n    bool: z.boolean().nullable(),\n    numeric: z.number().nullable(),\n    int64: z.number().int().nullable(),\n    bigint: z.bigint().nullable(),\n    string: z.string().nullable(),\n    timestamp: z.date().nullable(),\n    date: z.string().regex(RegExpDate).nullable(),\n    time: z.string().regex(RegExpTime).nullable(),\n  });\n  const schema = convert(definition);\n\n  console.log(schema);\n  // outputs -\u003e [\n  //   { name: \"bool\", type: \"BOOL\", mode: \"NULLABLE\" },\n  //   { name: \"numeric\", type: \"NUMERIC\", mode: \"NULLABLE\" },\n  //   { name: \"int64\", type: \"INT64\", mode: \"NULLABLE\" },\n  //   { name: \"bigint\", type: \"BIGNUMERIC\", mode: \"NULLABLE\" },\n  //   { name: \"string\", type: \"STRING\", mode: \"NULLABLE\" },\n  //   { name: \"timestamp\", type: \"TIMESTAMP\", mode: \"NULLABLE\" },\n  //   { name: \"date\", type: \"DATE\", mode: \"NULLABLE\" },\n  //   { name: \"time\", type: \"TIME\", mode: \"NULLABLE\" },\n  // ];\n\n  await new BigQuery()\n    .dataset(\"dataset_id\")\n    .createTable(\"table_id\", { schema });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminodisk%2Fzoq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminodisk%2Fzoq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminodisk%2Fzoq/lists"}