spine_io.importers.sqlalchemy_connector

Contains SqlAlchemyConnector class and a help function.

author:
  1. Vennström (VTT)
date:

1.6.2019

Module Contents

spine_io.importers.sqlalchemy_connector.select_sa_conn_string(parent=None)[source]

Launches QInputDialog for entering connection string

class spine_io.importers.sqlalchemy_connector.SqlAlchemyConnector[source]

Bases: spine_io.io_api.SourceConnection

Template class to read data from another QThread.

DISPLAY_NAME = SqlAlchemy[source]
OPTIONS[source]
SELECT_SOURCE_UI[source]
connect_to_source(self, source)[source]

saves filepath

Parameters:{str} -- filepath (source) –
disconnect(self)[source]

Disconnect from connected source.

get_tables(self)[source]

Method that should return a list of table names, list(str)

Raises:NotImplementedError – [description]
get_data_iterator(self, table, options, max_rows=-1)[source]

Creates a iterator for the file in self.filename

Parameters:
  • {string} -- table name (table) –
  • {dict} -- dict with options, not used (options) –
Keyword Arguments:
 

{int} -- how many rows of data to read, if -1 read all rows (default (max_rows) – {-1})

Returns:

[type] – [description]