grepros 1.2.2
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
SqlMixin Class Reference

Base class for producing SQL for topics and messages. More...

Inheritance diagram for SqlMixin:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, **kwargs)
 
 close (self)
 Clears data structures.
 
 validate (self)
 Returns whether arguments are valid.
 

Public Attributes

 DIALECTS
 

Static Public Attributes

 DEFAULT_ARGS = dict(WRITE_OPTIONS={})
 Constructor argument defaults.
 
str DEFAULT_DIALECT = "sqlite"
 Default SQL dialect used if dialect not specified.
 
dict DIALECTS
 Supported SQL dialects and options.
 
list KEYWORDS
 Words that need quoting if in name context, like table name.
 

Detailed Description

Base class for producing SQL for topics and messages.

Can load additional SQL dialects or additional options for existing dialects from a YAML/JSON file.

Definition at line 31 of file sqlbase.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
**  kwargs 
)
Parameters
argsarguments as namespace or dictionary, case-insensitive
args.write_options
{"dialect": SQL dialect if not default,
 "nesting": true|false to created nested type tables}
kwargsany and all arguments as keyword overrides, case-insensitive

Reimplemented in BaseDataSink, PostgresSink, SqliteSink, and SqlSink.

Definition at line 49 of file sqlbase.py.

Member Function Documentation

◆ close()

close (   self)

Clears data structures.

Reimplemented in BaseDataSink, and SqlSink.

Definition at line 122 of file sqlbase.py.

◆ validate()

validate (   self)

Returns whether arguments are valid.

Verifies that "dialect-file" is valid and "dialect" contains supported value, if any.

Reimplemented in BaseDataSink, PostgresSink, SqliteSink, and SqlSink.

Definition at line 63 of file sqlbase.py.

Member Data Documentation

◆ DEFAULT_ARGS

DEFAULT_ARGS = dict(WRITE_OPTIONS={})
static

Constructor argument defaults.

Definition at line 37 of file sqlbase.py.

◆ DEFAULT_DIALECT

str DEFAULT_DIALECT = "sqlite"
static

Default SQL dialect used if dialect not specified.

Definition at line 34 of file sqlbase.py.

◆ DIALECTS [1/2]

DIALECTS

Definition at line 90 of file sqlbase.py.

◆ DIALECTS [2/2]

dict DIALECTS
static

Supported SQL dialects and options.

Definition at line 411 of file sqlbase.py.

◆ KEYWORDS

list KEYWORDS
static

Words that need quoting if in name context, like table name.

Combined from reserved words for Postgres, SQLite, MSSQL, Oracle et al.

Definition at line 547 of file sqlbase.py.


The documentation for this class was generated from the following file: