Change pgx driver #996

Merged
DrWrong merged 3 commits from master into master 2018-06-06 08:43:15 +00:00
DrWrong commented 2018-06-05 06:42:52 +00:00 (Migrated from github.com)

The Pgx driver should be changed,so that it can work with pgx's stdlib properly

FYI: https://github.com/jackc/pgx/blob/master/stdlib/sql.go#L137

pgx provide has customized the leading 9 bytes of the dsn to provide a mechanism to config the connection, EG: set PreferSimpleProtocol = true, However, when using this mechanism, the Parse process of xorm will be failled.

xorm 中 pgx driver的Parse方法会导致不能使用pgx stdlib 包中的ConnConfig, 有一些pgx的配置比如设置PreferSimpleProtocoltrue 就没办法去做, 所以提供了一个新类去处理这件事情, 在Parse 阶段直接将将9个字符根据pgx的规则扔掉, 保证能Parse通过

The Pgx driver should be changed,so that it can work with pgx's stdlib properly FYI: https://github.com/jackc/pgx/blob/master/stdlib/sql.go#L137 pgx provide has customized the leading 9 bytes of the dsn to provide a mechanism to config the connection, EG: set `PreferSimpleProtocol = true`, However, when using this mechanism, the `Parse` process of xorm will be failled. xorm 中 pgx driver的`Parse`方法会导致不能使用`pgx` stdlib 包中的`ConnConfig`, 有一些pgx的配置比如设置`PreferSimpleProtocol` 为 `true` 就没办法去做, 所以提供了一个新类去处理这件事情, 在`Parse` 阶段直接将将9个字符根据pgx的规则扔掉, 保证能Parse通过
codecov-io commented 2018-06-05 06:59:52 +00:00 (Migrated from github.com)

Codecov Report

Merging #996 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #996      +/-   ##
==========================================
+ Coverage   54.26%   54.27%   +0.01%     
==========================================
  Files          41       41              
  Lines        7544     7548       +4     
==========================================
+ Hits         4094     4097       +3     
  Misses       2934     2934              
- Partials      516      517       +1
Impacted Files Coverage Δ
xorm.go 64.61% <100%> (-1.54%) ⬇️
dialect_postgres.go 75.57% <100%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab17aa2...a9ae719. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=h1) Report > Merging [#996](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/ab17aa22037beed8b99422a95d8a9419066caf7c?src=pr&el=desc) will **increase** coverage by `0.01%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/996/graphs/tree.svg?width=650&height=150&src=pr&token=yB5nO1krEe)](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #996 +/- ## ========================================== + Coverage 54.26% 54.27% +0.01% ========================================== Files 41 41 Lines 7544 7548 +4 ========================================== + Hits 4094 4097 +3 Misses 2934 2934 - Partials 516 517 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/996/diff?src=pr&el=tree#diff-eG9ybS5nbw==) | `64.61% <100%> (-1.54%)` | :arrow_down: | | [dialect\_postgres.go](https://codecov.io/gh/go-xorm/xorm/pull/996/diff?src=pr&el=tree#diff-ZGlhbGVjdF9wb3N0Z3Jlcy5nbw==) | `75.57% <100%> (+0.32%)` | :arrow_up: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=footer). Last update [ab17aa2...a9ae719](https://codecov.io/gh/go-xorm/xorm/pull/996?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

I ever want to pgx PASS all the tests, but I'm failed.

I ever want to pgx PASS all the tests, but I'm failed.

Thanks

Thanks
Sign in to join this conversation.
No description provided.