(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import { NamingStrategyInterface, DefaultNamingStrategy } from 'typeorm' | |
import { snakeCase } from 'typeorm/util/StringUtils' | |
export class SnakeNamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface { | |
tableName(className: string, customName: string): string { | |
return customName ? customName : snakeCase(className) | |
} | |
columnName(propertyName: string, customName: string, embeddedPrefixes: string[]): string { | |
return snakeCase(embeddedPrefixes.join('_')) + (customName ? customName : snakeCase(propertyName)) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.