tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
100 stars 48 forks source link

api: any msgpack supported type as a request key #244

Closed DifferentialOrange closed 1 year ago

DifferentialOrange commented 1 year ago

Inserting a tuple with connector does not have any type restrictions on its contents: any MessagePack supported type is allowed. If there are any type violations on the Tarantool side, server would return the corresponding error. There is no reason to do any explicit type checks for request keys.

This patch fixed using extended types as keys. Tarantool 2.10 does not support indexing intervals, so there are no tests for INTERVAL extension type.

Closes #240

oleg-jukovec commented 1 year ago

If there are any type violations on the Tarantool side, server would return the corresponding error.

Is there a test for this behavior?

DifferentialOrange commented 1 year ago

If there are any type violations on the Tarantool side, server would return the corresponding error.

Is there a test for this behavior?

To be honest, I don't think it's worth it because it would be a test for Tarantool only.

This behavior haven't even changed with this patch.

DifferentialOrange commented 1 year ago

If there are any type violations on the Tarantool side, server would return the corresponding error.

Is there a test for this behavior?

To be honest, I don't think it's worth it because it would be a test for Tarantool only.

* Create some schema with eval

* Insert something

* Select something with invalid key type, get format mismatch

This behavior haven't even changed with this patch.

In other words, there is no such thing as "unsupported type of a request key". Anything could be a key until it matches space format (and connector does not do any excessive format validations between tuples/keys and spaces). There is such a thing as "unsupported type for a primary index", but it is not related to connector at all.

oleg-jukovec commented 1 year ago

In other words, there is no such thing as "unsupported type of a request key".

I get an idea with an unsupported MessagePack extension ID. Tarantool should return the error in this case.

DifferentialOrange commented 1 year ago

In other words, there is no such thing as "unsupported type of a request key".

I get an idea with an unsupported MessagePack extension ID. Tarantool should return the error in this case.

Yeah, it should be like this. But it is still not related to this patch. This patch is simply about removing unnecessary type checkup. I think it was here for Tarantool 1.5