// GetCount returns the number of records in console ownership.
GetCount returns the number of records in console ownership.
// GetCount returns the number of records in console ownership .
func (ds *DataStore) GetCount() (recordCount int64, err error) {
	sqlStmt := `
        select count(1) from ownership
    `
	result, err := ds.DB.Query(sqlStmt)
	if err != nil {
		errMsg := fmt.Sprintf("WARN: GetCount: There is a SELECT error: %s", err)
		log.Printf(errMsg)
		err = errors.New(errMsg)
		return 0, err
	}
	defer result.Close()
	recordCount = 0
	if result == nil {
		errMsg := fmt.Sprintf("WARN: GetCount: Error getting the result: %s", err)
		log.Printf(errMsg)
		err = errors.New(errMsg)
		return 0, err
	}
	if !result.Next() {
		errMsg := fmt.Sprintf("WARN: GetCount: missing count")
		log.Printf(errMsg)
		err = errors.New(errMsg)
		return 0, err
	}
	err = result.Scan(&recordCount)
	if err != nil {
		errMsg := fmt.Sprintf("WARN: GetCount: Error getting the count: %s", err)
		log.Printf(errMsg)
		err = errors.New(errMsg)
		return 0, err
	}
	return recordCount, err
}
func ( ds * DataStore ) GetCount ( ) ( recordCount int64 , err error ) { sqlStmt := `
        select count(1) from ownership
    ` result , err := ds . DB . Query ( sqlStmt ) if err != nil { errMsg := fmt . Sprintf ( " " , err ) log . Printf ( errMsg ) err = errors . New ( errMsg ) return 0 , err } defer result . Close ( ) recordCount = 0 if result == nil { errMsg := fmt . Sprintf ( " " , err ) log . Printf ( errMsg ) err = errors . New ( errMsg ) return 0 , err } if ! result . Next ( ) { errMsg := fmt . Sprintf ( " " ) log . Printf ( errMsg ) err = errors . New ( errMsg ) return 0 , err } err = result . Scan ( & recordCount ) if err != nil { errMsg := fmt . Sprintf ( " " , err ) log . Printf ( errMsg ) err = errors . New ( errMsg ) return 0 , err } return recordCount , err }
GetCount returns the number of records in console ownership.
GetCount returns the number of records in console ownership .
//log.Printf("count: %d", recordCount)