Skip to content

Commit

Permalink
v0.0.2
Browse files Browse the repository at this point in the history
* Fixed issue with goqu.New not returning a pointer to a Database
  • Loading branch information
doug-martin committed Mar 6, 2015
1 parent 1dc08f3 commit 6209451
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## v0.0.2

* Fixed issue with goqu.New not returning a pointer to a Database

## v0.0.1

* Initial release
2 changes: 1 addition & 1 deletion adapters/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type (
logger struct{}
mysqlTest struct {
suite.Suite
db goqu.Database
db *goqu.Database
}
entry struct {
Id uint32 `db:"id" goqu:"skipinsert,skipupdate"`
Expand Down
2 changes: 1 addition & 1 deletion adapters/postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func init() {
type (
postgresTest struct {
suite.Suite
db goqu.Database
db *goqu.Database
}
entry struct {
Id uint32 `db:"id" goqu:"skipinsert,skipupdate"`
Expand Down
1 change: 1 addition & 0 deletions crud_exec_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package goqu
12 changes: 6 additions & 6 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ type (
// panic(err.Error())
// }
// fmt.Printf("%+v", ids)
func New(dialect string, db *sql.DB) Database {
return Database{Dialect: dialect, Db: db}
func New(dialect string, db *sql.DB) *Database {
return &Database{Dialect: dialect, Db: db}
}

//Starts a new Transaction.
func (me Database) Begin() (TxDatabase, error) {
func (me *Database) Begin() (*TxDatabase, error) {
tx, err := me.Db.Begin()
if err != nil {
return TxDatabase{}, err
return nil, err
}
return TxDatabase{Dialect: me.Dialect, Tx: tx}, nil
return &TxDatabase{Dialect: me.Dialect, Tx: tx}, nil
}

//used internally to create a new Adapter for a dataset
func (me Database) queryAdapter(dataset *Dataset) Adapter {
func (me *Database) queryAdapter(dataset *Dataset) Adapter {
return NewAdapter(me.Dialect, dataset)
}

Expand Down

0 comments on commit 6209451

Please sign in to comment.