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

Add geo types support #30

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

Mernus
Copy link

@Mernus Mernus commented Apr 9, 2024

Added geo types support from PostgreSQL and geo_types module in Rust.

Description

Motivation and Context

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

src/geometric_types.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved

// add macro for creating circles

#[derive(Eq, PartialEq, Clone, Copy, Debug, Hash)]
Copy link
Member

Choose a reason for hiding this comment

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

Do you really need all these traits?

Copy link
Author

Choose a reason for hiding this comment

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

I was focused on implementation that would look like other interfaces from geo types.
So it`s why i have this traits.

Copy link
Member

Choose a reason for hiding this comment

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

I don't completely understand, could you please explain it a bit more clearly?

Copy link
Author

Choose a reason for hiding this comment

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

For implementation geometric types in PostgreSQL I use geo_types module in Rust.
Mostly geometric types are already realised in module, so while making Circle interface i referred to implementation of ready geometric types interfaces in geo_types module.

src/value_converter.rs Outdated Show resolved Hide resolved
src/additional_types.rs Outdated Show resolved Hide resolved
src/value_converter.rs Outdated Show resolved Hide resolved
@chandr-andr
Copy link
Member

Btw. Looks great! Hope to see the final version soon!

@Mernus
Copy link
Author

Mernus commented May 13, 2024

Today will update on using exceptions that changed after main branch merge

@@ -569,6 +648,70 @@ fn postgres_bytes_to_py(
Ok(py.None().to_object(py))
}
}
// ---------- Geo Types ----------
Copy link
Member

Choose a reason for hiding this comment

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

Commented code

@chandr-andr
Copy link
Member

Add tests, please

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.

None yet

2 participants