{"id":13433196,"url":"https://github.com/Kononnable/typeorm-model-generator","last_synced_at":"2025-03-17T10:33:39.283Z","repository":{"id":40486167,"uuid":"85991467","full_name":"Kononnable/typeorm-model-generator","owner":"Kononnable","description":"Generates models for TypeORM from existing database.","archived":true,"fork":false,"pushed_at":"2022-10-10T06:20:10.000Z","size":2687,"stargazers_count":1521,"open_issues_count":24,"forks_count":284,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-05T21:32:55.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Kononnable.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-23T19:52:39.000Z","updated_at":"2025-03-05T07:27:29.000Z","dependencies_parsed_at":"2022-07-11T20:03:19.783Z","dependency_job_id":null,"html_url":"https://github.com/Kononnable/typeorm-model-generator","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kononnable%2Ftypeorm-model-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kononnable%2Ftypeorm-model-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kononnable%2Ftypeorm-model-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kononnable%2Ftypeorm-model-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kononnable","download_url":"https://codeload.github.com/Kononnable/typeorm-model-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243891075,"owners_count":20364569,"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-07-31T02:01:22.299Z","updated_at":"2025-03-17T10:33:38.905Z","avatar_url":"https://github.com/Kononnable.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","语言资源库","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["typescript"],"readme":"# typeorm-model-generator\n\n[![npm version](https://badge.fury.io/js/typeorm-model-generator.svg)](https://badge.fury.io/js/typeorm-model-generator)\n[![codecov](https://codecov.io/gh/Kononnable/typeorm-model-generator/branch/master/graph/badge.svg)](https://codecov.io/gh/Kononnable/typeorm-model-generator)\n\n***\n## :warning: This project is in a maintenance phase. See [#329](https://github.com/Kononnable/typeorm-model-generator/issues/329) for details.\n***\nGenerates models for TypeORM from existing databases.\nSupported db engines:\n* Microsoft SQL Server\n* PostgreSQL\n* MySQL\n* MariaDB\n* Oracle Database\n* SQLite\n\n\n## Installation\n### Versions\nTypeorm-model-generator comes with preinstalled driver for each supported db(except for oracle). However if you want to use it as a dev-dependency you may want to install your db driver manually to reduce dependency footprint, reduce time spent in the CI. In such case you can use version without preinstalled db drivers - `npm i typeorm-model-generator@no-engines`.  \n### Global module\nTo install module globally simply type `npm i -g typeorm-model-generator` in your console.\n### Npx way\nThanks to npx you can use npm modules without polluting global installs. So nothing to do here :)\n\u003eTo use `npx` you need to use npm at version at least 5.2.0. Try updating your npm by `npm i -g npm`\n### Database drivers\nAll database drivers except oracle are installed by default. To use typeorm-model-generator with oracle database you need to install driver with `npm i oracledb` and configure [oracle install client](http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html) on your machine.\n\n## Usage \nThere are two way to use this utility:\n- Use step by step wizard which will guide you though the process - just type `npx typeorm-model-generator` in your console.\n- Provide all parameters through command line(examples below)\n\n\nUse `npx typeorm-model-generator --help` to see all available parameters with their descriptions. Some basic parameters below:\n```shell\nUsage: typeorm-model-generator -h \u003chost\u003e -d \u003cdatabase\u003e -p [port] -u \u003cuser\u003e -x\n[password] -e [engine]\n\nOptions:\n  --help                 Show help                                     [boolean]\n  --version              Show version number                           [boolean]\n  -h, --host             IP address/Hostname for database server\n                                                          [default: \"127.0.0.1\"]\n  -d, --database         Database name(or path for sqlite)            [required]\n  -u, --user             Username for database server\n  -x, --pass             Password for database server              [default: \"\"]\n  -p, --port             Port number for database server\n  -e, --engine           Database engine\n          [choices: \"mssql\", \"postgres\", \"mysql\", \"mariadb\", \"oracle\", \"sqlite\"]\n                                                              [default: \"mssql\"]\n  -o, --output           Where to place generated models\n                            [default: \"./output\"]\n  -s, --schema           Schema name to create model from. Only for mssql\n                         and postgres. You can pass multiple values\n                         separated by comma eg. -s scheme1,scheme2,scheme3\n  --ssl                                               [boolean] [default: false]\n```\n### Examples\n\n* Creating model from local MSSQL database\n   * Global module\n      ```\n      typeorm-model-generator -h localhost -d tempdb -u sa -x !Passw0rd -e mssql -o .\n      ````\n   * Npx Way\n      ```\n      npx typeorm-model-generator -h localhost -d tempdb -u sa -x !Passw0rd -e mssql -o .\n      ````\n* Creating model from local Postgres database, public schema with ssl connection\n   * Global module\n      ```\n      typeorm-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o . -s public --ssl\n      ````\n   * Npx Way\n      ```\n      npx typeorm-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o . -s public --ssl\n      ````\n* Creating model from SQLite database\n   * Global module\n      ```\n      typeorm-model-generator -d \"Z:\\sqlite.db\" -e sqlite -o .\n      ````\n   * Npx Way\n      ```\n      npx typeorm-model-generator -d \"Z:\\sqlite.db\" -e sqlite -o .\n      ````\n## Use Cases\nPlease take a look at [few workflows](USECASES.md) which might help you with deciding how you're gonna use typeorm-model-generator.\n## Naming strategy\nIf you want to generate custom names for properties in generated entities you need to use custom naming strategy. You need to create your own version of [NamingStrategy](https://github.com/Kononnable/typeorm-model-generator/blob/master/src/NamingStrategy.ts) and pass it as command parameter.\n\n```typeorm-model-generator -d typeorm_mg --namingStrategy=./NamingStrategy -e sqlite -db /tmp/sqliteto.db```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKononnable%2Ftypeorm-model-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKononnable%2Ftypeorm-model-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKononnable%2Ftypeorm-model-generator/lists"}