* Added a new SQL tagged template feature for executing raw SQL queries with automatic parameter handling.
---------
Co-authored-by: Simon Garner <simon@equalogic.com>
* fix: change how array columns are compared on column changed detection
Closes: #5967
* add tests with date array colum
* Normalize date arrays before comparing
* fix: prevent error when replication is undefined
* fix format
* add test
* update test name
* fix test
* fix test
* skip test
* add unit test
* fix unit test
* fix unit test
* fix: Build ESM migrations for JS
Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations
Closes: #10801
* fix: Fix the migration documentation
* Cleanup the types in the migrations
* Add the formatted sql console
* Add the formatSql to the logger
* Update src/logger/FormattedConsoleLogger.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Make names in test more consistent
* Add a sub query example
* Set the language to the sql formatter
* Import SqlLanguage as a type from sql-formatter
* Remove empty console log
* Remove console log
* Add the dataSourceType
* Remove js extension from import
* Use another package to format the SQL in the logging
Same package as we use to generate the migrations
* Not need to add all the spaces in the log
* Fix the expected formatted queries
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* perf(query-runner): use Date.now() intead of +new Date()
* perf: use Date.now() instead of new Date().getTime()
---------
Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
Co-authored-by: Mike Guida <mike@mguida.com>
* Added logging to the Entity Listener Metadata as it will throw an error (entity[this.propertyName] is not a function), which is not a descriptive error and makes it hard for users to debug their programs
* Bound the entity to the Entity Method
* Update src/metadata/EntityListenerMetadata.ts
---------
Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
Co-authored-by: Mike Guida <mike@mguida.com>
Add "enableQueryTimeout" option to MysqlConnectionOptions. When enabled the value of "maxQueryExecutionTime" will be passed to mysql driver as query timeout.
---------
Co-authored-by: Mike Guida <mike@mguida.com>
Remove unused `type` parameter from functions supplied to decorators in tests and sample code. This resolves 477 eslint unused var warnings.
All changes are modifying functions in test or sample code of the following style:
1. `@OneToMany((type) => Entity, ...)` to `@OneToMany(() => Entity)`
2. `@ManyToOne((type) => Entity, ...)`
3. `@ManyToMany((type) => Entity, ...)`
4. `@OneToOne((type) => Entity, ...) `
Note that we don't actually ever call this function with an argument.
Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations
fixes#10801
Co-authored-by: Mike Guida <mike@mguida.com>
* feat: add new foreign key decorator, and entity schemas options
This new feature adds the ability to create foreign key constraints without entity relations, using `@ForeignKey()` decorator or entity schema options.
Closes: #4569
* fix: resolve issues in insert query orUpdate method with postgres driver
This fix make use of table name alias in WHERE clause of onUpdate method with postgres driver to avoid throwing error
Closes: #11077
* test: update insert on conflict test
---------
Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
* fix: export * from `subscriber/event/QueryEvent`
Otherwise it's impossible to create a listener/subscriper that is using
the Before/After query event types
* docs: clarify that QueryEvent execution time result is in ms