georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
336 stars 33 forks source link

Using this crate to do bulk inserts with sqlx #40

Closed garma83 closed 2 years ago

garma83 commented 2 years ago

Hi, Would it be possible to use this crate to do bulk inserts as described by the FAQ section of SQLX? https://github.com/launchbadge/sqlx/blob/master/FAQ.md#how-can-i-bind-an-array-to-a-values-clause-how-can-i-do-bulk-inserts

I'm having trouble with type casting the geometry arrays.

pka commented 2 years ago

I've added an example in https://github.com/georust/geozero/blob/ed1d7c4347dabdee1d82f52c0d141220e19e5752/geozero/tests/postgis.rs#L230

It is required to impl PgHasArrayType for WKB geometries, which will be available in geozero 0.9.5

garma83 commented 2 years ago

that's very cool man! any indication when 0.9.5 will be available? Just asking so I can take it into account with our planning.

pka commented 2 years ago

No plan yet. Can be days or weeks.