Skip to content

About

MySQL Endpoint Module for ThingsDB

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

MySQL Endpoint Module (Go)

MySQL Endpoint module written using the Go language.

With this module, ThingsDB can expose data as-if it is MySQL.

Installation

Install the module by running the following command in the @thingsdb scope:

new_module('mysqlendpoint', 'github.com/thingsdb/module-go-mysqlendpoint');

Optionally, you can choose a specific version by adding a @ followed with the release tag. For example: @v0.1.0.

Configuration

Property Type Description
thingsdb_token str (required) Token with QUERY + CHANGE privileges in at least the @thinhsdb scope.
thingsdb_port int (optional) Client port of the thingsdb node. Defaults to 9200.
thingsdb_timeout int (optional) Timeout in seconds for thingsdb queries. Defaults to 10 seconds.
schema_scope str (optional) Collection scope for storing the schema. Defaults to //schema.
mysql_bind_address str (optional) Bind address for the MySQL server endpoint. Defaults to 0.0.0.0.
mysql_listen_port str (optional) Listen port for the MySQL server endpoint. Defaults to 3306.

Example configuration:

set_module_conf('mysqlendpoint', {
    thingsdb_token: '98c3fzHAIwYILw7JLyJbvH',
});

Exposed functions

Name Description
info Returns info for the MySQL server and database schema.

info

Syntax: info()

Example:

mysqlendpoint.info();

run

Syntax: run(scope, name, args)

Arguments

  • scope: The scope of the procedure.
  • name: Name fot the procedure to run.
  • args: Optional arguments as a list or thing for the procedure.

Example:

thingsdb.run("//stuff", "addition", {a: 4, b: 7}).then(|res| {
    res;  // response as "mpdata"
});

About

MySQL Endpoint Module for ThingsDB

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages