Documentation
¶
Index ¶
Constants ¶
const PluginName = "sql_v2"
PluginName is the catalog name of the GORM v2 SQL datastore.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is a SQL datastore backed by GORM v2. It holds a read-write connection and, when ro_connection_string is set, a read-only one.
func New ¶
func New(log logrus.FieldLogger) *Plugin
New returns an unconfigured Plugin. Configure must be called before use.
func (*Plugin) Close ¶
Close closes the read-write and read-only connections if open. It is safe to call multiple times.
func (*Plugin) Configure ¶
Configure parses the HCL config, validates it, and opens the connection(s).
func (*Plugin) RawScan ¶
RawScan runs a raw query on the read-write connection and scans the result into dest. It holds ds.mu for the whole query so a concurrent Configure or Close cannot swap or close the connection mid-scan. It is intended for tests, so blocking a reconfigure for the duration is acceptable.