Skip to content

Commit

Permalink
Merge pull request #31 from webability-go/late-night
Browse files Browse the repository at this point in the history
patch v0.3.3
  • Loading branch information
metalwolf committed Jan 20, 2021
2 parents d9f18c7 + df78662 commit df5c3e5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -198,6 +198,10 @@ XRecord
Version Changes Control
=======================

v0.3.3 - 2021-01-20
-----------------------
- Correction to support nil transactions (no transaction even if the parameter is passed with a nil value) into select type queries (select, min, max, avg, count, ...)

v0.3.2 - 2021-01-17
-----------------------
- Implementation of transactions into select type queries (select, min, max, avg, count, ...)
Expand Down
2 changes: 1 addition & 1 deletion xbase.go
Expand Up @@ -18,7 +18,7 @@ As of 2018/12/01, only postgres and mysql are supported for now

const (
// Version of XDominion
VERSION = "0.3.2"
VERSION = "0.3.3"

// The distinct supported databases
DB_Postgres = "postgres"
Expand Down
30 changes: 30 additions & 0 deletions xtable.go
Expand Up @@ -44,6 +44,9 @@ func (t *XTable) Synchronize(args ...interface{}) error {

if len(args) > 0 {
trx, hastrx = args[0].(*XTransaction)
if trx == nil {
hastrx = false
}
}

// creates the "create table" query
Expand Down Expand Up @@ -192,6 +195,9 @@ func (t *XTable) Select(args ...interface{}) (interface{}, error) {
fields = p.(XFieldSet)
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
}
}
if onlyone {
Expand Down Expand Up @@ -407,6 +413,9 @@ func (t *XTable) Insert(data interface{}, args ...interface{}) (interface{}, err

if len(args) > 0 {
trx, hastrx = args[0].(*XTransaction)
if trx == nil {
hastrx = false
}
}

rc := data.(XRecordDef)
Expand Down Expand Up @@ -527,6 +536,9 @@ func (t *XTable) Update(args ...interface{}) (int, error) {
key = p
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
case XCondition:
hasconditions = true
conditions = XConditions{p.(XCondition)}
Expand Down Expand Up @@ -637,6 +649,9 @@ func (t *XTable) Upsert(args ...interface{}) (int, error) {
key = p
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
case XCondition:
hasconditions = true
conditions = XConditions{p.(XCondition)}
Expand Down Expand Up @@ -705,6 +720,9 @@ func (t *XTable) Delete(args ...interface{}) (int, error) {
key = p
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
case XCondition:
hasconditions = true
conditions = XConditions{p.(XCondition)}
Expand Down Expand Up @@ -777,6 +795,9 @@ func (t *XTable) Count(args ...interface{}) (int, error) {
conditions = p.(XConditions)
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
}
}

Expand Down Expand Up @@ -841,6 +862,9 @@ func (t *XTable) Min(field string, args ...interface{}) (interface{}, error) {
conditions = p.(XConditions)
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
}
}

Expand Down Expand Up @@ -901,6 +925,9 @@ func (t *XTable) Max(field string, args ...interface{}) (interface{}, error) {
conditions = p.(XConditions)
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
}
}

Expand Down Expand Up @@ -961,6 +988,9 @@ func (t *XTable) Avg(field string, args ...interface{}) (interface{}, error) {
conditions = p.(XConditions)
case *XTransaction:
trx, hastrx = p.(*XTransaction)
if trx == nil {
hastrx = false
}
}
}

Expand Down

0 comments on commit df5c3e5

Please sign in to comment.