Help Topics for sql

Sample CLI

gway awg find-cable

References

Signature

(*, meters: Union[int, str, NoneType] = None, amps: Union[int, str] = '40', volts: Union[int, str] =
'220', material: Literal['cu', 'al', '?'] = 'cu', max_lines: Union[int, str] = '1', phases:
Literal['1', '3', 1, 3] = '2', conduit: Union[str, bool, NoneType] = None, ground: Union[int, str] =
'1')

Docstring

Calculate the type of cable needed for an electrical system. Args: meters: Cable length (one line) in meters. Required keyword. amps: Load in Amperes. Default: 40 A. volts: System voltage. Default: 220 V. material: 'cu' (copper) or 'al' (aluminum). Default: cu. max_lines: Maximum number of line conductors allowed. Default: 1 phases: Number of phases for AC (1, 2 or 3). Default: 2 conduit: Conduit type or None. ground: Number of ground wires. Returns: dict with cable selection and voltage drop info, or {'awg': 'n/a'} if not possible.

Sample CLI

gway awg find-conduit

References

Signature

(awg, cables, *, conduit='emt')

Docstring

Calculate the kind of conduit required for a set of cables.


Sample CLI

gway sql close-connection

References

Signature

(datafile=None, *, sql_engine='sqlite', all=False)

Docstring

Explicitly close one or all cached database connections. Shuts down writer thread if all connections closed.

Sample CLI

gway sql execute

References

Signature

(*sql, connection=None, script=None, sep='; ', args=None)

Docstring

Thread-safe SQL execution. - SELECTs and other read queries run immediately (parallel safe). - DML/DDL statements (INSERT/UPDATE/DELETE/etc) are funneled into the write queue. - Multi-statement scripts are supported via executescript. - All write queue items are always 5-tuple: (sql, args, conn, result_q, is_script)


Sample CLI

gway sql load-csv

References

Signature

(*, connection=None, folder='data', force=False)

Docstring

Recursively loads CSVs from a folder into SQLite tables. Table names are derived from folder/file paths.

Sample CLI

gway sql open-connection

References

Signature

(datafile=None, *, sql_engine='sqlite', autoload=False, force=False, row_factory=False, **dbopts)

Docstring

Initialize or reuse a database connection. Caches connections by sql_engine, file path, and thread ID (if required). Starts writer thread for SQLite.

Sample CLI

gway sql shutdown-writer

Signature

()

Docstring

Signal writer thread to exit and wait for it to finish.