SiriDB module written using the Go language.
Install the module by running the following command in the @thingsdb
scope:
new_module('siridb', 'github.com/thingsdb/module-go-siridb');
Optionally, you can choose a specific version by adding a @
followed with the release tag. For example: @v0.1.0
.
The SiriDB module requires a thing a configuration with the following properties:
Property | Type | Description |
---|---|---|
username | str (required) | Database user to authenticate with. |
password | str (required) | Password for the database user. |
database | str (required) | Database to connect to. |
servers | list (required) | List with tuples containing the host and client port. e.g. [["siridb.local", 9000]] . |
Note: if you have multiple SiriDB databases, then install one SiriDB module for each database.
Example configuration:
set_module_conf('siridb', {
username: 'iris',
password: 'siri',
database: 'dbtest',
servers: [
["localhost", 9000]
]
});
Name | Description |
---|---|
query | Run a SiriDB query. |
insert | Insert data into SiriDB. |
Syntax: query(query_string)
query_string
: The query string to run.
siridb.query("select * from 'my-series-001'").then(|res| {
res; // just return the response.
});
Syntax: insert(data)
data
: Thing with series and data points to insert.
data = {
mySeries001: [
[int(now()), 3.14]
]
};
siridb.insert(data);