1
This commit is contained in:
parent
7c4682d82b
commit
7e8d448ef7
@ -11,6 +11,7 @@ type DataSet struct {
|
||||
}
|
||||
|
||||
func (this *DataSet) Next() bool {
|
||||
ret := this.rows.Next()
|
||||
this.GetColumns()
|
||||
this.values = []interface{}{}
|
||||
for i := 0 ; i < len(this.columns); i++ {
|
||||
@ -18,7 +19,7 @@ func (this *DataSet) Next() bool {
|
||||
this.values = append(this.values, &str)
|
||||
}
|
||||
this.rows.Scan(this.values...)
|
||||
return this.rows.Next()
|
||||
return ret
|
||||
}
|
||||
|
||||
func (this *DataSet) GetColumns() []string {
|
||||
@ -32,6 +33,7 @@ func (this *DataSet) GetColumns() []string {
|
||||
}
|
||||
|
||||
func (this *DataSet) GetByName(name string) *string {
|
||||
this.GetColumns()
|
||||
for i := 0; i < len(this.columns); i++ {
|
||||
if this.columns[i] == name {
|
||||
return this.GetByIndex(int32(i))
|
||||
@ -41,6 +43,7 @@ func (this *DataSet) GetByName(name string) *string {
|
||||
}
|
||||
|
||||
func (this *DataSet) GetByIndex(index int32) *string {
|
||||
this.GetColumns()
|
||||
return this.values[index].(*string);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user