ponyorm / pony

Pony Object Relational Mapper
Apache License 2.0
3.63k stars 245 forks source link

CockroachDB support is broken due to missing method and other issues #667

Open dikshant opened 1 year ago

dikshant commented 1 year ago

The class PGStrConverter was removed in Jan. https://github.com/ponyorm/pony/commit/071c95c5f77c7682d185900c7630ab722011949f#diff-b703e5fd1906adc8a5be9bbe920[…]9bbbc65a48e35ce5846f0eebcf082L141

But that class is still being imported in the CockroachDB provider: https://github.com/ponyorm/pony/blob/main/pony/orm/dbproviders/cockroach.py#L20

So when using CockroachDB, it fails to import that class and crashes.

I switched to the RC release pony 0.7.15rc1 from Jan 12, 2022 which still has that method intact. But things seem still broken when running the official CockorachDB example: https://www.cockroachlabs.com/docs/stable/build-a-python-app-with-cockroachdb-pony.html#step-4-run-the-python-code

End up getting this error:

pony.orm.core.UnexpectedError: Object Account[698658240] cannot be stored in the database. ProgrammingError: value type int doesn't match type uuid of column "id"
HINT:  you will need to rewrite or cast the expression