molecule

module
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: LGPL-2.1

README

Molecule

Molecule is a Go library designed to perform complex database operations across multiple tables as a single, atomic unit. It treats the database as a graph of "Atoms" (tables) and executes actions based on defined relationships.

GoDoc

Overview

Molecule abstracts database interactions into high-level actions, allowing you to:

  • Define relationships between tables (Atoms).
  • Execute complex, multi-table transactions (Molecules) via a simple API.
  • Support RESTful-like operations (Insert, Update, Delete, Select/Topics) across the entire database graph.

Packages

The project is organized into three main packages:

1. godbi

The core engine of the library.

  • Defines the Molecule, Atom, and Action structures.
  • Handles the execution logic for database operations.
  • Key Features: Stateless execution, RunOption configuration, and support for custom actions.
2. rdb

Relational Database adapters and utilities.

  • Provides tools to automatically generate a Molecule structure from an existing database schema.
  • Supported Databases: PostgreSQL, MySQL, SQLite.
  • Useful for bootstrapping a Molecule configuration from legacy databases.
3. gometa

Metadata and Protobuf integration.

  • Defines the Graph structure using Protocol Buffers.
  • Provides utilities to convert between Molecule (Go structs) and Graph (Protobuf) representations.
  • Enables serialization and transport of database schemas and action definitions.

Installation

go get github.com/genelet/molecule

Usage

Please refer to the README files in each subdirectory for detailed usage instructions and examples.

Directories

Path Synopsis
Package godbi provides a generic database interface
Package godbi provides a generic database interface

Jump to

Keyboard shortcuts

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