MapBox get City/location name from long and latit

I'm having 2 questions.
In my remote database a column is created as; alter table MYTABLE add column geog geography. Basically it's PostGIS extension for Postgres. With this said, i want MapBox to add the location coordinates from the map to this column. I wish i could save the name of selected point into my table. If it's hard, i could save coordinates to my db. How do i save this MapBox data (long and latitude) to my column geog. Or is there a better way?
Thanks for reading

Hey @ltfrupdt!

I'm not super familiar with this PostGIS extension but since it's an issue of passing an extended data type to your DB I wonder if disabling prepared statements on your query will help so that the query is passed exactly as constructed. Can you let me know if that works?

I know this post is old but I've managed to store the co-ordinates using

return utils.getCurrentPosition()

  1. Add as a new JS Code script
  2. Call script on Load
  3. Store data in number fields e.g. {{getCurLocation.data.coords.longitude}} where getCurLocation is the name of your JS Code script
  4. On submit, store number field values in DB:
    Eg:

Insert INTO
gg_Sightings (id, "Date", "Long", "Lat", "Markings", "Color")
VALUES
(
(
SELECT
MAX(ID) + 1
FROM
gg_Sightings
),
NOW (),
{{long.value}},
{{lat.value}},
{{txtMarkings.value}},
{{txtColor.value}}
)