Commit Graph

53 Commits (ac2918b9a32454f04833395a7be31d1e136782f8)

Author SHA1 Message Date
Jack Christensen ac2918b9a3 Add BeginFunc and BeginTxFunc
fixes #821
2021-02-20 18:30:18 -06:00
Musbah Sinno b664891853 Updated CopyFromSlice example in doc.go
The example had a syntax error and didn't explain what user was to begin with. Fixed it.
2020-12-23 10:42:48 -06:00
Jack Christensen e8f959e0e1 Add QueryFunc
refs #821
2020-12-12 09:39:58 -06:00
Egon Elbre e23c5bec24 add pgx.CopyFromSlice
Using CopyFromRows can often be inconvenient to use, because you would
need to convert a typed array to an [][]interface{}. Similarly,
implementing a custom CopyFromSource is too verbose for one-off things.

Add CopyFromSlice that allows to more easily convert a slice to a
CopyFromSource. Example:

    copyCount, err := conn.CopyFrom(
        context.Background(),
        pgx.Identifier{"people"},
        []string{"first_name", "last_name", "age"},
        pgx.CopyFromSlice(len(rows), func(i int) ([]interface{}, error) {
            return []interface{user.FirstName, user.LastName, user.Age}, nil
        }),
    )
2020-12-02 11:16:36 +02:00
Harmen 040df1ccef fix link to 'pgtype' repo 2020-09-10 09:30:26 -05:00
Jack Christensen f19b08628e Tweak docs to make conn / conn pool distinction clearer 2020-05-16 08:20:40 -05:00
Jack Christensen 1b54d15e93 Fix documentation error
fixes #749
2020-05-16 07:48:11 -05:00
Maxim Ivanov 198f5093e8 Clarify row type handling example 2020-04-10 18:39:04 +01:00
Maxim Ivanov 692e10f901 Document row and composite types handling 2020-04-10 17:08:56 +01:00
ferhat elmas 912b2fcc3a Fix some typos 2019-09-04 12:46:50 +02:00
Jack Christensen afa83095a8 Add more docs 2019-09-02 12:14:04 -05:00
Jack Christensen 246baf2746 Update docs 2019-09-02 11:54:24 -05:00
Jack Christensen 61f0710101 Add docs and tests for PgBouncer 2019-08-24 22:12:55 -05:00
Jack Christensen b2b949afa4 Rename BeginEx to BeginTx and update docs 2019-08-24 20:50:24 -05:00
Jack Christensen ebf88b691f Rewrap doc.go 2019-08-24 20:46:36 -05:00
Jack Christensen 0c3e59b07a Add automatic statement cache 2019-08-24 20:29:54 -05:00
Jack Christensen da16226e0a Update docs for first prerelease of v4 2019-06-29 13:59:11 -05:00
Jack Christensen 54c6ddc2f0 Commit and Rollback take context
Remove Ex versions.
2019-04-10 12:22:12 -05:00
Jack Christensen b69179cebb Remove Conn.Listen and Conn.Unlisten
Use Conn.Exec instead to listen or unlisten.
2019-04-10 11:21:40 -05:00
Tejas Manohar e2010c858c tls: stop sending ssl_renegotiation_limit in startup message
This addresses https://github.com/jackc/pgx/issues/321 with the
fix @jackc proposed there. Redshift users that need to connect
w/ SSL currently fork the library to delete this parameter, e.g.

8e0028d742

And, that's annoying to keep up-to-date :)
2018-10-29 21:50:09 -07:00
Geert-Johan Riemer 8efdbc9345
Update doc.go
Fix undefined identifiers in example
2018-09-17 17:45:08 +02:00
Jack Christensen b931b56bf6 Document edge case with renamed types
fixes #393
2018-03-03 14:09:49 -06:00
miktwon 9fafa4ebf3 Fix doc: Import stdlib 2017-09-07 11:48:56 +03:00
Damir Vandic 8afa1fd332 fix logrus updated package name (lowercase)
See https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276
2017-08-18 13:46:49 +02:00
Christian Rocha d1cfcd9913 Add missing period in documentation 2017-08-14 09:41:22 -04:00
Jack Christensen 062d97deb2 Doc tweaks 2017-07-21 14:09:38 -05:00
Jack Christensen 4d6fe2d5fa Doc updates 2017-07-15 08:41:26 -05:00
Jack Christensen 3404529457 Fix docs CopyTo -> CopyFrom 2017-07-04 10:52:20 -05:00
Christian Rocha 2509082c0e Add missing `pgx.Identifier` to `CopyFrom` example 2017-07-04 10:51:42 -05:00
Jack Christensen 8712627257 Use Go casing convention for CID/TID/XID/CIDR 2017-06-03 12:01:49 -05:00
Jack Christensen 280bce7078 Added log adapter for logrus
Also changed standard logger interface to take a map instead of varargs for
extra data.
2017-04-29 21:28:38 -05:00
Jack Christensen 92cff1d961 Simplify []byte scanning 2017-03-18 14:42:36 -05:00
Jack Christensen 9e289cb186 Remove unused DefaultTypeFormats 2017-03-18 14:09:55 -05:00
Jack Christensen 743b98b298 Name PG types as words
Though this doesn't follow Go naming conventions exactly it makes names more
consistent with PostgreSQL and it is easier to read. For example, TIDOID becomes
TidOid. In addition this is one less breaking change in the move to V3.
2017-03-11 17:03:23 -06:00
Jack Christensen 39dad2b795 Merge branch 'master' into v3-experimental 2017-02-04 11:27:12 -06:00
Jack Christensen a52a6bd555 Add PgxScanner interface
Enables types to support database/sql at the same time as pgx.

fixes #232
2017-02-02 20:20:52 -06:00
Jack Christensen e871ccfca2 Update docs for BeginEx 2017-01-07 13:12:09 -06:00
Jack Christensen 93e5c68f69 Merge branch 'master' into v3-experimental 2016-12-10 12:21:08 -06:00
Jack Christensen 383c12177e Add mapping information for core types.
refs #183
2016-09-24 12:49:51 -05:00
Mostafa Hajizadeh 7a2738f9f2 Fix minor documentation mistake: s/slice/null/ 2016-08-11 08:06:58 +04:30
Jack Christensen cfb0304ab0 Fix typos 2016-08-10 16:28:29 -05:00
Jack Christensen 5f7d01778e Add CopyTo to support PostgreSQL copy protocol
fixes #102
2016-08-10 16:27:44 -05:00
Jack Christensen 390f75c0e1 Reduce Logger interface to Log method 2016-08-02 14:42:31 -05:00
Jack Christensen 9f9a9779ac Add compatibility with database/sql custom types
Support database/sql.Scanner
Support database/sql/driver.Valuer
2015-12-31 14:46:43 -06:00
Jack Christensen 1eecea606b Tweak doc.go so section head is detected 2015-12-09 12:00:33 -06:00
Jack Christensen e1215d9b19 []byte skips encoding/decoding
refs #104
2015-11-12 14:54:25 -06:00
Jack Christensen 23c48c2f87 Add trace logging 2015-09-16 08:40:01 -05:00
Jack Christensen 8b296b9d58 Encode from net.IP to inet and cidr 2015-09-09 18:49:20 -05:00
Jack Christensen e4f401f6ec Add documentation for pointer to pointer null mapping 2015-09-08 12:15:16 -05:00
Jack Christensen 5ea6b04624 Add docs and example for JSON 2015-09-04 14:00:21 -05:00