Python Forum

Full Version: How retrieve sqlite3 database saved image and access in python3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I stored image file in sqlite3 database. Now i need to get that image and show. How i get back that image from database.
??

  1. Check if you have sqlite3 command shell by typing (change directory to where database is located):
    sqlite3 mydatabasename
  2. If not installed, following instructions here: https://sqlite.org/cli.html
  3. Once installed, start the tool from command line by typing command in step 1.
  4. If you want to see command list, type .help
  5. type
    .output 'my_database_tables.sql';
  6. type
    .dump
  7. type
    .quit

Now the entire database will be in sql format in a file named 'my_database_tables.sql'
You can examine the data to determine where your image is located.
Once you know that, you can restart sqlite3 command line tool and use SQL to select and dump the image.