Merge branch 'master' into next

This commit is contained in:
Kononnable 2020-01-03 13:38:47 +01:00
commit b34555a1f1
5 changed files with 12 additions and 5 deletions

View File

@ -3,7 +3,8 @@
## Unreleased
* change default case conversions for generated files (#196)
* enum type safety #205
* enum type safety (#205)
* postgress geography type support (#232)
## 0.3.5

View File

@ -50,7 +50,7 @@ Options:
[default: "./output"]
-s, --schema Schema name to create model from. Only for mssql
and postgres. You can pass multiple values
separted by comma eg. -s scheme1,scheme2,scheme3
separated by comma eg. -s scheme1,scheme2,scheme3
--ssl [boolean] [default: false]
```
### Examples

View File

@ -390,6 +390,7 @@ export default class PostgresDriver extends AbstractDriver {
switch (udtName) {
case "citext":
case "hstore":
case "geography":
case "geometry":
ret.sqlType = udtName;
break;

View File

@ -186,4 +186,7 @@ export class Post {
@Column("daterange")
daterange: string;
@Column("geography")
geography: string;
}

View File

@ -1,7 +1,9 @@
import { ConnectionOptions, createConnection } from "typeorm";
import * as ts from "typescript";
import * as yn from "yn";
import IGenerationOptions, { getDefaultGenerationOptions } from "../../src/IGenerationOptions";
import IGenerationOptions, {
getDefaultGenerationOptions
} from "../../src/IGenerationOptions";
import IConnectionOptions from "../../src/IConnectionOptions";
import MssqlDriver from "../../src/drivers/MssqlDriver";
import MariaDbDriver from "../../src/drivers/MariaDbDriver";
@ -82,7 +84,7 @@ export async function createPostgresModels(
databaseType: "postgres",
schemaName: "public,sch1,sch2",
ssl: yn(process.env.POSTGRES_SSL, { default: false }),
skipTables: []
skipTables: ["spatial_ref_sys"]
};
await driver.ConnectToServer(connectionOptions);
connectionOptions.databaseName = String(process.env.POSTGRES_Database);
@ -310,7 +312,7 @@ export function compileTsFiles(
);
console.log(
`${diagnostic.file!.fileName} (${lineAndCharacter.line +
1},${lineAndCharacter.character + 1}): ${message}`
1},${lineAndCharacter.character + 1}): ${message}`
);
compiledWithoutErrors = false;
});