# Does not work with PostGIS?

**URL:** https://community.forestadmin.com/t/does-not-work-with-postgis/4879
**Category:** Help me!
**Created:** [June 22, 2022, 3:23pm UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879 "2022-06-22T15:23:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![PierrickB](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pierrickb/32/4684_2.png) [@PierrickB](https://community.forestadmin.com/u/PierrickB)
#### Post date: [June 22, 2022, 3:23pm UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/1 "2022-06-22T15:23:18Z")

</div>

## 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

---

<div class="post-metadata">

### Author: ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)
#### Post date: [June 22, 2022, 3:34pm UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/2 "2022-06-22T15:34:42Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)
#### Post date: [June 22, 2022, 3:56pm UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/3 "2022-06-22T15:56:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![PierrickB](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pierrickb/32/4684_2.png) [@PierrickB](https://community.forestadmin.com/u/PierrickB)
#### Post date: [June 22, 2022, 4:26pm UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/4 "2022-06-22T16:26:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)
#### Post date: [June 23, 2022, 10:10am UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/5 "2022-06-23T10:10:41Z")

</div>

I just tested using Geography(Point) on Postgres.

You do use Sequelize on your agent, as projects generated with the CLI depend on it 🙂 , 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](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/7/7b4556345b5a4d6fa726eea23261182d26ab4e4b.png)

---

<div class="post-metadata">

### Author: ![PierrickB](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pierrickb/32/4684_2.png) [@PierrickB](https://community.forestadmin.com/u/PierrickB)
#### Post date: [June 24, 2022, 8:19am UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/6 "2022-06-24T08:19:40Z")

</div>

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/](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

---

<div class="post-metadata">

### Author: ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)
#### Post date: [June 24, 2022, 10:02am UTC](https://community.forestadmin.com/t/does-not-work-with-postgis/4879/7 "2022-06-24T10:02:55Z")

</div>

> [@PierrickB](#):
>
> is it the future of Forest admin ? It’s quite unclear

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.

> [@PierrickB](#):
>
> 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.

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

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/9/9c79f6484d265de04d0bb5f9b9e8dd974f275a9d.png)
