rdb

package
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 Imports: 11 Imported by: 0

README

molecule/rdb

In molecule, a table and its associated actions build up an atom. Atoms and relationships between them build up a molecule. While traditional REST acts on individual table, molecule acts on whole RDB across all tables.



Molecule Creation

This package generates automatically a simple molecule from relational database, using meta data such as primary keys, foreign keys, and auto increment fields etc.

Currently only the following three database types are supported: godbi.Postgres, godbi.MySQL and godbi.SQLite.

func NewMolecule(db *sql.DB, driver godbi.DBType, dbName string) (*godbi.Molecule, error)

where db is the standard database handler, driver the DBType defined in Molecule and dbName the name of database.

After molecule is created, we can run RESTful actions on multiple tables at once.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMolecule

func NewMolecule(db *sql.DB, driver godbi.DBType, dbName string) (*godbi.Molecule, error)

NewMolecule returns a molecule of database using primary keys, foreign keys and auto increment numbers etc. The arguments are:

db: the standard database handler driver: the DBType defined in molecule. Currently only the three databases are supported, godbi.Postgres, godbi.MySQL and godbi.SQLite dbName: the name of database

Types

This section is empty.

Jump to

Keyboard shortcuts

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