code: func (db *Database) commonCreateUpdate(value DBModel, builder func() string) error {
  	defer db.clear()
  	// if Model has been called, skip table name inference procedure
  	if len(db.tables) == 0 {
  		db.tables = append(db.tables, handleIdentifier(value.TableName()))
  		db.models = append(db.models, value)
  	}
  
  	in := getStruct(value)
  	// getFields handle anonymous nested fields
  	fields := getFields(value)
  
  	for _, structField := range fields {
  		field := in.FieldByName(structField.Name)
  		if value := fieldValue(field, structField); value != nil {
  			db.updateCreateFields = append(db.updateCreateFields, getColumnName(structField))
  			db.updateCreateValues = append(db.updateCreateValues, value)
  		}
  	}
  
  	// Compile query
  	var stmt *sql.Stmt
  	var err error
  	if stmt, err = db.db.Prepare(builder()); err != nil {
  		return err
  	}
  
  	// Pass query parameters and executes the query
  	// set db.rawRows to query results (of returning) in order to make it possible to scan rows into result
  	if db.rawRows, err = stmt.Query(append(db.updateCreateValues, db.whereValues...)...); err != nil {
  		return err
  	}
  	if err = db.Scan(value); err != nil {
  		panic(err)
  	}
  	return nil
  }
docs: // commonCreateUpdate executs common operation in preparation of create / update statements
  // because the logic is the same.
  // builder is the function that build the UPDATE or CREATE query