Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7623e890609610c1ea8cc6f98f70556267d8a8c6
Merge: 038c2edd 13ac222
Author: Petter Häggholm <[email protected]>
Date:   Sat Sep 14 17:54:03 2019 -0700

    bugfix

commit 038c2edd31def7860e46e8f3c92cfc88d7e66c61
Author: Petter Häggholm <[email protected]>
Date:   Sat Sep 14 14:22:35 2019 -0700

    fix locking

commit 13ac222
Author: Umed Khudoiberdiev <[email protected]>
Date:   Fri Sep 13 23:20:36 2019 +0500

    updated changelog

commit ae1f131
Author: Umed Khudoiberdiev <[email protected]>
Date:   Fri Sep 13 21:22:40 2019 +0500

    version bump

commit d8f1c81
Author: Roman <[email protected]>
Date:   Fri Sep 13 18:12:23 2019 +0300

    fix: sqlite connections don't ignore the schema property (typeorm#4599)

commit 0094f61
Author: Dennie de Lange <[email protected]>
Date:   Fri Sep 13 16:58:20 2019 +0200

    feat: add referenced table metadata to NamingStrategy to resolve foreign key name (typeorm#4274)

    Feature allows to use foreignkey metadata to generate database foreignkey names.

    Closes typeorm#3847 and typeorm#1355

commit 3abe5b9
Author: Toby Hinloopen <[email protected]>
Date:   Fri Sep 13 16:04:12 2019 +0200

    fix: "hstore injection" & properly handle NULL, empty string, backslashes & quotes in hstore key/value pairs (typeorm#4720)

    * Improve HStore object support

    * Add hstore-injection test

commit 644c21b
Author: Muma David Bwalya <[email protected]>
Date:   Fri Sep 13 12:32:22 2019 +0200

    docs: explicitly defining the optional nature of the ManyToOne and OneToMany relationship when viewed from the child entity (typeorm#4722)

    * Update many-to-one-one-to-many-relations.md

    Explicitly defining the optional nature of the ManyToOne and OneToMany relationship when viewed from the child entity.

    * Update docs/many-to-one-one-to-many-relations.md

    Punctuation and more accurate semantics.

    Co-Authored-By: Toby Hinloopen <[email protected]>

commit c52b3d2
Author: Evgeniy <[email protected]>
Date:   Fri Sep 13 13:04:11 2019 +0300

    fix: views generating broken Migrations (typeorm#4726)

    MigrationGenerateCommand didn't apply parameters to query and information about ViewTables couldn't be inserted into typeorm_metadata table. Also added code that creates typeorm_metadata table if ViewTables exists

    Fixed issue typeorm#4123

commit 1d73a90
Author: Ian Mobley <[email protected]>
Date:   Fri Sep 13 00:22:17 2019 -0700

    fix: createQueryBuilder relation remove works only if using ID (typeorm#2632) (typeorm#4734)

commit 81f4b43
Author: Alex Howard <[email protected]>
Date:   Fri Sep 13 03:16:07 2019 -0400

    docs: added missing comma in relations.md (typeorm#4739)

commit 7808bba
Author: Junggun Lim <[email protected]>
Date:   Thu Sep 5 12:44:25 2019 -0700

    feat: UpdateResult returns affected rows in postgresql (typeorm#4432)

    * Added 'affected' field in UpdateResult as well as in DeleteResult.
     * PostgresQueryRunner returns the number of affected rows properly
     * UpdateQueryBuilder retrieves the affected rows returned by PostgresQueryRunner and
       sets the added 'affected' field of UpdateResult properly.

    Closes: typeorm#1308

commit 7a0beed
Author: Mophy Xiong <[email protected]>
Date:   Fri Sep 6 03:33:39 2019 +0800

    fix: the excessive stack depth comparing types `FindConditions<?>` and `FindConditions<?>` problem (typeorm#4470)

commit dacac83
Author: Michał Wadas <[email protected]>
Date:   Thu Sep 5 21:28:56 2019 +0200

    feat: add materialized View support for Postgres (typeorm#4478)

    feat: add option to synchronize or not to synchronize ViewEntity

    Fixes typeorm#4317
    Fixes  typeorm#3996

commit db8074a
Author: Nicolas Hervé <[email protected]>
Date:   Thu Sep 5 19:42:52 2019 +0200

    feat: add support for ON CONFLICT for cockroach (typeorm#4518)

    Closes: typeorm#4513

commit 19e2179
Author: hauau <[email protected]>
Date:   Fri Sep 6 00:38:54 2019 +0700

    feat: add `set` datatype support for MySQL/MariaDB (typeorm#4538)

    Set possible values defined using existing enum column option.
    Sets are implemented as arrays.

    Closes: typeorm#2779

commit 5c311ed
Author: David Chen <[email protected]>
Date:   Thu Sep 5 08:50:10 2019 -0700

    feat: add options to input init config for sql.js (typeorm#4560)

    * add options to input init config for sql.js

    * update changelog

    * updated connection-options docs

commit 3cf470d
Author: Aviad Hadad <[email protected]>
Date:   Thu Sep 5 18:46:19 2019 +0300

    fix: change PrimaryColumn decorator to clone passed options (typeorm#4571)

    Closes: typeorm#4570

commit 9e3d664
Author: Mike Guida <[email protected]>
Date:   Thu Sep 5 08:38:41 2019 -0700

    docs: clarify title of configuration sources (typeorm#4592)

commit 587d534
Author: Thomas Gieling <[email protected]>
Date:   Thu Sep 5 17:37:43 2019 +0200

    use remove in stead of delete (typeorm#4574)

    the `remove` method requires the entity itself as input. To remove a record based on it's id, you need to use `delete`

commit a925be9
Author: Michał Wadas <[email protected]>
Date:   Thu Sep 5 16:05:23 2019 +0200

    feat: add postgres pool error handler (typeorm#4474)

    Add option to customize pool error handling. Users can decide to log these errors with higher level (eg. error), crash application or reconnect.

commit f65ecc7
Author: JB Reefer <[email protected]>
Date:   Thu Sep 5 09:10:10 2019 -0400

    docs: grammar and wording fixes in active-record-data-mapper.md (typeorm#4615)

    Grammar and wording fixes in bottom paragraph

commit 445c740
Author: Duckie <[email protected]>
Date:   Thu Sep 5 08:59:50 2019 -0400

    fix: apostrophe in Postgres enum strings breaks query (typeorm#4631)

    * Patch to allow apostrophes in postgres enum string.

    * Make linter happy

    * Testing fix for MySQL

    * Limit to postgres and mysql, fix test description

    * Lets not be greedy.

commit c1406bb
Author: kevindashgit <[email protected]>
Date:   Thu Sep 5 05:30:24 2019 -0700

    docs: documentation for showMigrations() (typeorm#4644)

commit 2478198
Author: azxj <[email protected]>
Date:   Thu Sep 5 20:29:23 2019 +0800

    docs: remove duplicate segment in entities.md (typeorm#4638)

    Remove duplicate segment.

commit 5bd29d5
Author: QoVoQ <[email protected]>
Date:   Thu Sep 5 20:27:30 2019 +0800

    docs: update many-to-many-relations.md, make it easier to understand (typeorm#4680)

    * Update many-to-many-relations.md

    Make the example of the last section `many-to-many relations with custom properties` more clear and general.

    * Update many-to-many-relations.md

commit 92e4270
Author: Coroliov Oleg <[email protected]>
Date:   Thu Sep 5 15:25:06 2019 +0300

    feat: add mongodb `useUnifiedTopology` config parameter (typeorm#4684)

commit 690e6f5
Author: CavidM <[email protected]>
Date:   Thu Sep 5 05:18:03 2019 -0700

    fix: "database" option error in driver when use "url" option for connection

commit e589fda
Author: Michael Dzjaparidze <[email protected]>
Date:   Tue Sep 3 15:05:58 2019 +0200

    feat: export additional schema builder classes (typeorm#4325)

commit 3951b58
Author: David Podhola <[email protected]>
Date:   Sat Aug 31 23:39:04 2019 +0200

    docs: fix missing async (typeorm#4458)

    In the second example the lambda is correctly started with an `async`. It is missing in the first example.

commit d4e2443
Author: Kateile <[email protected]>
Date:   Sat Aug 31 21:26:44 2019 +0300

    docs: update typeorm-model-shim.js comment link (typeorm#4540)

    This link http://webpack.github.io/docs/configuration.html#resolve no longer exist

commit 4c2bffc
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Aug 30 23:43:04 2019 +0200

    chore: bump lodash from 4.17.11 to 4.17.15 (typeorm#4671)

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.17.11...4.17.15)

    Signed-off-by: dependabot[bot] <[email protected]>

commit 10bac1f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Aug 30 23:35:40 2019 +0200

    build: bump mixin-deep from 1.3.1 to 1.3.2 (typeorm#4648)

    Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
    - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
    - [Commits](jonschlinkert/mixin-deep@1.3.1...1.3.2)

    Signed-off-by: dependabot[bot] <[email protected]>

commit e81a77a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Aug 30 23:33:36 2019 +0200

    chore: bump lodash.template from 4.4.0 to 4.5.0 (typeorm#4416)

    Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.4.0...4.5.0)

    Signed-off-by: dependabot[bot] <[email protected]>

commit 00d46e1
Author: JB Reefer <[email protected]>
Date:   Sat Aug 24 05:08:26 2019 -0400

    docs: Update using-cli.md (typeorm#4618)

    Fix typo

commit d1594f5
Author: Abhijeet Chakraborty <[email protected]>
Date:   Wed Aug 14 14:01:48 2019 +0530

    fix: resolve issue with conversion string to simple-json (typeorm#4476)

    Closes: typeorm#4440

commit c321562
Author: Arseny Yankovsky <[email protected]>
Date:   Tue Aug 13 10:12:25 2019 +0200

    feat: Aurora Data API (typeorm#4375)

    * Initial POC Implementation

    * Initial POC Implementation

    * Implemented an interface transformation between typeorm and data api so most of the queries should work, added some tests

    * Fixed lint errors

    * Fixed a regex and added some tests on query transformation

    * Move out to a separate repo

    * Bumped aurora driver version to latest

    * Bumped aurora driver version to latest

    * Delegate transactions to the driver

    * Delegate transactions to the driver

    * WIP

    * WIP

    * Bump the aurora driver version

    * Bump the aurora driver version

    * Fixed aurora driver version

    * removed unused entity

commit b4e9cf0
Author: Marcos <[email protected]>
Date:   Wed Aug 7 11:35:11 2019 +0200

    docs: update typo in separating-entity-definition.md

    Typo in line 190: "Categeory" changed to "Category"

commit 9930283
Author: Charlie Cruzan <[email protected]>
Date:   Wed Aug 7 05:33:42 2019 -0400

    docs: update outdated Expo SQLite link

    * update Expo SQLite link

    * docs: fix expo-example repo link

commit 5e00e81
Author: Humberto Villalpando <[email protected]>
Date:   Wed Jul 31 06:47:36 2019 -0500

    chore: Update README.md

    Added some links for nativescript examples with vue and angular

commit 10a5182
Author: markamPL <[email protected]>
Date:   Wed Jul 24 09:00:47 2019 +0200

    docs: update typo in using-ormconfig.md

    Typo in .env configuration: .*js changed to *.js

commit b6d6278
Author: Liau Jian Jie <[email protected]>
Date:   Sun Jul 21 22:10:53 2019 +0800

    feat: add multi-dimensional cube support for PostgreSQL (typeorm#4378)

commit e12479e
Author: Abdoulaye K. Traoré <[email protected]>
Date:   Sat Jul 13 18:57:16 2019 +0200

    feat: log files loaded from glob patterns (typeorm#4346)

    This new feature logs the files that are loaded using the glob patterns to aid in debugging.

    Closes: typeorm#4162

commit c8dbf09
Author: Mike Harris <[email protected]>
Date:   Wed Jul 10 09:17:31 2019 -0400

    docs: Fix Typo (typeorm#4412)

commit a858de1
Author: Vlad Poluch <[email protected]>
Date:   Mon Jul 1 16:01:09 2019 +0200

    Revert "docs: fix typographical error in faq (typeorm#4321)" (typeorm#4380)

    This reverts commit 117185b.

commit 39a8e34
Author: Benjamin Dobell <[email protected]>
Date:   Mon Jul 1 01:18:55 2019 +1000

    feat: Added support for DISTINCT queries (typeorm#4109)

commit c8a9ea0
Author: Max Sommer <[email protected]>
Date:   Sun Jun 30 17:12:07 2019 +0200

    docs: add explanation ManyToMany with custom properties (typeorm#4308)

    * Add explanation ManyToMany with custom properties

    Since I myself ran into the issue and had to rewrite my code based on this solution I hope it may be helpful for others as well 😊

    * Update explanation with more relateable example

    Update explanation with abstract example to be more relateable
    Add cross link to faq

    * Update phrasing, unnecessary explanation and code

    Remove unnecessary explanation upfront mentioning FAQ
    Update phrasing of main explanatory paragraph to be more precise
    Update code example to work correctly

commit 79bf9f7
Author: Kononnable <[email protected]>
Date:   Sun Jun 30 17:11:06 2019 +0200

    build: node version upgrade in travis (typeorm#4312)

    * upgrading node CI tested versions

    * sqlite3 version upgrade

commit a6d7ba2
Author: Leonardo Falk <[email protected]>
Date:   Sun Jun 30 12:07:19 2019 -0300

    fix: add SaveOptions and RemoveOptions into ActiveRecord (typeorm#4318)

    * Adding SaveOptions to BaseEntity#save

    * Adding RemoveOptions to BaseEntity#remove

commit 684ffd1
Merge: 6429ccd 6a1206e
Author: Umed Khudoiberdiev <[email protected]>
Date:   Sun Jun 30 14:39:21 2019 +0300

    Merge pull request typeorm#4376 from typeorm/revert-4306-fix-4291

    Revert "fix: improve sql.js v1.0 support in browser environment"

commit 6a1206e
Author: Umed Khudoiberdiev <[email protected]>
Date:   Sun Jun 30 14:38:54 2019 +0300

    Revert "fix: improve sql.js v1.0 support in browser environment"

commit 6429ccd
Merge: 117185b ed87e34
Author: Umed Khudoiberdiev <[email protected]>
Date:   Sun Jun 30 14:00:46 2019 +0300

    Merge pull request typeorm#4306 from michaelbromley/fix-4291

    fix: improve sql.js v1.0 support in browser environment

commit 117185b
Author: SriNath <[email protected]>
Date:   Wed Jun 19 09:13:47 2019 -0400

    docs: fix typographical error in faq (typeorm#4321)

    change "typedi" to "typed" in how to use TypeORM with a dependency injection tool question

commit ed87e34
Author: Michael Bromley <[email protected]>
Date:   Tue Jun 18 10:25:35 2019 +0200

    Add more documentation on using sql.js in the browser

commit f7bcd8f
Author: Michael Bromley <[email protected]>
Date:   Tue Jun 18 10:05:04 2019 +0200

    Fix sql.js v1.0 support in browser
  • Loading branch information
haggholm committed Sep 15, 2019
1 parent d45863c commit c0c8dff
Show file tree
Hide file tree
Showing 108 changed files with 3,944 additions and 249 deletions.
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
language: node_js
node_js:
# - stable
- 12
- 10
- 9
- 8
# - 6
# - 4
# - 0.12
# - 0.11

services:
- docker
Expand Down
38 changes: 32 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
# Changelog
## [0.2.19](https://github.com/typeorm/typeorm/compare/0.2.18...0.2.19) (2019-09-13)

TypeORM follows a semantic versioning and until `1.0.0` breaking changes may appear in `0.x.x` versions,
however since API is already quite stable we don't expect too much breaking changes.
If we missed a note on some change or you have a questions on migrating from old version,
feel free to ask us and community.
### Bug Fixes

* "database" option error in driver when use "url" option for connection ([690e6f5](https://github.com/typeorm/typeorm/commit/690e6f5))
* "hstore injection" & properly handle NULL, empty string, backslashes & quotes in hstore key/value pairs ([#4720](https://github.com/typeorm/typeorm/issues/4720)) ([3abe5b9](https://github.com/typeorm/typeorm/commit/3abe5b9))
* add SaveOptions and RemoveOptions into ActiveRecord ([#4318](https://github.com/typeorm/typeorm/issues/4318)) ([a6d7ba2](https://github.com/typeorm/typeorm/commit/a6d7ba2))
* apostrophe in Postgres enum strings breaks query ([#4631](https://github.com/typeorm/typeorm/issues/4631)) ([445c740](https://github.com/typeorm/typeorm/commit/445c740))
* change PrimaryColumn decorator to clone passed options ([#4571](https://github.com/typeorm/typeorm/issues/4571)) ([3cf470d](https://github.com/typeorm/typeorm/commit/3cf470d)), closes [#4570](https://github.com/typeorm/typeorm/issues/4570)
* createQueryBuilder relation remove works only if using ID ([#2632](https://github.com/typeorm/typeorm/issues/2632)) ([#4734](https://github.com/typeorm/typeorm/issues/4734)) ([1d73a90](https://github.com/typeorm/typeorm/commit/1d73a90))
* resolve issue with conversion string to simple-json ([#4476](https://github.com/typeorm/typeorm/issues/4476)) ([d1594f5](https://github.com/typeorm/typeorm/commit/d1594f5)), closes [#4440](https://github.com/typeorm/typeorm/issues/4440)
* sqlite connections don't ignore the schema property ([#4599](https://github.com/typeorm/typeorm/issues/4599)) ([d8f1c81](https://github.com/typeorm/typeorm/commit/d8f1c81))
* the excessive stack depth comparing types `FindConditions<?>` and `FindConditions<?>` problem ([#4470](https://github.com/typeorm/typeorm/issues/4470)) ([7a0beed](https://github.com/typeorm/typeorm/commit/7a0beed))
* views generating broken Migrations ([#4726](https://github.com/typeorm/typeorm/issues/4726)) ([c52b3d2](https://github.com/typeorm/typeorm/commit/c52b3d2)), closes [#4123](https://github.com/typeorm/typeorm/issues/4123)


### Features

## 0.2.18 (UNRELEASED)
* add `set` datatype support for MySQL/MariaDB ([#4538](https://github.com/typeorm/typeorm/issues/4538)) ([19e2179](https://github.com/typeorm/typeorm/commit/19e2179)), closes [#2779](https://github.com/typeorm/typeorm/issues/2779)
* add materialized View support for Postgres ([#4478](https://github.com/typeorm/typeorm/issues/4478)) ([dacac83](https://github.com/typeorm/typeorm/commit/dacac83)), closes [#4317](https://github.com/typeorm/typeorm/issues/4317) [#3996](https://github.com/typeorm/typeorm/issues/3996)
* add mongodb `useUnifiedTopology` config parameter ([#4684](https://github.com/typeorm/typeorm/issues/4684)) ([92e4270](https://github.com/typeorm/typeorm/commit/92e4270))
* add multi-dimensional cube support for PostgreSQL ([#4378](https://github.com/typeorm/typeorm/issues/4378)) ([b6d6278](https://github.com/typeorm/typeorm/commit/b6d6278))
* add options to input init config for sql.js ([#4560](https://github.com/typeorm/typeorm/issues/4560)) ([5c311ed](https://github.com/typeorm/typeorm/commit/5c311ed))
* add postgres pool error handler ([#4474](https://github.com/typeorm/typeorm/issues/4474)) ([a925be9](https://github.com/typeorm/typeorm/commit/a925be9))
* add referenced table metadata to NamingStrategy to resolve foreign key name ([#4274](https://github.com/typeorm/typeorm/issues/4274)) ([0094f61](https://github.com/typeorm/typeorm/commit/0094f61)), closes [#3847](https://github.com/typeorm/typeorm/issues/3847) [#1355](https://github.com/typeorm/typeorm/issues/1355)
* add support for ON CONFLICT for cockroach ([#4518](https://github.com/typeorm/typeorm/issues/4518)) ([db8074a](https://github.com/typeorm/typeorm/commit/db8074a)), closes [#4513](https://github.com/typeorm/typeorm/issues/4513)
* Added support for DISTINCT queries ([#4109](https://github.com/typeorm/typeorm/issues/4109)) ([39a8e34](https://github.com/typeorm/typeorm/commit/39a8e34))
* Aurora Data API ([#4375](https://github.com/typeorm/typeorm/issues/4375)) ([c321562](https://github.com/typeorm/typeorm/commit/c321562))
* export additional schema builder classes ([#4325](https://github.com/typeorm/typeorm/issues/4325)) ([e589fda](https://github.com/typeorm/typeorm/commit/e589fda))
* log files loaded from glob patterns ([#4346](https://github.com/typeorm/typeorm/issues/4346)) ([e12479e](https://github.com/typeorm/typeorm/commit/e12479e)), closes [#4162](https://github.com/typeorm/typeorm/issues/4162)
* UpdateResult returns affected rows in postgresql ([#4432](https://github.com/typeorm/typeorm/issues/4432)) ([7808bba](https://github.com/typeorm/typeorm/commit/7808bba)), closes [#1308](https://github.com/typeorm/typeorm/issues/1308)

## 0.2.18

### Bug fixes

Expand All @@ -24,6 +49,7 @@ feel free to ask us and community.
* extend afterLoad() subscriber interface to take LoadEvent ([issue #4185](https://github.com/typeorm/typeorm/issues/4185))
* relation decorators (e.g. `@OneToMany`) now also accept `string` instead of `typeFunction`, which prevents circular dependency issues in the frontend/browser ([issue #4190](https://github.com/typeorm/typeorm/issues/4190))
* added support for metadata reflection in typeorm-class-transformer-shim.js ([issue #4219](https://github.com/typeorm/typeorm/issues/4219))
* added `sqlJsConfig` to input config when initializing sql.js ([issue #4559](https://github.com/typeorm/typeorm/issues/4559))

## 0.2.17 (2019-05-01)

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,8 @@ There are a few repositories which you can clone and start with:
* [Example how to use TypeORM in a Cordova/PhoneGap app](https://github.com/typeorm/cordova-example)
* [Example how to use TypeORM with an Ionic app](https://github.com/typeorm/ionic-example)
* [Example how to use TypeORM with React Native](https://github.com/typeorm/react-native-example)
* [Example how to use TypeORM with Nativescript-Vue](https://github.com/typeorm/nativescript-vue-typeorm-sample)
* [Example how to use TypeORM with Nativescript-Angular](https://github.com/betov18x/nativescript-angular-typeorm-example)
* [Example how to use TypeORM with Electron using JavaScript](https://github.com/typeorm/electron-javascript-example)
* [Example how to use TypeORM with Electron using TypeScript](https://github.com/typeorm/electron-typescript-example)

Expand Down
6 changes: 3 additions & 3 deletions docs/active-record-data-mapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Learn more about [custom repositories](custom-repository.md).
The decision is up to you.
Both strategies have their own cons and pros.

One thing we should always keep in mind in software development is how we are going to maintain it.
The `Data Mapper` approach helps you with maintainability of your software which is more effective in bigger apps.
The `Active record` approach helps you to keep things simple which works good in small apps.
One thing we should always keep in mind in with software development is how we are going to maintain our applications.
The `Data Mapper` approach helps with maintainability, which is more effective in bigger apps.
The `Active record` approach helps keep things simple which works well in smaller apps.
And simplicity is always a key to better maintainability.
6 changes: 6 additions & 0 deletions docs/connection-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ See [SSL options](https://github.com/mysqljs/mysql#ssl-options).

* `uuidExtension` - The Postgres extension to use when generating UUIDs. Defaults to `uuid-ossp`. Can be changed to `pgcrypto` if the `uuid-ossp` extension is unavailable.

* `poolErrorHandler` - A function that get's called when underlying pool emits `'error'` event. Takes single parameter (error instance) and defaults to logging with `warn` level.

## `sqlite` connection options

* `database` - Database path. For example "./mydb.sql"
Expand Down Expand Up @@ -258,6 +260,8 @@ See [SSL options](https://github.com/mysqljs/mysql#ssl-options).
* `pool.idleTimeoutMillis` - the minimum amount of time that an object may sit idle in the pool before it is eligible for
eviction due to idle time. Supersedes `softIdleTimeoutMillis`. Default: `30000`.

* `pool.errorHandler` - A function that get's called when underlying pool emits `'error'` event. Takes single parameter (error instance) and defaults to logging with `warn` level.

* `options.fallbackToDefaultDb` - By default, if the database requestion by `options.database` cannot be accessed, the connection
will fail with an error. However, if `options.fallbackToDefaultDb` is set to `true`, then the user's default database will
be used instead (Default: `false`).
Expand Down Expand Up @@ -461,6 +465,8 @@ See [SSL options](https://github.com/mysqljs/mysql#ssl-options).

* `database`: The raw UInt8Array database that should be imported.

* `sqlJsConfig`: Optional initialize config for sql.js.

* `autoSave`: Whether or not autoSave should be disabled. If set to true the database will be saved to the given file location (Node.js) or LocalStorage element (browser) when a change happens and `location` is specified. Otherwise `autoSaveCallback` can be used.

* `autoSaveCallback`: A function that get's called when changes to the database are made and `autoSave` is enabled. The function gets a `UInt8Array` that represents the database.
Expand Down
50 changes: 48 additions & 2 deletions docs/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ or
`bit`, `int`, `integer`, `tinyint`, `smallint`, `mediumint`, `bigint`, `float`, `double`,
`double precision`, `dec`, `decimal`, `numeric`, `fixed`, `bool`, `boolean`, `date`, `datetime`,
`timestamp`, `time`, `year`, `char`, `nchar`, `national char`, `varchar`, `nvarchar`, `national varchar`,
`text`, `tinytext`, `mediumtext`, `blob`, `longtext`, `tinyblob`, `mediumblob`, `longblob`, `enum`,
`text`, `tinytext`, `mediumtext`, `blob`, `longtext`, `tinyblob`, `mediumblob`, `longblob`, `enum`, `set`,
`json`, `binary`, `varbinary`, `geometry`, `point`, `linestring`, `polygon`, `multipoint`, `multilinestring`,
`multipolygon`, `geometrycollection`

Expand All @@ -307,7 +307,7 @@ or
`date`, `time`, `time without time zone`, `time with time zone`, `interval`, `bool`, `boolean`,
`enum`, `point`, `line`, `lseg`, `box`, `path`, `polygon`, `circle`, `cidr`, `inet`, `macaddr`,
`tsvector`, `tsquery`, `uuid`, `xml`, `json`, `jsonb`, `int4range`, `int8range`, `numrange`,
`tsrange`, `tstzrange`, `daterange`, `geometry`, `geography`
`tsrange`, `tstzrange`, `daterange`, `geometry`, `geography`, `cube`

### Column types for `cockroachdb`

Expand Down Expand Up @@ -390,6 +390,52 @@ export class User {
}
```

### `set` column type

`set` column type is supported by `mariadb` and `mysql`. There are various possible column definitions:

Using typescript enums:
```typescript
export enum UserRole {
ADMIN = "admin",
EDITOR = "editor",
GHOST = "ghost"
}

@Entity()
export class User {

@PrimaryGeneratedColumn()
id: number;

@Column({
type: "set",
enum: UserRole,
default: [UserRole.GHOST, UserRole.EDITOR]
})
roles: UserRole[]

}
```

Using array with `set` values:
```typescript
export type UserRoleType = "admin" | "editor" | "ghost",

@Entity()
export class User {

@PrimaryGeneratedColumn()
id: number;

@Column({
type: "set",
enum: ["admin", "editor", "ghost"],
default: ["ghost", "editor"]
})
roles: UserRoleType[]
}
```

### `simple-array` column type

Expand Down
2 changes: 1 addition & 1 deletion docs/example-with-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ createConnection().then(connection => {
});

app.delete("/users/:id", async function(req: Request, res: Response) {
const results = await userRepository.remove(req.params.id);
const results = await userRepository.delete(req.params.id);
return res.send(results);
});

Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ join column / junction table settings, like join column name or junction table n
It's not possible to add extra columns into a table created by a many-to-many relation.
You'll need to create a separate entity and bind it using two many-to-one relations with the target entities
(the effect will be same as creating a many-to-many table),
and add extra columns in there.
and add extra columns in there. You can read more about this in [Many-to-Many relations](./many-to-many-relations.md#many-to-many-relations-with-custom-properties).

## How to use TypeORM with a dependency injection tool?

Expand Down
47 changes: 47 additions & 0 deletions docs/many-to-many-relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,50 @@ const categoriesWithQuestions = await connection
.leftJoinAndSelect("category.questions", "question")
.getMany();
```

## many-to-many relations with custom properties

In case you need to have additional properties to your many-to-many relationship you have to create a new entity yourself.
For example if you would like entities `Post` and `Category` to have a many-to-many relationship with a `createdAt` property
associated to it you have to create entity `PostToCategory` like the following:

```typescript
import { Entity, Column, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Post } from "./post";
import { Category } from "./category";

@Entity()
export class PostToCategory {
@PrimaryGeneratedColumn()
public postToCategoryId!: number;

@Column()
public postId!: number;

@Column()
public categoryId!: number;

@Column()
public order!: number;

@ManyToOne(type => Post, post => post.postToCategories)
public post!: Post;

@ManyToOne(type => Category, category => category.postToCategories)
public category!: Category;
}
```

Additionally you will have to add a relationship like the following to `Post` and `Category`:

```typescript
// category.ts
...
@OneToMany((type) => PostToCategory, (postToCategory) => postToCategory.category)
public postToCategories!: PostToCategory[];

// post.ts
...
@OneToMany((type) => PostToCategory, (postToCategory) => postToCategory.post)
public postToCategories!: PostToCategory[];
```
2 changes: 1 addition & 1 deletion docs/many-to-one-one-to-many-relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class User {
Here we added `@OneToMany` to the `photos` property and specified the target relation type to be `Photo`.
You can omit `@JoinColumn` in a `@ManyToOne` / `@OneToMany` relation.
`@OneToMany` cannot exist without `@ManyToOne`.
If you want to use `@OneToMany`, `@ManyToOne` is required.
If you want to use `@OneToMany`, `@ManyToOne` is required. However, the inverse is not required: If you only care about the `@ManyToOne` relationship, you can define it without having `@OneToMany` on the related entity.
Where you set `@ManyToOne` - its related entity will have "relation id" and foreign key.

This example will produce following tables:
Expand Down
2 changes: 1 addition & 1 deletion docs/relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ You can also change the name of the generated "junction" table.
```typescript
@ManyToMany(type => Category)
@JoinTable({
name: "question_categories" // table name for the junction table of this relation
name: "question_categories", // table name for the junction table of this relation
joinColumn: {
name: "question",
referencedColumnName: "id"
Expand Down
2 changes: 1 addition & 1 deletion docs/select-query-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Which will produce:
SELECT ... FROM users user WHERE user.name = 'Timber'
```

You can add `AND` into an exist `WHERE` expression:
You can add `AND` into an existing `WHERE` expression:

```typescript
createQueryBuilder("user")
Expand Down
2 changes: 1 addition & 1 deletion docs/separating-entity-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const CategoryEntity = new EntitySchema<Category>({
});
```

Be sure to add the `extended` columns also to the `Categeory` interface (e.g., via `export interface Category extend BaseEntity`).
Be sure to add the `extended` columns also to the `Category` interface (e.g., via `export interface Category extend BaseEntity`).

## Using Schemas to Query / Insert Data

Expand Down
2 changes: 1 addition & 1 deletion docs/supported-platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TypeORM is able to on React Native apps using the [react-native-sqlite-storage](

## Expo

TypeORM is able to run on Expo apps using the [Expo SQLite API](https://docs.expo.io/versions/latest/sdk/sqlite.html). For an example how to use TypeORM in Expo see [typeorm/react-native-example](https://github.com/typeorm/react-native-example).
TypeORM is able to run on Expo apps using the [Expo SQLite API](https://docs.expo.io/versions/latest/sdk/sqlite/). For an example how to use TypeORM in Expo see [typeorm/expo-example](https://github.com/typeorm/expo-example).

## NativeScript

Expand Down
4 changes: 2 additions & 2 deletions docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Examples:
```typescript
import {getConnection} from "typeorm";

await getConnection().transaction(transactionalEntityManager => {
await getConnection().transaction(async transactionalEntityManager => {

});
```
Expand All @@ -23,7 +23,7 @@ or
```typescript
import {getManager} from "typeorm";

await getManager().transaction(transactionalEntityManager => {
await getManager().transaction(async transactionalEntityManager => {

});
```
Expand Down
16 changes: 16 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Troubleshooting

* [Glob patterns](#glob-patterns)

## Glob Patterns

Glob patterns are used in the TypeOrm to specify the locations of entities, migrations, subscriber and other information. Errors in the patterns can lead to the common `RepositoryNotFoundError` and familiar errors. In order to check if any files were loaded by TypeOrm using the glob patterns, all you need to do is set the logging level to `info` such as explained in the [Logging](./logging.md) section of the documentation. This will allow you to have logs in the console that may look like this:

```bash
# in case of an error
INFO: No classes were found using the provided glob pattern: "dist/**/*.entity{.ts}"
```
```bash
# when files are found
INFO: All classes found using provided glob pattern "dist/**/*.entity{.js,.ts}" : "dist/app/user/user.entity.js | dist/app/common/common.entity.js"
```
4 changes: 2 additions & 2 deletions docs/using-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* [Create a new entity](#create-a-new-entity)
* [Create a new subscriber](#create-a-new-subscriber)
* [Create a new migration](#create-a-new-migration)
* [Generate a migration from exist table schema](#generate-a-migration-from-exist-table-schema)
* [Generate a migration from existing table schema](#generate-a-migration-from-exist-table-schema)
* [Run migrations](#run-migrations)
* [Revert migrations](#revert-migrations)
* [Show migrations](#show-migrations)
Expand Down Expand Up @@ -196,7 +196,7 @@ typeorm migration:create -n UserMigration -d src/user/migration

Learn more about [Migrations](./migrations.md).

## Generate a migration from exist table schema
## Generate a migration from existing table schema

Automatic migration generation creates a new migration file
and writes all sql queries that must be executed to update the database.
Expand Down
4 changes: 2 additions & 2 deletions docs/using-ormconfig.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ormconfig.json
# Using Configuration Sources

- [Creating a new connection from the configuration file](#creating-a-new-connection-from-the-configuration-file)
- [Using `ormconfig.json`](#using-ormconfigjson)
Expand Down Expand Up @@ -96,7 +96,7 @@ TYPEORM_DATABASE = test
TYPEORM_PORT = 3000
TYPEORM_SYNCHRONIZE = true
TYPEORM_LOGGING = true
TYPEORM_ENTITIES = entity/.*js,modules/**/entity/.*js
TYPEORM_ENTITIES = entity/*.js,modules/**/entity/*.js
```

List of available env variables you can set:
Expand Down
2 changes: 2 additions & 0 deletions docs/zh_CN/connection-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@

- `database`: 应导入的原始 UInt8Array 数据库。

- `sqlJsConfig`: sql.js可选启动配置

- `autoSave`: 是否应禁用 autoSave。如果设置为 true,则在发生更改并指定`location`时,数据库将保存到给定的文件位置(Node.js)或 LocalStorage(浏览器)。否则可以使用`autoSaveCallback`

- `autoSaveCallback`: 在对数据库进行更改并启用`autoSave`时调用的函数。该函数获取表示数据库的`UInt8Array`
Expand Down
Loading

0 comments on commit c0c8dff

Please sign in to comment.