sqlite3

package module
Version: v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 5 Imported by: 0

README

sqlite3

GoDoc Tesst Go Report Card codecov Gitter chat

SQLite3 adapter for REL.

Example

package main

import (
	"context"

	_ "github.com/mattn/go-sqlite3"
	"github.com/go-rel/sqlite3"
	"github.com/go-rel/rel"
)

func main() {
	// open sqlite3 connection.
	adapter, err := sqlite3.Open("dev.db")
	if err != nil {
		panic(err)
	}
	defer adapter.Close()

	// initialize rel's repo.
	repo := rel.New(adapter)
	repo.Ping(context.TODO())
}

Supported Driver

  • github.com/mattn/go-sqlite3

Documentation

Overview

Package sqlite3 wraps go-sqlite3 driver as an adapter for rel.

Usage:

// open sqlite3 connection.
adapter, err := sqlite3.Open("dev.db")
if err != nil {
	panic(err)
}
defer adapter.Close()

// initialize rel's repo.
repo := rel.New(adapter)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(database *db.DB) rel.Adapter

New sqlite3 adapter using existing connection.

func Open

func Open(dsn string) (rel.Adapter, error)

Open sqlite3 connection using dsn.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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