Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In auto-discover, hide geocolumns from tables with multiple ones #663

Merged
merged 1 commit into from
May 22, 2023

Conversation

sharkAndshark
Copy link
Collaborator

Hi @nyurik I'm trying to resolve #627 .But it's a little bit hard battle against rust😂

@nyurik
Copy link
Member

nyurik commented May 16, 2023

@sharkAndshark thanks for contributing! I think you can make your life much easier - just modify this code:

https://github.com/maplibre/martin/blob/34d16d28fcfc7add0cd6aaddf9b0a2d4df2a1710/src/pg/scripts/get_table_sources.sql

I would suggest creating a local db (e.g. run just start and just print-conn-str to see the DB conn string), connect to it using some postgres query tool, and modify the code to remove geometry columns from the query result.

Simplest -- just add

FILTER (WHERE columns.column_name IS NOT NULL AND columns.type_name != 'geometry')
instead of FILTER (WHERE columns.column_name IS NOT NULL)

@sharkAndshark sharkAndshark changed the title remove geo columns in the output [WIP] remove geo columns in the output May 17, 2023
@nyurik
Copy link
Member

nyurik commented May 19, 2023

Thanks, looks good! Can you update the Readme to describe this change?

@nyurik nyurik changed the title [WIP] remove geo columns in the output In auto-discover, hide geocolumns from tables with multiple ones May 19, 2023
@sharkAndshark
Copy link
Collaborator Author

Yeah sure.

Copy link
Member

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

@nyurik nyurik merged commit fe6c207 into maplibre:main May 22, 2023
@sharkAndshark sharkAndshark deleted the removegeomfield branch October 27, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For PG tables, do not include any geo columns in the output
2 participants