* 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
* Skip tests that don't work on Windows
* Bring back tests on Windows
* Skip the test on all platforms exept Windows
* Make the test run only on Windows
* Add simple winodws test
* fix cli test on Windows
* let's see if this test passes on linux
* limit test to Windows and run format
* Add withPlatform test helper
* Mock platform in file path tests using withPlatform()
* Fix test: relative paths should not change on non-win32 platforms
* Lowercase relative path on non-win32 platform
* test: add better-sqlite3 and sqlite for Windows tests
---------
Co-authored-by: Simon Garner <simon@equalogic.com>
Fixes#11246
To mitigate timezone discrepancies with timestamps in tests with hard coded assertions, standardize on UTC
Co-authored-by: Mike Guida <mike@mguida.com>
* docs: add "How to use Vite for the backend" entry to faq
* Apply suggestions from code review
docs: apply suggested grammar and spelling changes
Co-authored-by: Mike Guida <mike@mguida.com>
* Apply suggestions from code review
docs: add link to vite documentation
Co-authored-by: Mike Guida <mike@mguida.com>
---------
Co-authored-by: Mike Guida <mike@mguida.com>