Is there a way to get the name of primary key field from mysql-database? For example:
I have a table like this:
+----+------+ | id | name | +----+---
If you have spatial tables in your database, use:
SHOW KEYS FROM table WHERE Key_name = 'PRIMARY' OR Key_name = 'OGR_FID'