Does not work with PostGIS?

Feature(s) impacted

Can’t save a row with a POINT column if the column is not empty.
The error message :

string violation: position cannot be an array or an object

Observed behavior

I can’t save anything in this table.

Expected behavior

I would expect that, at least, Forest would not modify the original data and that I could save if I don’t modify the POINT column.

I would also love to be able to set this POINT column manually, but I don’t think Smartfields can help me there as it would requires a Postgis function.

Ie, I would like the recalculate this POINT field if the field “adress” changes (using Mapbox) but I need to be able to run SQL method to convert to postgis types.

Context

Please provide in this mandatory section, the relevant information about your configuration:

  • Team name: lonestone
  • Environment name: dev
  • Agent type & version: SQL, via CLI, v8

Hi @PierrickB

Welcome to the community
I’ll set up a test project, attempt to replicate your issue and come back to you.

(This may take me a bit of time, so expect a reply by tomorrow morning)

In the meantime can you show me your sequelize schema for the table with the POINT column?

Hello,

We don’t use Sequelize, but Mikro ORM.

But in term of SQL, it’s a Postgis Geography Point : geography(Point,4326)

Pierrick Bignet
Co-founder @ Lonestone
+33 6 52 33 69 74

I just tested using Geography(Point) on Postgres.

You do use Sequelize on your agent, as projects generated with the CLI depend on it :slight_smile: , and there is indeed an issue in the Sequelize model generation step.

Can you go to the model file in your agent code (in the models/ folder), find the field that is causing issues and replace type: DataTypes.STRING by type: DataTypes.GEOMETRY('POINT') ?

image

Ho ok, sorry did not understand that!

By modifying the models it works indeed, that’s great.

I’ll keep testing for a while, thanks a lot.

By the way, I’m a bit perplex : I saw there was a BETA version with new APIs (https://docs.forestadmin.com/beta-developer-guide-agents-v2/https://docs.forestadmin.com/beta-developer-guide-agents-v2/) , is it the future of Forest admin ? It’s quite unclear.

I actually tried to start FA with my NestJS application but the project view kept complaining that the agent was not started (and I did not have any error on my side). So I reverted back to the CLI.

Pierrick Bignet
Co-founder @ Lonestone
+33 6 52 33 69 74

That exactly it.
Sorry for the lack of communication.

We’ve been working on a big evolution of the library that fuels our customers’ agents.

The new version is no longer tied to specific frameworks (sequelize / express, …), is higher level and much easier to use and debug.

It is in beta, and only advertised for NestJS for a couple more weeks, as we’re still actively working on it, and some features are still missing.

That is very unfortunate.
Did you double check the url here when you created your projet?