{"id":26229687,"url":"https://github.com/cheplv/typeorm-orderable","last_synced_at":"2026-03-04T02:02:33.872Z","repository":{"id":264076440,"uuid":"892271694","full_name":"cheplv/typeorm-orderable","owner":"cheplv","description":"Typeorm decorators to make columns orderable on table sql generation","archived":false,"fork":false,"pushed_at":"2025-11-22T11:34:56.000Z","size":556,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-22T13:10:12.888Z","etag":null,"topics":["columns","ordering","typeorm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheplv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-21T20:03:51.000Z","updated_at":"2025-11-22T11:28:58.000Z","dependencies_parsed_at":"2025-04-20T14:46:40.466Z","dependency_job_id":null,"html_url":"https://github.com/cheplv/typeorm-orderable","commit_stats":null,"previous_names":["cheplv/typeorm-orderable"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/cheplv/typeorm-orderable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheplv%2Ftypeorm-orderable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheplv%2Ftypeorm-orderable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheplv%2Ftypeorm-orderable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheplv%2Ftypeorm-orderable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheplv","download_url":"https://codeload.github.com/cheplv/typeorm-orderable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheplv%2Ftypeorm-orderable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30069229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["columns","ordering","typeorm"],"created_at":"2025-03-12T22:17:30.271Z","updated_at":"2026-03-04T02:02:33.857Z","avatar_url":"https://github.com/cheplv.png","language":"TypeScript","readme":"# TypeORM Decorators to provide field ordering in development and generation of migrations\n\nThis package solves problem with TypeORM column ordering - take a look:\n- [Allow to order columns #541](https://github.com/typeorm/typeorm/issues/541)\n- [Set column position/order in addColumn](https://github.com/typeorm/typeorm/issues/6167)\n\n\n![GitHub](https://img.shields.io/github/license/cheplv/typeorm-orderable?style=flat)\n![Build](https://github.com/cheplv/typeorm-orderable/actions/workflows/main.yaml/badge.svg)\n![NPMJS](https://github.com/cheplv/typeorm-orderable/actions/workflows/publish.yaml/badge.svg)\n\n\n## Usage\n\n1. Run `npm i typeorm-orderable`\n2. Add decorators to your classes\n\nWith TypeORM your models look like this:\n\n```typescript\nimport { Entity, PrimaryGeneratedColumn, Column, BaseEntity } from \"typeorm\"\nimport { Orderable, Order } from \"typeorm-orderable\"\nimport { instanceToPlain, Exclude } from 'class-transformer';\nimport { createId } from '@paralleldrive/cuid2';\n\n@Orderable()\nexport class EntityHelper extends BaseEntity {\n  @Column()\n  @Order({ priority: -1 })\n  _id: string = createId();\n\n  @Exclude()\n  __entity?: string;\n\n  @AfterLoad()\n  setEntityName() {\n    this.__entity = this.constructor.name;\n  }\n\n  getEntityName() {\n    return this.__entity;\n  }\n\n\n  @CreateDateColumn()\n  @Order({ priority: 100 })\n  createdAt: Date;\n\n  @UpdateDateColumn()\n  @Order({ priority: 101 })\n  updatedAt?: Date;\n\n  @DeleteDateColumn()\n  @Order({ priority: 102 })\n  @Exclude()\n  deletedAt?: Date;\n}\n\n@Entity('examples')\n@Orderable()\nexport class Example extends EntityHelper {\n    @PrimaryGeneratedColumn()\n    id: number\n\n    @Column()\n    firstName: string\n\n    @Column()\n    lastName: string\n\n    @Column()\n    age: number\n}\n```\n\n4. Your fields sequence in table 'example' will look like\n\n_id, id, first_name, last_name, age, created_at, updated_at, deleted_at\n\n5. optionally @Order directive supports \"before\" and \"after\" options with name of column in option property\n\n## To be done\n\n- Define guidelines for testing\n\n## License\n\nThis project is licensed under the [MIT](https://github.com/cheplv/typeorm-orderable/blob/master/LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheplv%2Ftypeorm-orderable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheplv%2Ftypeorm-orderable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheplv%2Ftypeorm-orderable/lists"}