1.6.0 • Published 5 months ago

@rafikidota/serpens v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

TypeORM Snake Naming Strategy

Sometimes, the best way to solve your own problems is to help someone else.

Using Snake Naming Strategy with TypeORM

The following TypeScript code snippet illustrates an example of using this library with TypeORM.

import { DataSource } from 'typeorm';
import { DataSourceOptions } from 'typeorm';
import { SnakeNamingStrategy } from '@rafikidota/serpens';

const config: DataSourceOptions = {
    type: 'postgres',
    host: 'localhost',
    port: 5432,
    database: 'postgres',
    username: 'postgres',
    password: 'postgres',
    entities: [__dirname + '/**/*.entity{.ts,.js}'],
    migrations: [__dirname + '/migrations/*{.ts,.js}'],
    synchronize: false,
    namingStrategy: new SnakeNamingStrategy(),
};

export default new DataSource(config);

Prerequisites

Before using this library, ensure you have the following:

  • TypeORM configured
  • Necessary dependencies installed

Additional Resources

1.6.0

5 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.0

6 months ago

1.2.0

6 months ago

1.1.0

6 months ago

1.0.0

9 months ago