docs changes

This commit is contained in:
Kononnable 2019-09-15 23:44:55 +02:00
parent 8fdac81539
commit e58a448788
3 changed files with 26 additions and 26 deletions

View File

@ -9,7 +9,7 @@
## <a name="question"></a> Got a Question or Problem?
* You can create issue on [github](https://github.com/Kononnable/typeorm-model-generator/issues)
* While this tool doesn't have separate separate chat you can use [typeorm slack workspace](https://join.slack.com/t/typeorm/shared_invite/enQtNDQ1MzA3MDA5MTExLTFiNDEyOGUxZGQyYWIwOTA0NDQxODdkOGQ0OTUxNzFjYjUwY2E0ZmFlODc5OTYyYzAzNGM3MGZjYzhjYTBiZTY) since everyone using this tool will also use typeorm.
* While this tool doesn't have separate separate chat room you can use [typeorm slack workspace](https://join.slack.com/t/typeorm/shared_invite/enQtNDQ1MzA3MDA5MTExLTFiNDEyOGUxZGQyYWIwOTA0NDQxODdkOGQ0OTUxNzFjYjUwY2E0ZmFlODc5OTYyYzAzNGM3MGZjYzhjYTBiZTY) since everyone using typeorm-model-generator will also use typeorm.
@ -17,7 +17,7 @@
### <a name="submit-issue"></a> Submitting an Issue
Before you submitting new issue, please check the issue tracker, maybe your problem is already described and the discussion might inform you of available workarounds.
Before submitting new issue, please check the issue tracker, maybe your problem is already described and the discussion might inform you of available workarounds.
Before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs, we will ask you to provide a minimal reproduction. Having a minimal reproducible scenario gives us a wealth of important information without going back & forth to you with additional questions. A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem.
@ -47,6 +47,6 @@ Before you submit your Pull Request (PR) consider the following guidelines:
* Re-run test suites to ensure tests are still passing.
* Push to your GitHub repository (this will update your Pull Request)
Note: if you don't want to run tests on your own for some reason you can rely on tests run on CI.
Note: if you don't want to run tests on your machine you can rely on tests run on CI(unless you're changing something oracledb specific).
That's it! Thank you for your contribution!

View File

@ -1,30 +1,30 @@
# Setting up environment
## Building
After cloning the repository you can check your changes made to source code without compiling whole library. Just run `npm start` to run this tool through ts-node. It helps with development speed and avoids problem with setting correct sourcemaps when debugging.
After cloning the repository you can check your changes made to source code without compiling whole library. Just run `npm start` to run typeorm-model-generator through ts-node. It helps with development speed and avoids problem with setting correct sourcemaps when debugging.
However if you want to build typeorm-model-generator you can do this by running
However if you want to build typeorm-model-generator you can do this by running:
```
npm run build
```
this might come handy if you want to build full pipeline workflow with typeorm-model-generator and install it through `npm link`.
It might come handy if you want to build full pipeline workflow with model generator and install it through `npm link`.
## Running Tests Locally
To run tests you need to have docker and docker-compose installed. You may also use non-dockerized database servers but it's not recommended - they might use non-default settings.
To run tests you need to have docker and docker-compose installed. You may also use non-dockerized database servers but it's not recommended - they might use non-default database engine settings.
### Oracle Database
If you want to run oracle tests locally you must have *oracle client* configured for your machine and accepted oracle license on *DockerHub*. Because of oracle client limitations i.e. it's not distributed for 32bit environments you have to install oracledb manually
If you want to run oracle tests locally you must have [oracle client](https://oracle.github.io/node-oracledb/INSTALL.html#quickstart) configured for your machine and accepted oracle license on [DockerHub](https://hub.docker.com/_/oracle-database-enterprise-edition). Because of oracle client limitations i.e. it's not distributed for 32bit environments you have to install oracledb manually:
```
npm install oracledb --no-save
```
### Configuration
Tests use environment values to connect to multiple database engines. For developer convenience there is already prepared env file with default connection settings for connecting to dockerized db engines. This is also the place you can disable testing on specific db engine. You just need to rename the env file
Tests use environment values to provide credentials for connecting to multiple database engines. For developer convenience there is prepared env file with default connection settings(for connecting to dockerized db engines). After cloning the repo you just need to rename the env file:
```
cp .env.dit .env
cp .env.dist .env
```
### Database engines
Next you have to start db engines. If you want to test all of the drivers and have configured oracle correctly you can just
Next you have to start db engines. If you want to test all of the drivers and have configured oracle correctly you can just:
```
docker-compose up -d
```
You can also start just specific database engines e.g.
You can also start just specific database engines e.g.:
```
docker-compose up -d mysql postgres mariadb
```

View File

@ -1,24 +1,24 @@
# Common use cases
Typeorm-model-generator can be used in multiple ways. Here are some workflows you can use.
Typeorm-model-generator can be used in multiple workflows. Here are described few recommended ones.
## Use directly from npm
You can use typeorm-model-generator directly from npm
You can use typeorm-model-generator directly from npm:
```
npx typeorm-model-generator
```
Please remember using `npx typeorm-model-generator` will download latest available version. To avoid it you can specify version each time `npx typeorm-model-generator@0.3.0` or install a package locally - npx will use locally installed version then.
Please remember that by using `npx typeorm-model-generator` you will download latest available version. To avoid it you can specify version each time `npx typeorm-model-generator@0.3.0` or install a package locally - npx will use locally installed version then.
### command line parameters
You can customize generated output by specifying multiple parameters. Full list of parameters are available through `npx typeorm-model-generator --help`
### config file
If you execute `npx typeorm-model-generator` without specifying any parameters you will enter a wizard mode which will guide you through specifying connection settings and allow to customize generated model. At the end of this process you can save your choices, so the process will run automatically next time.
If you execute `npx typeorm-model-generator` without specifying any parameters you will enter a wizard mode which will guide you through specifying connection settings and allow to customize generated models. At the end of this process you will be able to save your settings, so the process will run automatically next time.
## clone repo and make manual changes
If you need more power over how models are generated you can fork the repo and make changes to the code specific to your use case there.
If you need more power over how models are generated you can fork the repo and make changes to the code which are specific to your use case.
- fork the repo
- clone forked repo locally
- create branch for your changes
- create branch for your changes:
```
git checkout -b my-branch master
```
- add remote repository
- add remote repository:
```
git remote add upstream https://github.com/Kononnable/typeorm-model-generator.git
```
@ -26,28 +26,28 @@ You can run model generation tool by running `npm run start` after installing de
When you want to download changes made on main typeorm-model-generator repo just
- checkout `master` branch
- download changes from main repository
- download changes from main repository:
```
git pull --ff upstream master
```
- checkout branch with your changes
- checkout branch with your changes:
```
git checkout my-branch
```
- merge changes onto your branch
- merge changes onto your branch:
```
git merge master
```
## git repo with dependency and entire pipeline
Similar to last workflow, but this time we don't have to worry about manually merging changes from main repository.
- Init new package
- Init new package:
```
npm init -y
```
- Install typeorm-model-generator as a dependency
- Install typeorm-model-generator as a dependency:
```
npm install typeorm-model-generator
```
- Write code which loads generated entities files and change its content
- Run typeorm-model-generator, then your code which customizes it(you may add this to `package.json` scripts section)
- Write code which loads generated entity files and change its content
- Run typeorm-model-generator, then your code which customizes it (you may add this step to `package.json` scripts section)