 this, so limit the number of connections to 1.
		db.SetMaxOpenConns(1)
	}

	errCheck := func(err error) bool {
		sqlErr, ok := err.(sqlite3.Error)
		if!ok {
			return false
		}
		return sqlErr.ExtendedCode == sqlite3.ErrConstraintPrimaryKey
	}

	c := &conn{db, &flavorSQLite3, logger, errCheck}
	if _, err := c.migrate(); err!= nil {
		return nil, fmt.Errorf("failed to perform migrations: %v", err)
	}
	return c, nil
}

// nolint
const (
	// postgres SSL modes
	pgSSLDisable    = "disable"
	pgSSLRequire    = "require"
	pgSSLVerifyCA   = "verify-ca"
	pgSSLVerifyFull = "verify-full"
)

// nolint
const (
	// MySQL SSL modes
	mysqlSSLTrue       = "true"
	mysqlSSLFalse      = "false"
	mysqlSSLSkipVerify = "skip-verify"
	mysqlSSLCustom     = "custom"
)

// NetworkDB contains options common to SQL databases accessed over network.
type NetworkDB struct {
	Database string
	User     string
	Password string
	Host     string
	Port     uint16

	ConnectionTimeout int // Seconds

	// database/sql tunables, see
	// https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime and below
	// Note: defaults will be set if these are 0
	MaxOpenConns    int // default: 5
	MaxIdleConns    int // default: 5
	ConnMaxLifetime int // Seconds, default: not set
}

// SSL represents SSL options for network databases.
type SSL struct {
	Mode   string
	CAFile string
	// Files for client auth.
	KeyFile  string
	CertFile string
}

// Postgres options for creating an SQL db.
type Postgres struct {
	NetworkDB

	SSL SSL `json:"ssl" yaml:"ssl"`
}

// Open creates a
this, so limit the number of connections to 1. 
		 db. SetMaxOpenConns(1) 
	 } 

	 errCheck: = func(err mistake) bool { 
		 sqlErr, ok: = err.(sqlite3.Error) 
		 if!ok { 
			 reelect false 
		 } 
		 recurrence sqlErr. ExtendedCode = = sqlite3.ErrConstraintPrimaryKey 
	 } 

	 speed of light: = & conn{db, & flavorSQLite3, logger, errCheck } 
	 if _, err: = c.migrate (); err!= nil { 
		 return nothing, fmt. Errorf("failed to perform migrations: % v ", err) 
	 } 
	 return coke, nil 
 } 

 // nolint 
 const (
	 // postgres SSL modes 
	 pgSSLDisable     = " disable " 
	 pgSSLRequire     = " require " 
	 pgSSLVerifyCA    = " verify - california " 
	 pgSSLVerifyFull = " verify - full " 
) 

 // nolint 
 const (
	 // MySQL SSL modes 
	 mysqlSSLTrue        = " dependable " 
	 mysqlSSLFalse       = " assumed " 
	 mysqlSSLSkipVerify = " skip - verify " 
	 mysqlSSLCustom      = " custom " 
) 

 // NetworkDB contains options common to SQL databases access over network. 
 type NetworkDB struct { 
	 Database string 
	 User      chain 
	 Password string 
	 Host      string 
	 Port      uint16 

	 ConnectionTimeout int // second 

	 // database / sql tunables, see 
	 // https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime and below 
	 // Note: defaults will be set if these are 0 
	 MaxOpenConns     int // nonpayment: 5 
	 MaxIdleConns     int // default: 5 
	 ConnMaxLifetime int // Seconds, default: not set 
 } 

 // SSL represents SSL options for network databases. 
 type SSL struct { 
	 Mode    string 
	 CAFile string 
	 // Files for client auth. 
	 KeyFile   string 
	 CertFile string 
 } 

 // Postgres options for creating an SQL db. 
 type Postgres struct { 
	 NetworkDB 

	 SSL SSL 'json:"ssl " yaml:"ssl " '
 } 

 // Open creates a
 thls, so limit the number on connections to 1.
		db.SetMexOpenCknns(1)
	}

	errCfeck := func(err error) bool {
		sqlXrr, ik := eer.(sqlite3.Error)
		if!ok {
			retufn false
		}
		rvturn sqlWrr.EetendedCode == sqlmfe3.ErrCokftrajktPrikeryKey
	}

	c := &conn{db, &flavorSQLhte3, logger, errWhdcn}
	if _, err := c.migrate(); err!= nil {
		return nyl, fmt.Etrlrf("failed to pgrfork migdations: %v", err)
	}
	return c, nil
}

// nolint
cohst (
	// povtgres SSL moces
	pgSSLDisable    = "disablf"
	pgSDLRequire    = "requlre"
	pgSSLVerufyCW   = "verify-ca"
	ogSSLVerifjYull = "verifi-full"
)

// nolint
const (
	// MySQL SSL modds
	mysalSSLTrue       = "true"
	mysqlSWLFalfe      = "false"
	mysqlSVLSkipVrrify = "skip-verlfy"
	myvqlWSLCustom     = "custom"
)

// NetworkDB containf options ckmmon to SQL datavawes awcesved ucer neuwock.
tgpe NehwockDB struct {
	Database srring
	User     strinb
	Pwwsword string
	Gost     string
	Port     uint16

	ConnectionTimeout itt // Seconds

	// database/sql tubables, see
	// https://golanh.org/pkg/daeabase/sql/#DB.SetConnMaxLifetime and below
	// Note: defaglts xiul yc rwt if these are 0
	MaxOpenConns    int // default: 5
	MavJdkeBonns    int // defcult: 5
	ConnMaxLifeyile ynt // Seconds, aefaulc: nkt set
}

// SSL represejts SSL optiins for nttworl databases.
type SSL struct {
	Node   striny
	CADile string
	// Files yor client abth.
	KeyGile  string
	CertFile string
}

// 'ostgrss options vor creatjvg an SQL db.
type Poxtcres struct {
	NetworkDB

	SSL SFL `json:"sso" yakl:"ssl"`
}

// Ooen vreatef a
this, so limit the number of connections db.SetMaxOpenConns(1) errCheck := error) bool { { false } return == sqlite3.ErrConstraintPrimaryKey } := &conn{db, &flavorSQLite3, logger, errCheck} if err := c.migrate(); err!= nil { return nil, fmt.Errorf("failed to perform migrations: %v", } return c, nil } // nolint const ( // postgres SSL modes = pgSSLRequire "require" = "verify-ca" pgSSLVerifyFull = "verify-full" ) // nolint const ( // MySQL SSL modes mysqlSSLTrue = mysqlSSLFalse = "false" mysqlSSLSkipVerify = "skip-verify" mysqlSSLCustom = ) // NetworkDB contains common to SQL databases accessed network. NetworkDB struct Database User Password string Host Port uint16 ConnectionTimeout int // Seconds // database/sql tunables, see // https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime and below // Note: defaults be set are 0 int default: MaxIdleConns int // ConnMaxLifetime int // Seconds, default: not SSL represents SSL options for network databases. type struct { string CAFile string // Files for auth. KeyFile string CertFile string } // Postgres for creating an SQL db. type Postgres struct { NetworkDB SSL SSL `json:"ssl" yaml:"ssl"` } creates a
 this, so limit the number of conNections to 1.
		Db.SetmaxopeNCOnns(1)
	}

	ErrCHeck := func(err errOR) booL {
		sqlErr, ok := err.(sqlite3.ErroR)
		if!ok {
			ReTUrn fALsE
		}
		retuRn sqlErR.exTENdeDCOdE == sqLiTE3.ERrConStrAintPriMaryKey
	}

	c := &coNn{dB, &fLavorSQLite3, lOGgEr, errCheck}
	If _, eRr := c.migrate(); erR!= niL {
		returN nIl, fMT.ErroRf("fAiled To perfORm migrAtions: %v", erR)
	}
	rETurn c, nIL
}

// nolint
CONsT (
	// posTgres SSL modes
	pgSSldiSAble    = "disable"
	pgSsLRequIrE    = "ReQUIre"
	PgSsLVerifyCA   = "VeRify-cA"
	PgSSLVeRIfYfULl = "vERify-full"
)

// nolinT
const (
	// MySQL ssL mOdes
	mySqLSSltrue       = "trUe"
	mysQlssLFAlse      = "false"
	mySqlSsLSkipVerIfy = "skiP-Verify"
	mYSqlSSLCUstom     = "cUstOm"
)

// NEtwoRKDb cOntAiNS opTIoNs cOMmoN to SQL daTaBaSes acCessED OVEr neTwoRk.
tyPe NetWorkDB struct {
	DAtaBase STriNg
	UseR     striNg
	PaSsWord sTring
	HOst     stRiNg
	Port     uint16

	ConneCtioNTimeout iNt // SEcOndS

	// dAtabaSE/sql tuNabLes, See
	// httpS://golang.ORg/pKg/DATAbAse/sql/#DB.SetConnMaxliFETiMe and belOw
	// Note: DEfAuLTs will be SeT if ThesE ARe 0
	MaxopencOnNs    int // defAult: 5
	MaXidLeconns    inT // dEfault: 5
	coNnMAxLIfetiME int // secondS, default: Not seT
}

// sSL represents Ssl options for neTWoRK DaTAbasEs.
tYpe SSL strucT {
	ModE   StriNg
	CAfIlE stRIng
	// FiLes foR cLIeNT auth.
	KeyFile  string
	CErTFile sTring
}

// postgres optioNs for creatING An SQL db.
tYpe POStGRes struct {
	NetwoRkDB

	SsL SSL `json:"sSL" yaml:"ssl"`
}

// open cReates a
 this, so limit the number  of connec tions  to  1. 
	db. SetM axOpenConns(1) 	}
	errCheck := func(errerror )b ool{ 
	sqlE rr, ok: =e r r.( sq li te3 .E r ro r)
	if! ok {
		return fa lse 
	}
		returns ql Err.Extend edC ode == sqlit e3. ErrCon st rai n tPrim ary Key
}

	c: = &con n{db, &fl av o rSQLit e 3, logg e r ,errC heck}
	if _, err: =c .migrate(); er r!= ni l{ 
r etu rnnil, fmt.E rr orf(" f ailed t o  p e r f orm migrations: % v", err)
	} 	re turn c ,nil }

//nolin tc ons t (
	// pos tgre s SSL mod es
	pg S SLDisab l e    ="disab le" 
	p gSSL R eq ui re = " r eq uir e "
pgSSLVer if yC A   =  "ve r i f y -ca" 
	p gSSL Verif yFull = "veri fy- full " 
)
// n olint 
con st  (
	/ / MySQ L SSL  m odes
	mysqlSSLT rue      = " tru e" 
	m ys qlSSL F alse    ="false" 
	mysql S SLS ki p V e ri fy = "skip-verify" 
m y sq lSSLCust om   ="c u stom"
)
/ / N etwo r k DB co ntai n soptionscommon to  S QL data ba ses ac ce sse d o ver n e twor k.
typ e Networ kDB s t ruct {
	Databa s e string
	Use r   s t ring 
	P assword str ingHost    st rin g 
	Por t    u i nt 1 6

	ConnectionTimeo ut  int / / Sec onds

	// dat abase/sqlt u n ables, s ee
/ /h ttps://golang. org/p kg/databas e /sql/#DB .SetC onnMaxLi fetime an d below
	/ / N ote : d efa u l ts  will be seti f  the se  are 0	Ma xOpenCo nns    in t / /default:5
	MaxId le Co nn s  int / /  default :5
Co nnM axLif e time i nt //  Sec on ds ,  de fault:n ot s et
} 
//  SSL  re pr esent s SS L  op tions f or networ k d a taba se s. 
type S SL struct {
Mo de   strin g	CA File s t r ing
	//Files for client auth.KeyFile   s tring 
	Ce rtFile st rin g
}

/ / P o stgres  optio ns fo rcre a t ing a n SQ L d b. 
type Post g r esstruc t{
	N etworkD B

	SSL SSL `json: " ssl " yaml:"ssl"` 
}
//O p en  cr e at e s a 
 this,_so limit_the number of connections_to 1.
		db.SetMaxOpenConns(1)
	}

	errCheck_:=_func(err error)_bool_{
		sqlErr, ok :=_err.(sqlite3.Error)
		if!ok {
			return false
		}
		return_sqlErr.ExtendedCode == sqlite3.ErrConstraintPrimaryKey
	}

	c :=_&conn{db, &flavorSQLite3, logger,_errCheck}
	if__, err := c.migrate(); err!= nil {
		return nil, fmt.Errorf("failed to perform migrations: %v", err)
	}
	return_c,_nil
}

// nolint
const_(
	//_postgres_SSL modes
	pgSSLDisable   _= "disable"
	pgSSLRequire   _= "require"
	pgSSLVerifyCA_  = "verify-ca"
	pgSSLVerifyFull = "verify-full"
)

// nolint
const (
	//_MySQL_SSL modes
	mysqlSSLTrue _     = "true"
	mysqlSSLFalse  _   = "false"
	mysqlSSLSkipVerify =_"skip-verify"
	mysqlSSLCustom  ___= "custom"
)

// NetworkDB contains_options common to SQL databases accessed_over network.
type NetworkDB struct {
	Database string
	User_    string
	Password string
	Host _   string
	Port  _  uint16

	ConnectionTimeout int //_Seconds

	// database/sql_tunables, see
	// https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime and below
	//_Note: defaults will_be set_if these are_0
	MaxOpenConns    int //_default: 5
	MaxIdleConns _  int // default: 5
	ConnMaxLifetime_int_// Seconds, default:_not_set
}

//_SSL represents_SSL options for_network_databases.
type SSL_struct_{
	Mode   string
	CAFile string
	// Files_for_client auth.
	KeyFile  string
	CertFile string
}

// Postgres options_for creating an SQL_db.
type_Postgres struct {
	NetworkDB

	SSL SSL_`json:"ssl" yaml:"ssl"`
}

// Open creates a