Wow, a blast from the past! :)
Which version of SQLAlchemy does your new version work with? It's great
that you are now able to get rid of the HStoreComparator, that really makes
it easier to use. The version of SQLA I was using 2 years ago when I wrote
it required the custom comparator to make the operators work on the ORM
InstrumentedAttribute as well as on the Core Column. I suppose the new
version doesn't require this duplication?
On your question, I think that PostgreSQL's hstore supports unicode just
fine; the keys and values are of type "text". It is just a bug in my code
that it does not work. I think the main issue would be to replace
.encode('string_escape') in _serialize_hstore() and
.decode('string_escape') in _parse_hstore() with something that will do the
same job but work for both unicode and string, and to make sure the regexes
are unicode safe (or replace them with a proper parser).
I'm glad you're finding it useful, hstore is very handy and having it work
seamlessly in SQLA is even better!
On Thu, Mar 29, 2012 at 1:01 AM, Uwe Seher <[email protected]> wrote:
> Hi!
>
> I am exploring your hstore.py for some days now. At first, i fixed an
> error which occured when the hstore-field in the database was empty (see
> attachment). At next i found out, that keys in the dictictionary, that
> shall be written into the database must be strings and not unicode. Is this
> the correct handling of this?
>
> Thank you for the work!
>
> Uwe Seher
>
>
> Am Mittwoch, 7. April 2010 06:38:32 UTC+2 schrieb Kyle Schaffrick:
>>
>> Greetings,
>>
>> I'm looking into using PostgreSQL's hstore type in a SQLAlchemy
>> project, and before I possibly reinvent the wheel I was wondering if
>> anyone has/knows of an implementation of an hstore custom type for SQLA?
>>
>> I'm basically just interested in simply mapping a stand-alone attribute
>> containing a python dict onto an hstore column, I don't require
>> auto-magic storage of extra attributes directly added to the object
>> a la examples/vertical.
>>
>> Mainly I want the hstore segregated into it's own attribute because I'd
>> like to be able to expose expression language support for hstore's
>> operators (?, ->, ||, and so forth) to manipulate them server-side.
>>
>> Any pointers?
>>
>> Thanks,
>> -Kyle
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sqlalchemy/-/U6JuhiAOJQMJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.