{"id":24773051,"url":"https://github.com/re-quant/typeorm-postgres-camelcase-naming-strategy","last_synced_at":"2025-10-11T22:30:28.856Z","repository":{"id":44004249,"uuid":"237862401","full_name":"Re-Quant/typeorm-postgres-camelcase-naming-strategy","owner":"Re-Quant","description":"Pascal/Camel Case naming for everything in the PostgreSQL","archived":false,"fork":false,"pushed_at":"2023-01-06T02:29:58.000Z","size":712,"stargazers_count":4,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-10T06:13:49.585Z","etag":null,"topics":["naming-strategies","postgres","postgresql","typeorm","typeorm-naming","typeorm-plugin","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Re-Quant.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}},"created_at":"2020-02-03T01:14:14.000Z","updated_at":"2024-04-12T02:22:27.000Z","dependencies_parsed_at":"2023-02-05T03:00:41.282Z","dependency_job_id":null,"html_url":"https://github.com/Re-Quant/typeorm-postgres-camelcase-naming-strategy","commit_stats":null,"previous_names":["z-brain/typeorm-postgres-naming-strategy","re-quant/typeorm-postgres-camelcase-naming-strategy","z-brain/typeorm-postgres-camelcase-naming-strategy"],"tags_count":18,"template":false,"template_full_name":"korniychuk/wallaby-ts-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Re-Quant%2Ftypeorm-postgres-camelcase-naming-strategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Re-Quant%2Ftypeorm-postgres-camelcase-naming-strategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Re-Quant%2Ftypeorm-postgres-camelcase-naming-strategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Re-Quant%2Ftypeorm-postgres-camelcase-naming-strategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Re-Quant","download_url":"https://codeload.github.com/Re-Quant/typeorm-postgres-camelcase-naming-strategy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236130949,"owners_count":19099709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["naming-strategies","postgres","postgresql","typeorm","typeorm-naming","typeorm-plugin","typescript"],"created_at":"2025-01-29T04:35:40.134Z","updated_at":"2025-10-11T22:30:23.413Z","avatar_url":"https://github.com/Re-Quant.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Z-Brain TypeORM PostgreSQL Camelcase Naming Strategy\n\n\u003cp\u003e\n  \u003ca target=\"_blank\" href=\"https://github.com/z-brain/typeorm-postgres-camelcase-naming-strategy/actions?query=workflow%3A%22Build%22\"\u003e\n    \u003cimg alt=\"Build status\" src=\"https://github.com/z-brain/typeorm-postgres-camelcase-naming-strategy/workflows/Build/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@z-brain/typeorm-postgres-camelcase-naming-strategy\"\u003e\n    \u003cimg alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@z-brain/typeorm-postgres-camelcase-naming-strategy.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca target=\"_blank\" href=\"https://www.gnu.org/licenses/gpl-3.0\"\u003e\n    \u003cimg alt=\"License: GPL v3\" src=\"https://img.shields.io/badge/License-GPLv3-blue.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\nPascal/Camel Case naming for everything in the PostgreSQL\n\n*Notice: If you have any propositions feel free to make an issue or create a pull request.*\n\n## Features\n\n* All constraint names appended with 8-char hash for uniqueness. Example: `eed18e0e`\n* All names trimmed to 63 bytes including 8-char hash if the name is too long (in most cases length === bytes number, however not always).\n* There is an ability to have some suffixes to entity classes and omit these suffixes in the DB table names.  \n  Example: `PublicTradeEntity` -\u003e `PublicTrades` (default entity suffix is `Entity`)\n* There is an ability to have some in-db suffixes on entity classes that should not be pluralized and should be added as is to the DB table names.  \n  Example: `PublicTradeZipEntity` -\u003e `PublicTradesZip` (default in-db suffix is `Zip`)\n\nNaming entity       | Case                                                  | Examples\n--------------------|-------------------------------------------------------|--------\nTable               | `PascalCase`                                          | `Users`, `MySuperTable`\nColumn              | `CamelCase`                                           | `id`, `mySuperColumn`\nEnum                | (not supported by TypeORM yet)                        |\nPrimary Key         | `PK_{table}_{cols}_{hash}`                            | `PK_Instruments_id_bd441074`, `PK_MySuperTable_email,pwdHash_d1d1d1d1`\nUnique Constrain    | `UQ_{table}_{cols}_{hash}`                            | `UQ_Instruments_code_051d8d38`, `UQ_MySuperTable_firstName,lastName_d1d1d1d1`\nDefault Constrain   | `DF_{table}_{col}_{hash}`                             | `DF_Users_email_d1d1d1d1`, `DF_MySuperTable_firstName_d1d1d1d1`\nRelation Constrain  | `REL_{table}_{cols}_{where}_{hash}`                   | TODO example\nCheck Constrain     | `CHK_{table}_{expression}_{hash}`                     | TODO example\nExclusion Constrain | `XCL_{table}_{expression}_{hash}`                     | TODO example\nForeign Key         | `FK_{table}_{targetTable}_{cols}_{targetCols}_{hash}` | `FK_TradingPairs_Instruments_quotedInstrumentId_id_fc68de3f`\nIndex               | `IDX_{table}_{cols}_{hash}`                           | `IDX_Tickers_exchangeId,symbol_c8090854`\nUnique Index        | `UQIDX_{table}_{cols}_{hash}`                         | `UQIDX_Tickers_exchangeId,symbol_c8090854`\n\n## How to use\n\n### Installing\n\n`yarn add @z-brain/typeorm-postgres-camelcase-naming-strategy`  \nor  \n`npm i -s @z-brain/typeorm-postgres-camelcase-naming-strategy`\n\n### Configuring\n\n`/ormconfig.ts`\n```typescript\nimport { TypeORMPostgresCamelCaseNamingStrategy } from '@z-brain/typeorm-postgres-camelcase-naming-strategy';\n\n// Store an instance separately for reuse methods in you app\nexport const typeORMNamingStrategy = new TypeORMPostgresCamelCaseNamingStrategy();\n\n// TypeORM connection config for PostgreSQL\nexport const defaultConnection: ConnectionOptions = {\n  // ...\n  namingStrategy: typeORMNamingStrategy,\n};\n\nmodule.exports = [defaultConnection];\n```\n\n## Development notes\n\n### Quick Start\n\n```bash\ncd /code/z-brain\ngit clone git@github.com:z-brain/typeorm-postgres-camelcase-naming-strategy.git\ncd typeorm-postgres-camelcase-naming-strategy\nyarn install\n```\n\n### How to use NodeJS version from the `.nvmrc`\n\n1. Install NVM\n2. Use `.nvmrc` file one of the next ways:\n\n    * Execute `nvm use` in the project root directory\n    * Install [NVM Loader](https://github.com/korniychuk/ankor-shell) and your .nvmrc will be loaded automatically when you open the terminal.\n      ![NVM Loader demo](./resources/readme.nvm-loader.png)\n\n### How to make a build\n\n`npm run build`\n\n### How to run lint\n\n* Just show problems `npm run lint`\n* Fix problems if it is possible `npm run lint:fix`\n\n### How to run tests\n\n* All tests\n\n  `npm run test`  \n  `npm run test:watch`\n* Specific tests\n\n  `npm run test -- src/my.spec.ts`  \n  `npm run test:watch -- src/my.spec.ts`\n\n### How to build and publish NPM package\n\n*NPM Token:* `367a...ce73`\n\nCI configuration details here: [.github/workflows/npmpublish.yml](.github/workflows/npmpublish.yml)\n\n```bash\nyarn run pre-push \\\n\u0026\u0026 npm version patch -m 'Update package version version to %s' \\\n\u0026\u0026 yarn run gen-public-package.json \\\n\u0026\u0026 cp README.md dist/ \\\n\u0026\u0026 npm publish dist --access public \\\n\u0026\u0026 git push --no-verify \u0026\u0026 git push --tags --no-verify\n```\n\n## Author\n\n| [\u003cimg src=\"https://www.korniychuk.pro/avatar.jpg\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eAnton Korniychuk\u003c/sub\u003e](https://korniychuk.pro) |\n| :---: |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fre-quant%2Ftypeorm-postgres-camelcase-naming-strategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fre-quant%2Ftypeorm-postgres-camelcase-naming-strategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fre-quant%2Ftypeorm-postgres-camelcase-naming-strategy/lists"}