# Naming strategy
- Specify custom table name
- Specify custom column name
- Specify custom foreign column name
- Specify custom many-to-many junction table name
- Creating your own
NamingStrategy
# Creating your own NamingStrategy
If you defined your connection options in the ormconfig
file,
then you can simply use it and override it following way:
import {createConnection, getConnectionOptions} from "typeorm";
import {MyNamingStrategy} from "./logger/MyNamingStrategy";
// getConnectionOptions will read options from your ormconfig file
// and return it in connectionOptions object
// then you can simply append additional properties to it
getConnectionOptions().then(connectionOptions => {
return createConnection(Object.assign(connectionOptions, {
namingStrategy: new MyNamingStrategy()
}))
});
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Naming Strategy is a subject to change. Expect detailed documentation once its API gets stabilized.