aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/database
AgeCommit message (Collapse)Author
2013-03-14database/sql: document non-open of Open; add PingBrad Fitzpatrick
Fixes #4804 R=golang-dev, r CC=golang-dev https://golang.org/cl/7819043
2013-03-08database/sql: fix Conn leakBrad Fitzpatrick
Fixes #4902 R=golang-dev, alex.brainman, r, google CC=golang-dev https://golang.org/cl/7579045
2013-02-21database/sql: check for nil Scan pointersBrad Fitzpatrick
Return nice errors and don't panic. Fixes #4859 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7383046
2013-02-20database/sql: clarify that DB.Prepare's stmt is safe for concurrent useBrad Fitzpatrick
And add a test too, for Alex. :) Fixes #3734 R=golang-dev, adg CC=golang-dev https://golang.org/cl/7399046
2013-02-20database/sql: refcounting and lifetime fixesBrad Fitzpatrick
Simplifies the contract for Driver.Stmt.Close in the process of fixing issue 3865. Fixes #3865 Update #4459 (maybe fixes it; uninvestigated) R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7363043
2013-02-13database/sql: fix doc references to old package nameBrad Fitzpatrick
It used to be package "db" but was long ago renamed to be "sql". R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7322075
2013-02-13database/sql: Add an optional Queryer-Interface (like Execer)Julien Schmidt
Completly the same like the Execer-Interface, just for Queries. This allows Drivers to execute Queries without preparing them first R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7085056
2013-02-13database/sql: add currently-disabled broken testBrad Fitzpatrick
Update #3865 R=golang-dev, alex.brainman, nightlyone CC=golang-dev https://golang.org/cl/7324051
2013-01-11database/sql: document args, add a couple examplesBrad Fitzpatrick
Fixes #3460 R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/7096046
2013-01-11database/sql: check NumInput on Stmt.ExecGwenael Treguier
Fixes #3678. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6460087
2012-12-19all: fix typosShenghou Ma
caught by https://github.com/lyda/misspell-check. R=golang-dev, gri CC=golang-dev https://golang.org/cl/6949072
2012-12-14database/sql: adds test for fix in issue 4433.James David Chalfant
Tests that here should be automatic retries if a database driver's connection returns ErrBadConn on Begin. See "TestTxErrBadConn" in sql_test.go R=golang-dev CC=golang-dev https://golang.org/cl/6942050
2012-12-12 database/sql: Alter *DB.begin to return driver.ErrBadConn when ↵James David Chalfant
driver.Conn.Begin returns driver.ErrBadConn Fixes #4433 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6845094
2012-11-01all: clear execute bitMikio Hara
R=golang-dev, r CC=golang-dev https://golang.org/cl/6826044
2012-08-23database/sql: stop reuse of bad connectionsJulien Schmidt
The second parameter for sql.putConn() (err) is always nil. As a result bad connections are reused, even if the driver returns an driver.ErrBadConn. Unsing a pointer to err instead achievs the desired behavior. See http://code.google.com/p/go/issues/detail?id=3777 for more details. Fixes #3777. R=golang-dev, dave, bradfitz, jameshuachow, BlakeSGentry CC=golang-dev https://golang.org/cl/6348069
2012-07-09pkg: Removing duplicated words ("of of", etc.), mostly from comments.David G. Andersen
Ran 'double.pl' on the pkg tree to identify doubled words. One change to an error string return in x509; the rest are in comments. Thanks to Matt Jibson for the idea. R=golang-dev, bsiegert CC=golang-dev https://golang.org/cl/6344089
2012-05-29database/sql: use driver.ColumnConverter everywhere consistentlyBrad Fitzpatrick
It was only being used for (*Stmt).Exec, not Query, and not for the same two methods on *DB. This unifies (*Stmt).Exec's old inline code into the old subsetArgs function, renaming it in the process (changing the old word "subset" to "driver", mostly converted earlier) Fixes #3640 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6258045
2012-04-03sql: Propagate error from subsetTypeArgs in ExecMichael Lewis
Fixes #3449 R=golang-dev CC=bradfitz, golang-dev https://golang.org/cl/5970076
2012-03-10database/sql: ensure Stmts are correctly closed.Gwenael Treguier
To make sure that there is no resource leak, I suggest to fix the 'fakedb' driver such as it fails when any Stmt is not closed. First, add a check in fakeConn.Close(). Then, fix all missing Stmt.Close()/Rows.Close(). I am not sure that the strategy choose in fakeConn.Prepare/prepare* is ok. The weak point in this patch is the change in Tx.Query: - Tests pass without this change, - I found it by manually analyzing the code, - I just try to make Tx.Query look like DB.Query. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5759050
2012-03-10database/sql: fix double connection free on Stmt.Query errorBrad Fitzpatrick
In a transaction, on a Stmt.Query error, it was possible for a connection to be added to a db's freelist twice. Should use the local releaseConn function instead. Thanks to Gwenael Treguier for the failing test. Also in this CL: propagate driver errors through releaseConn into *DB.putConn, which conditionally ignores the freelist addition if the driver signaled ErrBadConn, introduced in a previous CL. R=golang-dev, gary.burd CC=golang-dev https://golang.org/cl/5798049
2012-03-08all: gofmt -w -s src miscRobert Griesemer
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5781058
2012-03-08database/sql{,driver}: add ErrBadConnBrad Fitzpatrick
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5785043
2012-03-06database/sql: add docs about connection state, poolingBrad Fitzpatrick
Fixes #3223 R=golang-dev, r CC=golang-dev https://golang.org/cl/5755063
2012-03-06database/sql: fix typo bug resulting in double-PrepareBrad Fitzpatrick
Bug reported by Blake Mizerany found while writing his new Postgres driver. R=golang-dev, blake.mizerany CC=golang-dev https://golang.org/cl/5754057
2012-02-20database/sql/driver: API cleanupsBrad Fitzpatrick
-- add driver.Value type and documentation, convert from interface{} to Value where appropriate. -- don't say "subset" anywhere, -- SubsetValuer -> Valuer -- SubsetValue -> Value -- IsParameterSubsetType -> IsValue -- IsScanSubsetType -> IsScanValue Fixes #2842 R=golang-dev, r, rsc CC=golang-dev https://golang.org/cl/5674084
2012-02-10database/sql: remove Into from ScannerInto/ScanIntoBrad Fitzpatrick
Also fix a doc error. Fixes #2843 R=golang-dev, r, rsc CC=golang-dev https://golang.org/cl/5653050
2012-02-10database/sql: support ErrSkip in Tx.ExecAndrew Balholm
If the database driver supports the Execer interface but returns ErrSkip, calling Exec on a transaction was returning the error instead of using the slow path. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5654044
2012-02-10database/sql: rename ErrTransactionFinished to ErrTxDoneBrad Fitzpatrick
Part of issue 2843 R=golang-dev, gri CC=golang-dev https://golang.org/cl/5646063
2012-02-09database/sql: more testsBrad Fitzpatrick
Higher level tests for the pointer parameters and scanning, complementing the existing ones included in the previous CL. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5646050
2012-02-08database/sql: treat pointers as nullable types like encoding/jsonAndrew Pritchard
- convert from nil pointers to the nil interface{} - dereference non-nil pointers - convert from nil interface{}s to nil pointers - allocate pointers for non-nil interface{}s - tests for all of the above R=golang-dev, bradfitz, rsc, rogpeppe CC=golang-dev https://golang.org/cl/5630052
2012-02-06doc: remove overuse of simplyRuss Cox
Specifically, remove simply where it is claiming that the code or the action to be carried out is simple, since the reader might disagree. R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/5637048
2012-02-06database/sql: permit scanning into interface{}Brad Fitzpatrick
See thread http://goo.gl/7zzzU for background. R=rsc CC=golang-dev https://golang.org/cl/5624051
2012-02-03std: add struct field tags to untagged literals.Nigel Tao
R=rsc, dsymonds, bsiegert, rogpeppe CC=golang-dev https://golang.org/cl/5619052
2012-01-30build: remove Make.pkg, Make.toolRuss Cox
Consequently, remove many package Makefiles, and shorten the few that remain. gomake becomes 'go tool make'. Turn off test phases of run.bash that do not work, flagged with $BROKEN. Future CLs will restore these, but this seemed like a big enough CL already. R=golang-dev, r CC=golang-dev https://golang.org/cl/5601057
2012-01-26 database/sql: convert SQL null values to []byte as nil.James P. Cooper
Also allow string values to scan into []byte. Fixes #2788. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5577054
2012-01-25database/sql: fix Tx.QueryBlake Mizerany
Fixes #2784 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5574073
2012-01-25database/sql: add NullInt64, NullFloat64, NullBoolJames P. Cooper
Fixes #2699 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5557063
2012-01-19database/sql: move from exp/sqlBrad Fitzpatrick
R=golang-dev, r CC=golang-dev https://golang.org/cl/5536076