package dbconf

import "github.com/cloudflare/cfssl/certdb/dbconf"

Index

Functions

func DBFromConfig

func DBFromConfig(path string) (db *sqlx.DB, err error)

DBFromConfig opens a sql.DB from settings in a db config file

Types

type DBConfig

type DBConfig struct {
	DriverName     string `json:"driver"`
	DataSourceName string `json:"data_source"`
}

DBConfig contains the database driver name and configuration to be passed to Open

func LoadFile

func LoadFile(path string) (cfg *DBConfig, err error)

LoadFile attempts to load the db configuration file stored at the path and returns the configuration. On error, it returns nil.

Source Files

db_config.go

Version
v1.4.0-rc1
Published
Oct 30, 2019
Platform
js/wasm
Imports
6 packages
Last checked
2 minutes ago

Tools for package owners.