Skip to content

Commit

Permalink
Modify Char1 default to ora.S (string) from ora.B (bool).
Browse files Browse the repository at this point in the history
  • Loading branch information
tgulacsi committed Apr 8, 2016
1 parent 6874186 commit 9b329a8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Add numberBigInt and numberBigFloat colum types.
This allows tweaking the used column types for NUMBER columns with unknown scale/precision.
* OCINum instead of OraNum - space saving and less C calls (implemented pure Go read/write of Oracle OCINumber, in num directory).
* Modify default for CHAR(1) columns: use ora.S (string), NOT ora.B (bool).

## v3.3 ##
* Introduce new `Num` and `OraNum` data types and `N` Go Column Type to represent Oracle numbers fully, by exchanging them with Go as strings.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ sc.StmtCfg.Rset.SetDate(ora.OraT)
sc.StmtCfg.Rset.SetTimestamp(ora.OraT)
sc.StmtCfg.Rset.SetTimestampTz(ora.OraT)
sc.StmtCfg.Rset.SetTimestampLtz(ora.OraT)
sc.StmtCfg.Rset.SetChar1(ora.OraB)
sc.StmtCfg.Rset.SetChar1(ora.OraS)
sc.StmtCfg.Rset.SetVarchar(ora.OraS)
sc.StmtCfg.Rset.SetLong(ora.OraS)
sc.StmtCfg.Rset.SetClob(ora.OraS)
Expand All @@ -707,6 +707,8 @@ Another scenario may be to configure the runes mapped to `bool` values:
// update StmtCfg to change the FalseRune and TrueRune inserted into the database
// given: CREATE TABLE T1 (C1 CHAR(1 BYTE))

stmt.Cfg().Char1(ora.OraB)

// insert 'false' record
var falseValue bool = false
stmt, err = ses.Prep("INSERT INTO T1 (C1) VALUES (:C1)")
Expand Down
4 changes: 3 additions & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ nullable Go types by default:
sc.StmtCfg.Rset.SetTimestamp(ora.OraT)
sc.StmtCfg.Rset.SetTimestampTz(ora.OraT)
sc.StmtCfg.Rset.SetTimestampLtz(ora.OraT)
sc.StmtCfg.Rset.SetChar1(ora.OraB)
sc.StmtCfg.Rset.SetChar1(ora.OraS)
sc.StmtCfg.Rset.SetVarchar(ora.OraS)
sc.StmtCfg.Rset.SetLong(ora.OraS)
sc.StmtCfg.Rset.SetClob(ora.OraS)
Expand All @@ -630,6 +630,8 @@ Another scenario may be to configure the runes mapped to bool values:
// update StmtCfg to change the FalseRune and TrueRune inserted into the database
// given: CREATE TABLE T1 (C1 CHAR(1 BYTE))
stmt.Cfg().Char1(ora.OraB)
// insert 'false' record
var falseValue bool = false
stmt, err = ses.Prep("INSERT INTO T1 (C1) VALUES (:C1)")
Expand Down
2 changes: 1 addition & 1 deletion rsetCfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewRsetCfg() RsetCfg {
c.timestamp = T
c.timestampTz = T
c.timestampLtz = T
c.char1 = B
c.char1 = S
c.char = S
c.varchar = S
c.long = S
Expand Down

0 comments on commit 9b329a8

Please sign in to comment.