FG
๐Ÿ—„๏ธ Databases

0.4.0 release TODOs

Freshabout 20 hours ago
Mar 14, 20260 views
Confidence Score95%
95%

Problem

I'm going to keep writing here features and changes I'm planning to introduce in 0.4.0: - [x] (breaking) instead of named connections as they are right now, make it possible to write connections, managers and repositories into exported variables, e.g. `const connection1 = createConnection(); const connection2 = createConnection();`, `const manager1 = connection1.manager; const manager2 = connection2.manager;`, etc. - [ ] (breaking) we need to change some names in the project to make things more clear. `Connection` should be renamed to `Storage` and `QueryBuilder` should be renamed to `Connection`. - [x] (breaking) remove transaction decorator ? - [x] (breaking) remove custom repository functionality? - [ ] (breaking) deprecate eager and lazy loading? - [x] (breaking) re-work current configuration loading and ormconfig file concept - [ ] re-work entity schemas and make them "primary way of defining a database schema model" - [ ] re-work QueryBuilder concept - [ ] make subset of changes regarding to how joins are used right now to implement entity streaming - [ ] provide a tutorial on how it can be easy to integrate typeorm and graphql - [ ] check if typeorm can be used with knex and provide a tutorial if possible - [ ] transpile it to es6 and support only node 10 to improve performance and make it easier to debug typeorm-based apps - [ ] add flag in find options to log query per-find-call - [ ] remove some magic methods from QueryBuilder (like joinAndMap) - [ ] add `saveAndRe

Unverified for your environment

Select your OS to check compatibility.

2 Fixes

Canonical Fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Implement 0.4.0 Release Features and Changes

Medium Risk

The current version of the project has outdated naming conventions and functionality that does not align with modern development practices, leading to confusion and inefficiencies in the codebase.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Rename Connection to Storage and QueryBuilder to Connection

    Update all instances of 'Connection' to 'Storage' and 'QueryBuilder' to 'Connection' throughout the codebase to improve clarity.

    bash
    git grep 'Connection' | xargs sed -i 's/Connection/Storage/g',git grep 'QueryBuilder' | xargs sed -i 's/QueryBuilder/Connection/g'
  2. 2

    Deprecate Eager and Lazy Loading

    Implement deprecation warnings for eager and lazy loading features to inform users of the upcoming removal in future releases.

    typescript
    console.warn('Eager and lazy loading will be deprecated in future releases. Please update your code accordingly.');
  3. 3

    Re-work Entity Schemas

    Refactor the entity schema definitions to make them the primary way of defining database schema models, ensuring that they are intuitive and easy to use.

    typescript
    export class User { @PrimaryGeneratedColumn() id: number; @Column() name: string; }
  4. 4

    Transpile to ES6 and Support Only Node 10

    Update the build process to transpile the code to ES6 and set Node 10 as the minimum supported version to enhance performance and debugging capabilities.

    bash
    tsc --target ES6 --module commonjs
  5. 5

    Add Logging Flag in Find Options

    Introduce a flag in the find options to log queries on a per-find-call basis, aiding in debugging and performance monitoring.

    typescript
    const options = { logQueries: true };

Validation

To confirm the fix worked, run the unit tests to ensure all renamed components function correctly and check the deprecation warnings in the console. Additionally, verify that the new entity schema definitions work as intended and that the transpilation process completes without errors.

Sign in to verify this fix

1 low-confidence fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Implement Changes for 0.4.0 Release

High Risk

The current implementation of TypeORM has several naming conventions and architectural decisions that are causing confusion among users. Renaming key components and reworking certain functionalities will improve clarity and usability, but these changes are breaking and require careful implementation.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Rename Connection to Storage

    Update all instances of 'Connection' in the codebase to 'Storage' to enhance clarity. This includes updating class names, variable names, and any related documentation.

    typescript
    class Storage { ... }
  2. 2

    Rename QueryBuilder to Connection

    Change all references of 'QueryBuilder' to 'Connection' to reflect the new naming convention. Ensure that all related methods and properties are also updated accordingly.

    typescript
    class Connection { ... }
  3. 3

    Deprecate Eager and Lazy Loading

    Introduce a deprecation warning for eager and lazy loading features. Update the documentation to inform users about the upcoming removal in future versions.

    typescript
    console.warn('Eager and lazy loading will be deprecated in future versions.');
  4. 4

    Rework Entity Schemas

    Revise the entity schema definition process to make it the primary way of defining database models. This may involve creating new classes or interfaces that encapsulate schema definitions.

    typescript
    class UserSchema { ... }
  5. 5

    Transpile to ES6 and Support Node 10

    Update the build process to transpile the code to ES6 and ensure compatibility with Node.js version 10. This will improve performance and debugging capabilities.

    bash
    tsc --target ES6 --module commonjs
  6. 6

    Add Logging Flag in Find Options

    Implement a flag in the find options to enable logging of queries per find call. This will help users debug and optimize their queries more effectively.

    typescript
    find({ where: { ... }, logging: true });

Validation

To confirm the fix worked, run the unit tests for renamed classes and methods to ensure they pass. Additionally, verify that the deprecation warnings appear where expected and that the new entity schema definitions function correctly. Finally, check that the transpiled code runs without issues on Node.js version 10.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

typeormormtypescriptnew-featurestale