User Guide
Synapse Sidepocket adds new Storm commands and Optic Workflows to allow you to query databases from Storm.
Getting Started
Check with your Global Admin to enable permissions and add sources.
Examples
Query a data source and view the raw results
sidepocket.query mydb "SELECT username, site FROM users LIMIT 5"
Query a data source and ingest the results
Connectors may also allow certain authentication connection arguments to be overridden via the opts dictionary. Refer to the documentation for each connector to determine which override arguments are supported.
$sidepocket = $lib.import(sidepocket)
$query = "SELECT username, site FROM users WHERE site = %s"
$opts = ({"args": ["twitter.com"]})
// Optionally provide connection argument overrides in $opts (support varies by connector)
$opts.username = "redox"
$opts.password = "secret"
for ($mtype, $data, $info) in $sidepocket.query("myfoodb", $query, opts=$opts) {
switch $mtype {
"warn": {
// For Python exceptions $info will also contain an "excinfo" key with additional data
$lib.warn($data)
}
"print": {
// debug messages
$lib.print($data)
}
"data": {
// row data which for SQL databases are tuples of the column values
($username, $site) = $data
[ inet:web:account=($username, $site) ]
}
}
}
Use of meta:source
nodes
Synapse Sidepocket does not create/use meta:source
nodes.