tinysqlite

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package tinysqlite provides utilities for handling sqlite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*gorm.DB
}

Client is a wrapper for *gorm.DB providing a handy Close() function.

func Open

func Open(dsn string, opts ...Opt) (*Client, error)

Open tries to open an instance of sqlite3 database and then return Client instance to interact with it.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying sqlite database.

type Config

type Config struct {
	// Verbose specifies whether to log all executed queries.
	Verbose bool
	// contains filtered or unexported fields
}

Config holds a configuration for Client.

type Opt

type Opt = func(*Config)

Opt is an option to be specified to DialPostgres.

func GormOpt

func GormOpt(gormOpt func(*gorm.Config)) Opt

GormOpt adds an option to modify the default gorm.Config.

func Verbose

func Verbose(verbose bool) Opt

Verbose specifies whether to log all executed queries.

Jump to

Keyboard shortcuts

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