typeorm: Data type "geometry" is not supported by "postgres" database.`
Issue type:
[ ] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[ ] latest
[x] @next
[ ] 0.x.x (or put your version here)
Steps to reproduce or a small repository showing the problem:
@Entity()
export class Event {
@Column() name: string;
// @ts-ignore (otherwise I get type warning)
@Column("geometry", { nullable: true })
location: string;
}
Expected outcome: Create the postgres table with a geometry column
Actual outcome: DataTypeNotSupportedError: Data type "geometry" in "Event.location" is not supported by "postgres" database.
Seems like the latest version of PostgresDriver.ts isn’t in typeorm@next, or latest one as well.
@Entity()
export class Event extends BaseTable {
@Column() name: string;
@Column("point", { nullable: true })
location: string;
}
This seems to work, but documentation says geometry should work as well.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 15 (4 by maintainers)
We are using
in 0.2.9 and everything is fine. I think this is already resolved.
@AlexMesser at some point we’ll need to add detailed docs on each data type we have and examples on how to use them
Just pass json structure as postgres require:
Check our tests https://github.com/typeorm/typeorm/tree/master/test/functional/spatial/postgres
i try this:
and a got an error:
inside query log of typeorm :
otherwise using this aprouch everything works fine:
i change type to point.
I have a Geography column, but how do I insert data into it?
Any update with the docs @pleerock . Its only been a year 😅
You might want to check https://www.npmjs.com/package/@types/geojson type as it’s compatible with postgis, so it might be helpful to manage your data