Documentation ¶
Overview ¶
Package enumdb allows loading enumeration sets (github.com/Vonage/gosrvlib/pkg/enumcache) from multiple database tables.
Each enumeration has a numerical ID ("id" on the database table as the primary key) and a string name ("name" on the database table as a unique string).
Example of a MySQL database table that can be used with this package:
CREATE TABLE IF NOT EXISTS `example` ( `id` SMALLINT UNSIGNED NOT NULL, `name` VARCHAR(50) NOT NULL, `disabled` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE INDEX `id_UNIQUE` (`id` ASC), UNIQUE INDEX `name_UNIQUE` (`name` ASC)) ENGINE = InnoDB COMMENT = 'Example enumeration table';
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnumTableQuery ¶
EnumTableQuery maps each enumeration table name with the SQL query string used to read the data.
Click to show internal directories.
Click to hide internal directories.