t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
551 stars 69 forks source link

Warnings: Converting field 'createdAt'/ 'updatedAt' of type timestamptz to TEXT #50

Closed musicformellons closed 7 years ago

musicformellons commented 7 years ago

Since I started using sequelizejs as ORM I (or sequelize...) added createdAt and updatedAt fields. When I start the server I suddenly get these warnings. Can I somehow get rid of these?

root@vps412437:/home/usr# t_rex serve --config osm.toml 
2017-07-14 21:47:00.297 INFO Reading configuration from 'osm.toml'
2017-07-14 21:47:00.334 WARN Layer 'datapoints': Converting field 'createdAt' of type timestamptz to TEXT
2017-07-14 21:47:00.334 WARN Layer 'datapoints': Converting field 'updatedAt' of type timestamptz to TEXT
2017-07-14 21:47:00.334 INFO Tile cache directory: /mnt/vdb/tmp/mvtcache
2017-07-14 21:47:00.337 WARN Layer 'datapoints': Converting field 'createdAt' of type timestamptz to TEXT
2017-07-14 21:47:00.337 WARN Layer 'datapoints': Converting field 'updatedAt' of type timestamptz to TEXT
2017-07-14 21:47:00.340 WARN Layer 'datapoints': Converting field 'createdAt' of type timestamptz to TEXT
2017-07-14 21:47:00.340 WARN Layer 'datapoints': Converting field 'updatedAt' of type timestamptz to TEXT
2017-07-14 21:47:00.341 WARN Layer 'datapoints': Converting field 'createdAt' of type timestamptz to TEXT
2017-07-14 21:47:00.341 WARN Layer 'datapoints': Converting field 'updatedAt' of type timestamptz to TEXT
Listening on http://127.0.0.1:1337
Ctrl-C to shutdown server
pka commented 7 years ago

According to the vector-tile-spec the following types are supported: string, float, double, int64, uint64, sint64, bool. This means that all PostgreSQL types other than Varchar, Text, CharArray, Float4, Float8, Int2, Int4, Int8, Bool have to be converted to one of these.

You can either change the type in the database or make an implicit type cast in the query. The genconfig command generates a template for the SQL query.

musicformellons commented 7 years ago

Ok, got it. Thanks.