db

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package db facades the creation of different db connections and adapter imports in order to return a generalised db type. This makes it easier to create a new db connection throughout the application without having to worry about imports. Full documentatation: https://upper.io/v4/getting-started/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Dialect string
	Session upper.Session
}

func NewConnection

func NewConnection(c DatabaseConfig, path ...string) (*Database, error)

NewConnection takes in a database configuration, for sqlite a single full file path, returns a new database connection layer.

type DatabaseConfig

type DatabaseConfig struct {
	Dialect  string
	User     string
	Password string
	Host     string
	Port     string
	Name     string
	Options  Options
}

type Options

type Options struct {
	SSLmode                string
	TrustServerCertificate string
}

Jump to

Keyboard shortcuts

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