Sha256: ebb8e9007d0d9f5373f69215d75fdaf61a8722f1635ac15b26ad58bf10454851

Contents?: true

Size: 757 Bytes

Versions: 16

Compression:

Stored size: 757 Bytes

Contents

// Copyright (c) 2017-2022 Snowflake Computing Inc. All rights reserved.

package gosnowflake

import (
	"database/sql/driver"
)

type snowflakeTx struct {
	sc *snowflakeConn
}

func (tx *snowflakeTx) Commit() (err error) {
	if tx.sc == nil || tx.sc.rest == nil {
		return driver.ErrBadConn
	}
	_, err = tx.sc.exec(tx.sc.ctx, "COMMIT", false /* noResult */, false /* isInternal */, false /* describeOnly */, nil)
	if err != nil {
		return
	}
	tx.sc = nil
	return
}

func (tx *snowflakeTx) Rollback() (err error) {
	if tx.sc == nil || tx.sc.rest == nil {
		return driver.ErrBadConn
	}
	_, err = tx.sc.exec(tx.sc.ctx, "ROLLBACK", false /* noResult */, false /* isInternal */, false /* describeOnly */, nil)
	if err != nil {
		return
	}
	tx.sc = nil
	return
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/snowflakedb/gosnowflake/transaction.go