akzhan / DBIx-Class-ResultClass-HashRefInflator-UTF8

DBIx-Class-ResultClass-HashRefInflator-UTF8
1 stars 0 forks source link

Needs docs on why/when the module should be used #1

Open ribasushi opened 8 years ago

ribasushi commented 8 years ago

Hi!

Most DBD's already provide a way to do what you want natively: DBD::Pg, DBD::mysql, DBD::ODBC etc

This makes a user wonder - what is the use case of your module? Documenting that would be of great help to whoever comes next.

Note that while overriding the inflator the way you did is definitely supported, works and will continue to work, there is a lot of overhead doing so (timing HRI vs HRI::UTF8 will reveal a likely unexpected perf difference, especially on > 100 row resultsets).

Cheers!

akzhan commented 8 years ago

Thanks @ribasushi for your mention. But I wanna only to get hashref inflator compatible with utf-8, without lowering to DBD level.

akzhan commented 8 years ago

And thanks, I add documentation,

akzhan commented 8 years ago

And latest step - i was improved speed/quality of the inflator.

ribasushi commented 8 years ago

I think you misunderstood what I meant... Можно по русски?

akzhan commented 8 years ago

да.

кстати, если вкратце -https://gist.github.com/asan13/a1688a6f6463cf3fdd4a722beaa2842c работает

но почему-то при попытке в рабочем проекте поставить client_encoding - unsupported option.

Пакеты DBIx::Class, DBI, DBD::Pg обновлены до последних.

akzhan commented 8 years ago

Ну и без этой опции при использовании обычного HashInflator строки приходят без флага utf8

ribasushi commented 8 years ago

Насколько помню client_encoding=utf8 директива для libpq (версия DBD::Pg тут не при чем). Но вроде все должно сработать даже без client_encoding: не достаточно pg_enable_utf8?

Но я лично Pg не пользуюсь так что лучше сходите на #dbi спросите напрямую у G_SabinoMulane или у ilmari. Сильно рекоммендую изправить на уровне DBD - когда ползуемся "чистым" HRI внутри DBIC есть фишка совершенно обходящая inflate_result(): соответственно производительность возрастает в разы.

А насчет документации - добавьте просто:

This module should be used to force UTF8 on your results in case your DBI/DBD/lib-$protocol pipeline does not support unicode natively (similar to the higher-level DBIx::Class::ForceUTF8

akzhan commented 8 years ago

Попозже уже исследую и поправлю доку. Пока что решал конкретную проблему.

9 июля 2016 г., 15:58 пользователь Peter Rabbitson <notifications@github.com

написал:

Насколько помню client_encoding=utf8 директива для libpq (версия DBD::Pg тут не при чем). Но вроде все должно сработать даже без client_encoding: не достаточно pg_enable_utf8 https://gist.github.com/asan13/a1688a6f6463cf3fdd4a722beaa2842c#file-gistfile1-txt-L11 ?

Но я лично Pg не пользуюсь так что лучше сходите на #dbi https://chat.mibbit.com/?channel=%23dbi&server=irc.perl.org спросите напрямую у G_SabinoMulane или у ilmari. Сильно рекоммендую изправить на уровне DBD - когда ползуемся "чистым" HRI внутри DBIC есть фишка https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/t/resultset/rowparser_internals.t#L672-748 совершенно обходящая inflate_result(): соответственно производительность возрастает в разы.

А насчет документации - добавьте просто:

This module should be used to force UTF8 on your results in case your DBI/DBD/lib-$protocol pipeline does not support unicode natively (similar to the higher-level DBIx::Class::ForceUTF8 http://p3rl.org/DBIx::Class::ForceUTF8

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/akzhan/DBIx-Class-ResultClass-HashRefInflator-UTF8/issues/1#issuecomment-231533300, or mute the thread https://github.com/notifications/unsubscribe/AAG3hD31M5S1lvhcWFYaBkEtv2_T9Pz-ks5qT5rjgaJpZM4JIk_5 .