Skip to content

sqlite backend how to decode _content column? access the database parse raw _content? #955

Answered by Lexonight1
Lexonight1 asked this question in Q&A
Discussion options

You must be logged in to vote

nevermind, i would just think it would be nice to keeps backups of cahces database and access them without request_cache hitting to url again in case it was expired

connection = sqlite3.connect(db_file)
cur = connection.cursor()
x = cur.execute('Select value from responses').fetchone()
code  = json.loads(x[0])
blob_data = base64.b85decode(code['_content'])
print(type(blob_data))
print(blob_data.decode('UTF-8'))

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Lexonight1
Comment options

You must be logged in to vote
1 reply
@Lexonight1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants