norm

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 2 Imported by: 1

README

NORM

test Go Report Card Go Reference

NORM is Not an ORM.

It does:

  • provide a unified CRUD API for your queries;
  • use generics for your types;
  • not generate SQL migrations;
  • not generate queries from structs;
  • not manage transactions.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound    = errors.New("not found")
	ErrNotAffected = errors.New("not affected by create/update")
)

Functions

This section is empty.

Types

type Creator added in v0.0.2

type Creator[M, A any] interface {
	Create(ctx context.Context, key A, value M) error
}

type Deleter added in v0.0.2

type Deleter[M, A any] interface {
	Delete(ctx context.Context, args A) error
}

type ImmutableObject

type ImmutableObject[M, A any] interface {
	Creator[M, A]
	Reader[M, A]
}

type Object

type Object[M, A any] interface {
	Creator[M, A]
	Reader[M, A]
	Updater[M, A]
	Deleter[M, A]
}

type PersistentObject

type PersistentObject[M, A any] interface {
	Creator[M, A]
	Reader[M, A]
	Updater[M, A]
}

type Reader added in v0.0.2

type Reader[M, A any] interface {
	Read(ctx context.Context, args A) (value M, err error)
}

type Updater added in v0.0.2

type Updater[M, A any] interface {
	Update(ctx context.Context, args A, value M) error
}

type View

type View[M, A any] interface {
	Reader[M, A]
}

Directories

Path Synopsis
driver
sql module

Jump to

Keyboard shortcuts

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