Source code for sylib.library.plugins.export.table_exporters.plugin_sqlite_exporter

# This file is part of Sympathy for Data.
# Copyright (c) 2013, Combine Control Systems AB
#
# SYMPATHY FOR DATA COMMERCIAL LICENSE
# You should have received a link to the License with Sympathy for Data.
from sylib.export import table as exporttable
from sympathy.api import table
from sympathy.api import qt2 as qt_compat
QtGui = qt_compat.import_module('QtGui')


[docs] class DataExportSQLite(exporttable.TableDataExporterBase): """Exporter for SQLite files.""" EXPORTER_NAME = "SQLite" FILENAME_EXTENSION = "db" def export_data(self, in_sytable, fq_outfilename, progress=None): """Export Table to SQLite.""" sql = table.table_sql() db_interface = sql.SQLite3Database(fq_outfilename) try: db_interface.from_table('test', in_sytable) finally: db_interface.close()