DB Processor

Contents

DB Processor#

ℹ️ This documentation is being updated as part of AppSeed Domain Migration.

While we complete this page, we’d love to:

  • 👉 Register to be notified when this page is ready

  • 👉 Connect with us on Discord for LIVE Support

  • 👉 Download products or generate your own starter

AppSeed is evolving and now is App-Generator, an open-source platform for developers and companies. Thank you for your patience!

Quick Start#

SQLITE Connection and data dump

python.exe manage.py shell # Here we are inside the SHELL >>> from helpers.db_processor import * >>> db_sqlite = DbWrapper() >>> db_sqlite.driver = COMMON.DB_SQLITE >>> db_sqlite.db_name = 'media/tool_inspect/api-django.sqlite3' >>> db_sqlite.connect() >>> db_sqlite.load_models() >>> db_sqlite.dump_tables() >>> db_sqlite.dump_tables_data() # OUTPUT tmp/05_27_58_SQLITE.sql tmp/05_28_04_SQLITE_api_user_user.sql tmp/05_28_04_SQLITE_auth_permission.sql 

MySql Dump

>>> from helpers.db_processor import * >>> db_conn = DbWrapper() >>> db_conn.driver = COMMON.DB_MYSQL >>> db_conn.db_name = 'DB_NAME_HERE' >>> db_conn.db_user = 'DB_USER_HERE' >>> db_conn.db_pass = 'DB_PASS_HERE' >>> #db_conn.db_port = 3306 >>> #db_conn.db_host = 'localhost' >>> db_conn.connect() True # All good when TRUE >>> db_conn.dump_models() >>> db_conn.dump_tables() >>> db_conn.dump_tables_data()