{"id":21846547,"url":"https://github.com/andrglo/json-schema-table","last_synced_at":"2025-07-05T18:05:48.221Z","repository":{"id":36374619,"uuid":"40679472","full_name":"andrglo/json-schema-table","owner":"andrglo","description":"Creates and maintains a SQL table structure","archived":false,"fork":false,"pushed_at":"2025-03-11T17:14:20.000Z","size":774,"stargazers_count":29,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-19T10:19:47.712Z","etag":null,"topics":[],"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/andrglo.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":"2015-08-13T20:09:45.000Z","updated_at":"2025-03-11T17:14:25.000Z","dependencies_parsed_at":"2024-06-19T17:10:32.244Z","dependency_job_id":"0ad07a35-81ce-4bc9-8cb3-77683a330e50","html_url":"https://github.com/andrglo/json-schema-table","commit_stats":{"total_commits":102,"total_committers":4,"mean_commits":25.5,"dds":0.3137254901960784,"last_synced_commit":"7d937546d01e1c398847281edcbaa901d29cafe8"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/andrglo/json-schema-table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrglo%2Fjson-schema-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrglo%2Fjson-schema-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrglo%2Fjson-schema-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrglo%2Fjson-schema-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrglo","download_url":"https://codeload.github.com/andrglo/json-schema-table/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrglo%2Fjson-schema-table/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263781168,"owners_count":23510417,"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-27T23:14:23.057Z","updated_at":"2025-07-05T18:05:48.177Z","avatar_url":"https://github.com/andrglo.png","language":"JavaScript","readme":"# json-schema-table [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url] [![CircleCI](https://circleci.com/gh/andrglo/json-schema-table.svg?style=svg)](https://circleci.com/gh/andrglo/json-schema-table)\n\u003e Creates and maintains a SQL table structure equivalent to a\njson schema definition. For MSSQL and Postgres\n\nFirst you create all your tables and then syncronizes then\nwith each other to create the references. You can sync whenever\nyou modify your json schema\n\n## Install\n\n```sh\n$ npm install --save json-schema-table\n```\n\n## Usage\n\n```js\nvar jsonSchemaTable = require('json-schema-table');\nvar pg = require('pg-cr-layer');\nvar studentSchema = require('./student.json');\nvar classSchema = require('./class.json');\n\n// initialize and connect to a database\n\nvar studentTable = jsonSchemaTable('person', studentSchema, {db: pg});\nvar classTable = jsonSchemaTable('student', classSchema, {db: pg});\n\n// First create then sync to build the references\nstudentTable.create().then(function() {\n\treturn classTable.create();\n}).then(function() {\n\treturn studentTable.sync();\n}).then(function() {\n\treturn classTable.sync();\n}).catch(function(error) {\n\tconsole.log(error);\n});\n```\n For the db connection you can use [mssql-cr-layer](https://github.com/andrglo/mssql-cr-layer)\n or [pg-cr-layer](https://github.com/andrglo/pg-cr-layer)\n\n To more details take a look at the tests\n\n## License\n\nMIT © [Andre Gloria](andrglo.com)\n\n\n[npm-image]: https://badge.fury.io/js/json-schema-table.svg\n[npm-url]: https://npmjs.org/package/json-schema-table\n[daviddm-image]: https://david-dm.org/andrglo/json-schema-table.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/andrglo/json-schema-table\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrglo%2Fjson-schema-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrglo%2Fjson-schema-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrglo%2Fjson-schema-table/lists"}