// Returning specifies the returning columns for postgres.
555462
func (b *InsertStmt) Returning(column ...string) *InsertStmt {
	b.ReturnColumn = column
	return b
}
1358235
func (m Method) ReturnTypes() []string {
	sig := m.signature()
	return m.listTypes(sig.Results())
}
48146
func (p autoProvider) ReturnType() reflect.Type {
	return reflect.TypeOf(p.constructor).Out(0)
}
568848
func (v *Function) GetReturnType() (o *Type) {
	if v != nil && v.ReturnType != nil {
		return v.ReturnType
	}

	return
}
973829
func (statement *Statement) SQL(query interface{}, args ...interface{}) *Statement {
	switch query.(type) {
	case (*builder.Builder):
		var err error
		statement.RawSQL, statement.RawParams, err = query.(*builder.Builder).ToSQL()
		if err != nil {
			statement.lastError = err
		}
	case string:
		statement.RawSQL = query.(string)
		statement.RawParams = args
	default:
		statement.lastError = ErrUnSupportedSQLType
	}

	return statement
}
1000096
func (rc *SQLiteRows) Columns() []string {
	rc.s.mu.Lock()
	defer rc.s.mu.Unlock()
	if rc.s.s != nil && rc.nc != len(rc.cols) {
		rc.cols = make([]string, rc.nc)
		for i := 0; i < rc.nc; i++ {
			rc.cols[i] = C.GoString(C.sqlite3_column_name(rc.s.s, C.int(i)))
		}
	}
	return rc.cols
}
451467
func (m *PostgreSQLBackend) Get(ctx context.Context, fullPath string) (*physical.Entry, error) {
	defer metrics.MeasureSince([]string{"postgres", "get"}, time.Now())

	m.permitPool.Acquire()
	defer m.permitPool.Release()

	_, path, key := m.splitKey(fullPath)

	var result []byte
	err := m.client.QueryRow(m.get_query, path, key).Scan(&result)
	if err == sql.ErrNoRows {
		return nil, nil
	}
	if err != nil {
		return nil, err
	}

	ent := &physical.Entry{
		Key:   fullPath,
		Value: result,
	}
	return ent, nil
}
296569
func (db *readTraceDB) Get(k []byte) ([]byte, error) {
	if db.reads == nil {
		db.reads = make(map[string]struct{})
	}
	db.reads[string(k)] = struct{}{}
	return db.db.Get(k)
}
1172851
func (b *SelectBuilder) Columns(columns ...string) *SelectBuilder {
	b.columns = append(b.columns, columns...)
	return b
}
842444
func (d *Dataset) sql(table, dbType string) *Exportable {
	b := newBuffer()

	tableSQL, columnTypes, columnValues := d.createTable(table, dbType)
	b.WriteString(tableSQL)

	reg, _ := regexp.Compile("[']")
	// inserts
	for i := range d.data {
		b.WriteString("INSERT INTO " + table + " VALUES(" + strconv.Itoa(i+1) + ", ")
		for j, col := range d.headers {
			asStr := d.asString(columnValues[col][i])
			if isStringColumn(columnTypes[col]) {
				b.WriteString("'" + reg.ReplaceAllString(asStr, "''") + "'")
			} else if strings.HasPrefix(columnTypes[col], "TIMESTAMP") {
				if dbType == typeMySQL {
					b.WriteString("CONVERT_TZ('" + asStr[:10] + " " + asStr[11:19] + "', '" + asStr[len(asStr)-6:] + "', 'SYSTEM')")
				} else {
					b.WriteString("'" + asStr + "'") // simpler with Postgres
				}
			} else {
				b.WriteString(asStr)
			}
			if j < len(d.headers)-1 {
				b.WriteString(", ")
			}
		}
		b.WriteString(");\n")
	}
	b.WriteString("\nCOMMIT;\n")

	return newExportable(b)
}
662328
func (pr Properties) Get(row int, column string) string {
	var columnIdx int
	for i, key := range pr.Header {
		if key == column {
			columnIdx = i
		}
	}
	return pr.DataFrame[row][columnIdx]
}
694834
func (s *orderService) Return(ctx context.Context, req *orderpb.ReturnRequest) (*orderpb.Order, error) {
	// validate input
	if err := validation.Validate(req); err != nil {
		return nil, err
	}
	// order wrapper
	o := &order{
		Order: orderpb.Order{
			Id: req.GetId(),
		},
	}
	// lock order
	unlock, err := locker.Handler().TryLock(o, locker.DefaultTimeout)
	if err != nil {
		return nil, err
	}
	defer unlock()

	// get order
	if err := storage.Handler().One(o); err != nil {
		return nil, status.Error(codes.Internal, err.Error())
	}
	// calculate returns amount
	amount, err := calculateTotal(o.GetCurrency(), o.GetItems())
	if err != nil {
		return nil, err
	}
	// check if order can be refunded
	if err := o.IsReturnable(amount); err != nil {
		return nil, err
	}
	// lock all inventory order items (inventory objects)
	lockedItems := getLockedOrderItems(ctx, &o.Order)
	// Free all locks at func return
	defer func() {
		for _, item := range lockedItems {
			item.Unlock()
		}
	}()
	// refund the order
	if _, err := payment.Service().RefundCharge(ctx, &paymentpb.RefundRequest{Id: o.GetChargeId(), Amount: uint64(amount)}); err != nil {
		return nil, err
	}
	// update order status
	switch o.Status {
	// if the order has been paid but never fulfilled
	// order status turns from paid into canceled
	// inventory item will get updated since the sku is in
	// stock again
	case orderpb.Order_Paid:
		o.Status = orderpb.Order_Canceled
		// notify listeners we want to return the items back in inventory
		// update inventories
		for _, item := range lockedItems {
			if item.Sku.Inventory.Type == skupb.Inventory_Finite {
				// update inventory Quantity
				item.Sku.Inventory.Quantity += item.OrderItem.Quantity
				item.Update()
			}
		}
		// if the order has been fulfilled
		// order status turns from fulfilled into returned
		// inventory will not get updated since we still got no
		// item to sell again
	case orderpb.Order_Fulfilled:
		o.Status = orderpb.Order_Returned
	}
	// update order with retries
	updateErr := util.Retry(func() error {
		return storage.Handler().Update(o)
	})
	// return err
	if updateErr != nil {
		return nil, status.Error(codes.DataLoss, fmt.Sprintf("could not update order {%s} object, order has been refunded {%s}!", o.Id, o.ChargeId))
	}
	// return order
	return &o.Order, nil
}
1279786
func (g *Group) Return(results ...Code) *Statement {
	s := Return(results...)
	g.items = append(g.items, s)
	return s
}
1254646
def returner(ret):
    '''
    
    '''
    try:
        with _get_serv(ret, commit=True) as cur:
            sql = '''INSERT INTO salt_returns
                    (fun, jid, return, id, success, full_ret, alter_time)
                    VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s))'''

            cur.execute(sql, (ret['fun'], ret['jid'],
                              psycopg2.extras.Json(ret['return']),
                              ret['id'],
                              ret.get('success', False),
                              psycopg2.extras.Json(ret),
                              time.time()))
    except salt.exceptions.SaltMasterError:
        log.critical('Could not store return with pgjsonb returner. PostgreSQL server unavailable.')
561876
func (c *Call) Return(returnArguments ...interface{}) *Call {
	c.lock()
	defer c.unlock()

	c.ReturnArguments = returnArguments

	return c
}
620500
func NewReturn(Expr node.Node) *Return {
	return &Return{
		FreeFloating: nil,
		Expr:         Expr,
	}
}
452203
func (t *Transaction) Return(resultVar string) *Transaction {
	t.returnVar = resultVar
	return t
}