database

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver Driver
	DSN    string
}

type DBType

type DBType string
const (
	SQL   DBType = "sql"
	NoSQL DBType = "nosql"
)

type Database

type Database struct {
	*gorm.DB
}

func NewDatabase

func NewDatabase(config Config) (Database, error)

type DatabaseDriver

type DatabaseDriver struct {
	Type   DBType
	Driver string
}

func MapDriver

func MapDriver(name string) (DatabaseDriver, bool)

type Driver

type Driver string
const (
	DriverPostgresql Driver = "postgresql"
	DriverSqlite     Driver = "sqlite"
	DriverMysql      Driver = "mysql"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL