dbspec

package
v0.0.0-...-6ec82fb Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package dbspec implements a string notation for referring to a database. A DB specification can take one of these forms:

pebble:DIR[~VECTOR_NAMESPACE]

A Pebble database in the directory DIR.
DIR can be relative or absolute.

firestore:PROJECT,DATABASE[~VECTOR_NAMESPACE]

A Firestore DB in the given GCP project and Firestore database.

mem[~VECTOR_NAMESPACE]

An in-memory database.

If a VECTOR_NAMESPACE is present, the spec refers to the vector DB portion of the database. The namespace can be empty, in which case the spec ends with a '~'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	Kind      string // "pebble", "firestore", etc.
	Location  string // directory, project, etc.
	Name      string // database name, for firestore
	IsVector  bool   // spec refers to the vector part of the database
	Namespace string // namespace of vector DB, possibly empty
}

A Spec is the parsed representation of a DB specification string.

func Parse

func Parse(s string) (_ *Spec, err error)

Parse parses a DB specification string into a Spec.

func (*Spec) Open

func (s *Spec) Open(ctx context.Context, lg *slog.Logger) (storage.DB, error)

Open opens the database described by the spec.

func (*Spec) String

func (s *Spec) String() string

Jump to

Keyboard shortcuts

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