workspacedb

package
v0.3.0-beta.21 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package workspacedb owns per-workspace SQLite database lifecycle helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrationStream

func MigrationStream() store.MigrationStream

MigrationStream returns the embedded workspace database migration stream.

Types

type DB

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

DB is an open per-workspace Compozy database handle.

func Open

func Open(ctx context.Context, opts Options) (*DB, error)

Open resolves the workspace identity and opens <workspace>/.compozy/compozy.db.

func OpenWorkspace

func OpenWorkspace(ctx context.Context, workspaceRoot string) (*DB, error)

OpenWorkspace opens a workspace database using its package-owned schema stream.

func (*DB) Close

func (d *DB) Close(ctx context.Context) error

Close checkpoints the WAL and closes the database.

func (*DB) DB

func (d *DB) DB() *sql.DB

DB exposes the underlying SQL handle for storage packages.

func (*DB) Path

func (d *DB) Path() string

Path reports the database path.

func (*DB) WorkspaceID

func (d *DB) WorkspaceID() string

WorkspaceID reports the resolved workspace identity.

func (*DB) WorkspaceRoot

func (d *DB) WorkspaceRoot() string

WorkspaceRoot reports the workspace root used to open the database.

type Options

type Options struct {
	WorkspaceRoot string
}

Options configures a per-workspace database open.

Directories

Path Synopsis
Package schema embeds the workspace database schema and migration directory.
Package schema embeds the workspace database schema and migration directory.

Jump to

Keyboard shortcuts

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