{"id":19223717,"url":"https://github.com/wmfs/relationize","last_synced_at":"2025-07-25T05:38:39.364Z","repository":{"id":21269856,"uuid":"136904013","full_name":"wmfs/relationize","owner":"wmfs","description":"Takes a set of JSON Schema definitions and returns a relational database structure capable of storing compliant data.","archived":false,"fork":false,"pushed_at":"2025-06-29T23:34:59.000Z","size":395,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-06T06:46:50.615Z","etag":null,"topics":["package","postgresql","tymly"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/wmfs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-06-11T09:27:05.000Z","updated_at":"2025-06-29T23:35:01.000Z","dependencies_parsed_at":"2023-09-27T12:14:51.321Z","dependency_job_id":"410a48d9-7474-4373-84d4-28019d69bd10","html_url":"https://github.com/wmfs/relationize","commit_stats":{"total_commits":316,"total_committers":11,"mean_commits":"28.727272727272727","dds":0.6740506329113924,"last_synced_commit":"9d995ad91a0de0e53fb94a17567998e20d3caa5f"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/wmfs/relationize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmfs%2Frelationize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmfs%2Frelationize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmfs%2Frelationize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmfs%2Frelationize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wmfs","download_url":"https://codeload.github.com/wmfs/relationize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmfs%2Frelationize/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266962262,"owners_count":24012994,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"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":["package","postgresql","tymly"],"created_at":"2024-11-09T15:09:21.653Z","updated_at":"2025-07-25T05:38:39.335Z","avatar_url":"https://github.com/wmfs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# relationize\n[![Tymly Package](https://img.shields.io/badge/tymly-package-blue.svg)](https://tymly.io/)\n[![npm (scoped)](https://img.shields.io/npm/v/@wmfs/relationize.svg)](https://www.npmjs.com/package/@wmfs/relationize)\n[![CircleCI](https://circleci.com/gh/wmfs/relationize.svg?style=svg)](https://circleci.com/gh/wmfs/relationize)\n[![codecov](https://codecov.io/gh/wmfs/relationize/branch/master/graph/badge.svg)](https://codecov.io/gh/wmfs/relationize)\n[![CodeFactor](https://www.codefactor.io/repository/github/wmfs/relationize/badge)](https://www.codefactor.io/repository/github/wmfs/relationize)\n[![Dependabot badge](https://img.shields.io/badge/Dependabot-active-brightgreen.svg)](https://dependabot.com/)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmfs/tymly/blob/master/packages/pg-concat/LICENSE)\n\n\n\n\n\t\n\u003e Takes a set of JSON Schema definitions and returns a relational database structure capable of storing compliant data.\n\n## \u003ca name=\"install\"\u003e\u003c/a\u003eInstall\n```bash\n$ npm install relationize --save\n```\n\n## \u003ca name=\"usage\"\u003e\u003c/a\u003eUsage\n\n```javascript\n  const relationize = require('relationize')\n\n  relationize (\n    {\n      source: {\n        paths: [\n          {\n            namespace: 'relationizeTest',\n            path: '/somewhere/json-schemas/live'\n          }\n        ]\n      }\n    },\n    function (err, dbStructure) {\n      // Done!\n      // - The value of 'dbStructure' takes the same form  \n      //   as the output generated by the 'pg-info' package.\n    }\n  )\n```\n\n## \u003ca name=\"api\"\u003e\u003c/a\u003eAPI\n\n### relationize(options, callback)\n\n### Options:\n| Option  | Type | Notes |\n| ------  | ----- | ------ |\n| `source`  | `object`  | A `source` object for configuring where to derive JSON Schema data from.\n\n### `source` object\n\n__Examples__\n\n* From files:\n\n```javascript\n{\n  paths: [\n    {\n      namespace: 'relationizeTest',\n      path: '/somewhere/json-schemas/live'\n    }\n  ]\n}\n```\n\n* From Javascript object:\n\n```javascript\n{\n  schemas: [\n    {\n      namespace: 'relationizeTest',\n      schema: {\n        // JSON schema here\n      }\n    }\n  ]\n}\n```\n\n__Properties__\n\n| property | Type  | Notes |\n| -------- | ----- | ----- |\n| `paths` | `[object]` | An array of objects containing a `namespace` property (used to separate related tables into schemas_ and `path` (a file-path from where to load JSON files from - uses [glob](https://www.npmjs.com/package/glob), so the `**` pattern is supported)\n| `schemas` | `[object]` | An array of objects containing a `namespace` property (used to separate related tables into schemas_ and `schema` (a ready-to-use JSON Schema)\n\n\n\n## \u003ca name=\"output\"\u003e\u003c/a\u003eOutput\n\nRelationize returns objects of the same form as those returned by the __[pg-info](https://github.com/wmfs/pg-info)__ package.\nThe output of Relationize can then be used to generate a relational database (complete with comments, tables, indexes and foreign key constraints) to store your JSON-structured data.\n\n* __Please refer to the [pg-info docs](https://github.com/wmfs/tymly/tree/master/packages/pg-info) for more details.__\n\n\n## \u003ca name=\"test\"\u003e\u003c/a\u003eTesting\n\n\n```bash\n$ npm test\n```\n\n## \u003ca name=\"license\"\u003e\u003c/a\u003eLicense\n[MIT](https://github.com/wmfs/relationize/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmfs%2Frelationize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwmfs%2Frelationize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmfs%2Frelationize/lists"}