mattn/go-sqlite3

Feature: BEGIN immediate/exclusive per transaction

开放

#400 创建于 2017年3月25日

 (16 条评论) (1 个反应) (0 位负责人)C (1,105 个派生)batch import
enhancementhelp wantedresearch

仓库指标

星标
 (7,000 个星标)
PR 合并指标
 (平均合并 1天 5小时) (30 天内合并 9 个 PR)

描述

Right now, the _txlock connection parameter determines which BEGIN statement is used to start a transaction. I'd like to be able to pick this at a per-transaction level. I don't think there's a way of exposing this functionality to database/sql, but it would be good to add an option there eventually. I'm imagining adding:

func (c *SQLiteConn) BeginWithType(t TransactionType) (driver.Tx, error)

type TransactionType int

const (
  Deferred TransactionType = iota
  Immediate
  Exclusive
)

Relevant SO post: https://stackoverflow.com/questions/42657639/begin-immediate-in-sqlx-or-database-sql-golang

贡献者指南