{"id":13599462,"url":"https://github.com/joneldiablo/objection-model-generator","last_synced_at":"2025-04-10T12:32:52.378Z","repository":{"id":34985113,"uuid":"194344031","full_name":"joneldiablo/objection-model-generator","owner":"joneldiablo","description":"automagically generate all ObjectionJS models from Mysql","archived":false,"fork":false,"pushed_at":"2024-04-09T16:14:21.000Z","size":718,"stargazers_count":12,"open_issues_count":2,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T06:11:53.352Z","etag":null,"topics":["automagically","automation","model","models","mysql","objection","objectionjs"],"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/joneldiablo.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-06-28T23:28:59.000Z","updated_at":"2024-06-19T11:17:07.534Z","dependencies_parsed_at":"2024-01-16T22:21:14.019Z","dependency_job_id":"433ac776-a137-4a29-b9d4-0bf7b86bc94a","html_url":"https://github.com/joneldiablo/objection-model-generator","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":"0.16000000000000003","last_synced_commit":"8ea4fe2a1af543795a8d47b91c2654e09c309f01"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneldiablo%2Fobjection-model-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneldiablo%2Fobjection-model-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneldiablo%2Fobjection-model-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneldiablo%2Fobjection-model-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joneldiablo","download_url":"https://codeload.github.com/joneldiablo/objection-model-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217145,"owners_count":21066633,"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":["automagically","automation","model","models","mysql","objection","objectionjs"],"created_at":"2024-08-01T17:01:04.517Z","updated_at":"2025-04-10T12:32:50.591Z","avatar_url":"https://github.com/joneldiablo.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# OMG\n\nObjection Model Generator is a tool to _automagically_ generate all ObjectionJS models from Mysql data base, using the information_schema table to let us know tables, columns and BelongsToOneRelations.\n\n```js\n\nrequire('dotenv').config();\nconst fs = require('fs');\nconst Omg = require('objection-model-generator');\n\n// OPTIONAL: add pluralize customization\nconst pluralize = require('pluralize');\npluralize.addSingularRule('mouse', 'mice');\npluralize.addSingularRule('Mouse', 'Mice');\n//----\n\nconst main = async () =\u003e {\n  let omg = new Omg({\n    host: process.env.DB_HOST,\n    port: process.env.DB_PORT,\n    user: process.env.DB_USER,\n    password: process.env.DB_PASS\n  }, process.env.DB_NAME, '../knex'); // relative path to the knex instance, the generated file goings to require that file\n  let ms = await omg.createModels();\n  let path = 'src/api/models/generated.js'; // path to where goings to be created the output\n  fs.writeFileSync(path, ms);\n  console.log('-\u003e file writed:', path);\n  process.exit();\n}\n\nmain();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoneldiablo%2Fobjection-model-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoneldiablo%2Fobjection-model-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoneldiablo%2Fobjection-model-generator/lists"}