Merged
Conversation
JSON body parser is now built-in by default (>4.16.0), hence no need for body-parser
Grammatical error
Example for querying subdocuments and array of subdocuments
* fix: properly override database url properties Closes #4878 * test: add test for overriding url options
* support cjs extension for ormconfig * fix linting errors * handle cjs extensions in class loader
…lDriver (#6237) fix: lint warning Co-authored-by: shitong.zheng <[email protected]>
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ns.md cascades link (#6406) * docs: one-to-one-relations.md cascades link * docs: many-to-one-one-to-many-relations.md cascades link
…d entities (#6402) Closes: #6399 Co-authored-by: Gregory Komagurov <[email protected]>
update type definition and schema transformer so that - like the decorator - the EntitySchema can define composite `JoinColumn` definitions Closes: #5444
ref #6389 Co-authored-by: Coroliov Oleg <[email protected]>
getPendingMigrations currently returns the executed migrations instead of the non-executed ones.
* feat: better-sqlite3 driver which is significantly faster than node-sqlite3 * test: added all tests for sqlite to better-sqlite3 * test: "query runner > drop column" modified compatible * docs: added better-sqlite3 related docs
* fix(aurora): pass formatOptions to Data API Client, fix UUID type support and all other extensions * fix(aurora): refactored the code to avoid duplication (#1) * fix(aurora): refactored the code to avoid duplication
… width (#6444) * fix: provide width to ColumnMetadataArgs for JoinTable @jointable does not respect inverseJoinColumns referenced column width Closes: #6442 * fix: address linting errors, replaced single quotes * fix: add await so that promises are resolved * fix: add connection close for migration connection
this bumps the version of typescript accepted to >=3.9.7,<4.0 we were implicitly pulling in that version (per the package-lock.json) so this just codifies it in the package.json as well
this test was emitting logs for no real reason so this removes the `logging: true` when creating the testing connection
* Update MysqlQueryRunner.ts
In Mariadb the extra information of a DDL is in upper case and in javascript String.indexOf() function is case sensitive, because of that when you generate a new migrations in mariadb it always create a line to update "onUpdate" lines.
example:
```sql
CREATE TABLE `test` (
`test_id` int(11) NOT NULL AUTO_INCREMENT,
`test_update` timestamp() NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`test_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
```
When you try to generate a new migration always create the next migration file:
```ts
import { MigrationInterface, QueryRunner } from 'typeorm';
export class test261600082802966 implements MigrationInterface {
name = 'test261600082802966';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE `test` CHANGE `test_update` `test_update` timestamp() NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()'
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE `test` CHANGE `test_update` `test_update` timestamp() NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE current_timestamp()'
);
}
}
```
Entity file test.ts
```ts
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@entity()
export class test extends BaseEntity {
@PrimaryGeneratedColumn({})
test_id: number;
@column({
type: 'timestamp',
default: () => 'CURRENT_TIMESTAMP()',
onUpdate: 'CURRENT_TIMESTAMP()',
nullable: false,
})
test_update: Date;
}
```
* Update MysqlQueryRunner.ts
* add test to issue 6714
* Update MysqlQueryRunner.ts
* Update issue-6714.ts
Co-authored-by: jesusegado <[email protected]>
* Update many-to-many-relations.md * Update many-to-many-relations.md Co-authored-by: Umed Khudoiberdiev <[email protected]>
) This feature for postgres connections means when you pass the logNotifications option, db notices and notifications will be passed to the logger with info log level Closes: #2216
currently we pull in BetterSqlite3Driver, SqliteDriver, and a few other drivers & files that aren't possible to use in a browser context. this change adds some more browser compatibility features so webpack builds targeted at browsers will be able to complete closes #6739
* fix: count() method for multiple primary keys for cockroachdb Cockroachdb does not support concat() for different types at the moment. To fix this problem, each primary key is cast to the text type. * fix: add doublequote * fix: add doublequote * test: update and move tests for count() method for multiple primary keys * fix: count() method for multiple primary keys for oracle Oracle does not support CONCAT() for more than 2 arguments at the moment. To solve this problem, operator || is used instead of CONCAT().
create a type to track ReplicationMode instead of writing out `"master"|"slave"` everywhere. update to drop the default from the QueryRunner constructor as they will always receive the mode from the driver when it's part of the QueryRunner also drop the default from Driver.createQueryRunner in the implementations - the interface mandates the mode to be defined so it will never be omitted anyway also drop the explict "master" from any connection.createQueryRunner calls so we leave it either the default or `slave` when needed all of this makes it easier to eventually migrate to other naming convetions for the replication mode should it be deemed the right path to go down
* stop using PromiseUtils.create & extractValue as they're doing nothing because we never use PromiseUtils.create, PromiseUtils.extract was technically never used either - the only case we were using this was in a test where we can replace it with Promise.resolve * stop using PromiseUtils.settle in test 1014 there was no reason to use this call in the test as it was not using the results and only used the `Promise.all` functionality * use Promise.all instead of PromiseUtils.runInSequence in tests in these cases of PromiseUtils.runInSequence in tests there was no need for us to be running them in sequence - so instead we could use Promise.all & Array.map for a replacement. removes the dependency on PromiseUtils & also speeds up our tests * run tests sequentially for those that deal with ActiveRecord because the activerecord mechanism creates a "global" scope through the class that ActiveRecord is applied to we have to run through the connections sequentially or end up with them being all over the place as far as what activerecord model is connected to what connection * use standard async/await + for/of instead of runInSequence in cases where actual order of the runs matter we can do for/of and then await any of the results - because none of the usages of runInSequence that rely on the correct order actually use the results * use Promise.all on runInSequence cases where order doesn't matter * drop PromiseUtils altogether * sequentially run when dealing with QueryRunner queryrunner is not 'thread-safe' or async safe * drop the test to lookup by Promise before, the test wasn't validating that you could lookup by promise the test was verifying that if you used something that wasn't a promise but instead had a magic __value__ variable you'd get a lookup that's not a promise, unfortunately I can't find that a promise may be passed into the find options anywhere in the documentation so I've removed this test
* fix: resolve issues ora-00972:identifier is too long Closes: #5067 * fix: ensure that this changes applies just for Oracle Driver Closes: #5067 * fix test - remove `.only` & set the `enabledDrivers` to oracle * simplify test case Co-authored-by: Murat Gundes <[email protected]>
the expected type of `port` in all drivers is a number - and in MSSQL this is a problem as the underlying driver does not properly handle a string port - so we have to parseInt closes #6781
* fix: enforce name argument of migration generate command enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: #2719, #4798, #4805 * fix: update error message text for generate migration command when missing name argument enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: #2719, #4798, #4805 Co-authored-by: Akosua Asante <[email protected]>
…6440) in the `ReturningResultsEntityUpdator` we have to check that the `entityId` we pull from the entity is actually there. if we don't we will create a where clause that's undefined - effectively querying for every record in the database and returning the wrong value
the test for #6442 was accidentally named `6642`
accidentally pulled over the entitiesDir instead - this fixes the subscribers generation command writing to the correct directory
Fixes an edge case where the wrong foreign key would be loaded when multiple databases exist with foreign keys that have the same name. Fixes #6168
bumps sql.js to 1.3.2 because 1.3.0 has a number of issues in the compiled versions of the package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
merge master