sqlite2mysql (class)¶
- class fundamentals.mysql.sqlite2mysql(log, pathToSqlite, tablePrefix='', settings=False, dbConn=False)[source][source]¶
Bases:
objectTake a sqlite database file and copy the tables within it to a MySQL database
Key Arguments
log– loggersettings– the settings dictionarypathToSqlite– path to the sqlite database to transfer into the MySQL databasetablePrefix– a prefix to add to all the tablename when converting to mysql. Default “”dbConn– mysql database connection
Usage
To setup your logger, settings and database connections, please use the
fundamentalspackage (see tutorial here https://fundamentals.readthedocs.io/en/master/initialisation.html).To convert and import the content of a sqlite database into MySQL run the following:
Todo
add a tutorial about
sqlite2mysqlto documentation
```python from fundamentals.mysql import sqlite2mysql converter = sqlite2mysql(
log=log, settings=settings, pathToSqlite=”/path/to/sqlite.db”, tablePrefix=”external”
) converter.convert_sqlite_to_mysql() ```
Methods