Documentation
¶
Rendered for js/wasm
Index ¶
Constants ¶
View Source
const ( // DefaultNumTxRetries is the default number of times we'll retry a // transaction if it fails with an error that permits transaction // repetition. DefaultNumTxRetries = 50 )
Variables ¶
This section is empty.
Functions ¶
func NewSqlBackend ¶
NewSqlBackend returns a db object initialized with the passed backend config. If database connection cannot be established, then returns error.
Types ¶
type Config ¶
type Config struct {
// DriverName is the string that defines the registered sql driver that
// is to be used.
DriverName string
// Dsn is the database connection string that will be used to connect
// to the db.
Dsn string
// Timeout is the time after which a query to the db will be canceled if
// it has not yet completed.
Timeout time.Duration
// Schema is the name of the schema under which the sql tables should be
// created. It should be left empty for backends like sqlite that do not
// support having more than one schema.
Schema string
// TableNamePrefix is the name that should be used as a table name
// prefix when constructing the KV style table.
TableNamePrefix string
// SQLiteCmdReplacements define a one-to-one string mapping of sql
// keywords to the strings that should replace those keywords in any
// commands. Note that the sqlite keywords to be replaced are
// case-sensitive.
SQLiteCmdReplacements SQLiteCmdReplacements
// WithTxLevelLock when set will ensure that there is a transaction
// level lock.
//
// NOTE: Temporary, should be removed when all parts of the LND code
// are more resilient against concurrent db access..
WithTxLevelLock bool
}
Config holds a set of configuration options of a sql database connection.
type SQLiteCmdReplacements ¶
SQLiteCmdReplacements is a one to one mapping of sqlite keywords that should be replaced by the mapped strings in any command. Note that the sqlite keywords to be replaced are case-sensitive.
Click to show internal directories.
Click to hide internal directories.