memory

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package memory provides a concurrency-safe adapter for tests, examples, and ephemeral development. It is not durable storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func New

func New() *Adapter

New returns an empty adapter that enforces the core schema's unique fields and indexes. A server calls WithSchema to replace them with the rules of its merged schema.

func (*Adapter) Capabilities

func (a *Adapter) Capabilities() betterauth.AdapterCapabilities

func (*Adapter) ConsumeOne

func (a *Adapter) ConsumeOne(_ context.Context, query betterauth.DeleteQuery) (betterauth.Record, error)

func (*Adapter) Count

func (a *Adapter) Count(ctx context.Context, query betterauth.CountQuery) (int64, error)

func (*Adapter) Create

func (*Adapter) Delete

func (a *Adapter) Delete(_ context.Context, query betterauth.DeleteQuery) error

func (*Adapter) DeleteMany

func (a *Adapter) DeleteMany(_ context.Context, query betterauth.DeleteQuery) (int64, error)

func (*Adapter) FindMany

func (*Adapter) FindOne

func (*Adapter) ID

func (a *Adapter) ID() string

func (*Adapter) IncrementOne

func (a *Adapter) IncrementOne(_ context.Context, query betterauth.IncrementQuery) (betterauth.Record, error)

func (*Adapter) Transaction

func (a *Adapter) Transaction(_ context.Context, callback func(betterauth.DatabaseAdapter) error) error

func (*Adapter) Update

func (*Adapter) UpdateMany

func (a *Adapter) UpdateMany(_ context.Context, query betterauth.UpdateQuery) (int64, error)

func (*Adapter) WithSchema added in v1.1.0

func (a *Adapter) WithSchema(schema betterauth.Schema) (betterauth.DatabaseAdapter, error)

WithSchema returns an adapter that shares this adapter's data and enforces the unique fields and unique compound indexes of the given logical schema, using their stored model and field names.

Jump to

Keyboard shortcuts

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