Code Monkey home page Code Monkey logo

Comments (4)

MichalLytek avatar MichalLytek commented on May 16, 2024 1

It might be named @AutoIdColumn or sth meaningfull, it's just an alias and behave the same as @PrimaryColumn("int", { generated: true }) - it creates database column id | int(11) | PRIMARY KEY AUTO_INCREMENT 😉

Almost everyone use auto generated int primary key in databases and the @PrimaryColumn("int", { generated: true }) syntax repeated in every class doesn't look nice and it's a pain to code it every time.

from typeorm.

pleerock avatar pleerock commented on May 16, 2024

It should be easy to do and I think I might be able to do the PR but not know, I have to learn TypeORM better and build some app using it first

yes, sure its much more complicated codebase and requires time to learn it

It would be nice to have an alias @IdColumn for @PrimaryColumn("int", { generated: true })

But id column means that id will have an unique identifier, right? And it isnt necessary to be generated

from typeorm.

pleerock avatar pleerock commented on May 16, 2024

Almost everyone use auto generated int primary key in databases and the @PrimaryColumn("int", { generated: true }) syntax repeated in every class doesn't look nice and it's a pain to code it every time.

agree. But'll call it @GeneratedIdColumn to be more akin to generated in column options. implemented in b39e5ae

from typeorm.

MichalLytek avatar MichalLytek commented on May 16, 2024

Ok, great! Thanks! 😃

from typeorm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.