|
def | __init__ (self, args=None, **kwargs) |
|
def | emit (self, topic, msg, stamp=None, match=None, index=None) |
|
def | size (self) |
|
def | validate (self) |
|
def | close (self) |
|
def | close_output (self) |
|
def | __enter__ (self) |
|
def | __exit__ (self, exc_type, exc_value, traceback) |
|
def | autodetect (cls, target) |
|
def | bind (self, source) |
|
def | emit_meta (self) |
|
def | flush (self) |
|
def | is_highlighting (self) |
|
def | thread_excepthook (self, text, exc) |
|
def | close_output (self) |
|
def | ensure_rollover (self, topic, msg, stamp) |
|
def | format_output_meta (self) |
|
def | get_write_options (cls, label) |
|
def | make_filename (self) |
|
|
| DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, VERBOSE=False) |
| Constructor argument defaults. More...
|
|
string | ENGINE = "SQLite" |
| Database engine name. More...
|
|
tuple | FILE_EXTENSIONS = (".sqlite", ".sqlite3") |
| Auto-detection file extensions. More...
|
|
int | MAX_INT = 2**63 - 1 |
| Maximum integer size supported in SQLite, higher values inserted as string. More...
|
|
int | COMMIT_INTERVAL = 1000 |
| Number of emits between commits; 0 is autocommit. More...
|
|
| DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, VERBOSE=False) |
| Constructor argument defaults. More...
|
|
| ENGINE = None |
| Database engine name, overridden in subclasses. More...
|
|
list | MESSAGE_TYPE_BASECOLS |
| Default columns for pkg/MsgType tables. More...
|
|
list | MESSAGE_TYPE_NESTCOLS |
| Additional default columns for pkg/MsgType tables with nesting output. More...
|
|
list | MESSAGE_TYPE_TOPICCOLS |
| Default topic-related columns for pkg/MsgType tables. More...
|
|
| DEFAULT_ARGS = dict(META=False) |
| Constructor argument defaults. More...
|
|
tuple | FILE_EXTENSIONS = () |
| Auto-detection file extensions for subclasses, as (".ext", ) More...
|
|
| DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, MATCH_WRAPPER=None, VERBOSE=False) |
| Constructor argument defaults. More...
|
|
string | DEFAULT_DIALECT = "sqlite" |
| Default SQL dialect used if dialect not specified. More...
|
|
dictionary | DIALECTS |
| Supported SQL dialects and options. More...
|
|
list | KEYWORDS |
| Words that need quoting if in name context, like table name. More...
|
|
| DEFAULT_ARGS = dict(VERBOSE=False, WRITE=None, WRITE_OPTIONS={}) |
| Constructor argument defaults. More...
|
|
string | FILE_META_TEMPLATE = "{name} ({size})" |
|
string | MULTI_META_TEMPLATE = "\n- {name} ({size}, {mcount}, {tcount})" |
|
list | OPTIONS_TEMPLATES |
| Command-line help templates for rollover options, as [(name, text with s label placeholder)]. More...
|
|
string | START_META_TEMPLATE = "{mcount} in {tcount} to " |
|
Writes messages to an SQLite database.
Output will have:
- table "messages", with all messages as serialized binary data
- table "types", with message definitions
- table "topics", with topic information
plus:
- table "pkg/MsgType" for each message type, with detailed fields,
and JSON fields for arrays of nested subtypes,
with foreign keys if nesting else subtype values as JSON dictionaries;
plus underscore-prefixed fields for metadata, like `_topic` as the topic name.
If launched with nesting-option, tables will also be created for each
nested message type.
- view "/topic/full/name" for each topic,
selecting from the message type table
Definition at line 28 of file sqlite.py.
def grepros.plugins.auto.sqlite.SqliteSink.__init__ |
( |
|
self, |
|
|
|
args = None , |
|
|
** |
kwargs |
|
) |
| |
@param args arguments as namespace or dictionary, case-insensitive;
or a single path as the name of SQLitefile to write
@param args.write name of SQLite file to write, will be appended to if exists
@param args.write_options ```
{"commit-interval": transaction size (0 is autocommit),
"message-yaml": populate messages.yaml (default true),
"nesting": "array" to recursively insert arrays
of nested types, or "all" for any nesting),
"overwrite": whether to overwrite existing file
(default false),
"rollover-size": bytes limit for individual output files,
"rollover-count": message limit for individual output files,
"rollover-duration": time span limit for individual output files,
as ROS duration or convertible seconds,
"rollover-template": output filename template, supporting
strftime format codes like "%H-%M-%S"
and "%(index)s" as output file index}
```
@param args.meta whether to emit metainfo
@param args.verbose whether to emit debug information
@param kwargs any and all arguments as keyword overrides, case-insensitive
Reimplemented from grepros.outputs.RolloverSinkMixin.
Definition at line 64 of file sqlite.py.