{"id":20820721,"url":"https://github.com/webdad/json2mysql","last_synced_at":"2026-04-19T21:06:57.131Z","repository":{"id":143885823,"uuid":"165023379","full_name":"WebDaD/json2mysql","owner":"WebDaD","description":"Allows to write a JSON-Object as fields into a mysql-table","archived":false,"fork":false,"pushed_at":"2019-01-16T10:16:39.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-19T04:28:37.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebDaD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-01-10T08:43:46.000Z","updated_at":"2021-12-06T04:48:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"79f3e9f1-c4c6-419d-be46-7806f320751b","html_url":"https://github.com/WebDaD/json2mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fjson2mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fjson2mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fjson2mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fjson2mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDaD","download_url":"https://codeload.github.com/WebDaD/json2mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243166971,"owners_count":20247006,"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-17T22:09:56.552Z","updated_at":"2025-12-24T21:51:34.888Z","avatar_url":"https://github.com/WebDaD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2mysql\r\n\r\nAllows to write a JSON-Object as fields into a mysql-table.\r\n\r\nIMPORTANT: Use one instance for one type of object with one table.  \r\nIf you want to use multiple json-types, create multiple instances!\r\n\r\n## Installation\r\n\r\nJust use `npm install lib-json2mysql`\r\n\r\n## Usage\r\n\r\nThe Usage is simple, the config is extensive :-)\r\n\r\n`const JSON2MySQL = require('lib-json2mysql')`  \r\n\r\n`let j2m = new JSON2MySQL(config)`  \r\n\r\n`j2m.setup(callback)`  \r\n\r\n### Insert an Object\r\n\r\nJust use:  \r\n\r\n`j2m.add(json, callback)`  \r\n\r\n## Config\r\n\r\nThere are a lot of config parameters to give.  \r\nJust see config.sample.json for a full example of all options.\r\n\r\n### Required\r\n\r\n* table: The Name of the Table in the Database to use\r\n* fields: An Array of json-names mapped to MySQL-Database-Field-Types\r\n* mysql: An open Connection to a MySQL-Database\r\n\r\n### Optional\r\n\r\n* indices: An Array of fields that should be indexed\r\n* primary: An Array of fields that should be used as a (combined) Primary Key\r\n* partioning: Allows for Partioning, expects the fields \"on\" (name of the field) and \"count\"(Number of partitions)\r\n* engine: The Engine to use. Default is InnoDB\r\n* ignoreInsertError: Ignore any Insert Errors. Default is false\r\n\r\n## Testing\r\n\r\nTo Test you may install the dev-dependencies, then fire up a local database.  \r\nThen just run `npm run test`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdad%2Fjson2mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdad%2Fjson2mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdad%2Fjson2mysql/lists"}