Geography type added in postgres driver. (#232)

Geography type added in postgres driver.
This commit is contained in:
Kononnable 2019-12-15 22:56:29 +01:00 committed by GitHub
commit 10fddf1b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 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

@ -30,7 +30,8 @@ export default class PostgresDriver extends AbstractDriver {
TABLE_NAME: string;
DB_NAME: string;
}[] = (await this.Connection.query(
`SELECT table_schema as "TABLE_SCHEMA",table_name as "TABLE_NAME", table_catalog as "DB_NAME" FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND table_schema in (${schema}) `
`SELECT table_schema as "TABLE_SCHEMA",table_name as "TABLE_NAME", table_catalog as "DB_NAME" FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE' AND table_schema in (${schema}) AND table_name<>'spatial_ref_sys'`
)).rows;
return response;
};
@ -370,6 +371,7 @@ WHERE "n"."nspname" = table_schema AND "t"."typname"=udt_name
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;
}