Implementing custom column types
See original GitHub issueHello,
I just recently stumbled upon Piccolo and I’m very impressed so far with how much thought and effort has been put into it. Modern Python desperately needs an ORM that can keep up with the next generation of web development libraries. Piccolo looks to be well on it’s way to fill that need.
I have a project in mind that I could use Piccolo with, but it does have a use case that requires the use of a PostGIS geography type column. I’ve been looking through https://github.com/piccolo-orm/piccolo/blob/master/piccolo/columns/base.py and it doesn’t look too daunting to subclass Column
and go from there. If I can get something useable, even with using raw for selects, it would be pretty great.
Since there doesn’t seem to be any documentation on implementing custom columns, I’d figure I’d post an issue, even if there isn’t really a problem yet just in case anyone had any advice or thoughts.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
@Fingel I think those issues are all solvable, but will require some changes to Piccolo.
piccolo_conf.py
, which solves the migration issue.ST_Dwithin
, the best analogy so far is theJSONB
column type, which has anarrow
method. Something similar to this could be implemented.I should be able to get 1 and 3 done in the next day or so. Otherwise you might want to fork it for now.
Going to close this for now - custom column types should now be possible.