jupyterlite / jupyterlite/pyodide-kernel

Error when trying to use sqlite3

Open
#35 14 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
90
Forks
47
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Following the `sqlite3` docs at https://docs.python.org/3/library/sqlite3.html, an error is raised when trying to query a SQLite database:

```python
# Using the example code from
#https://docs.python.org/3/library/sqlite3.html

import sqlite3
con = sqlite3.connect("tutorial.db")

cur = con.cursor()

cur.execute("CREATE TABLE movie(title, year, score)")

res = cur.execute("SELECT name FROM sqlite_master")
```

Throws error:

```text
---------------------------------------------------------------------------
DatabaseError Traceback (most recent call last)
Cell In[2], line 11
7 cur = con.cursor()
9 cur.execute("CREATE TABLE movie(title, year, score)")
---> 11 res = cur.execute("SELECT name FROM sqlite_master")

DatabaseError: database disk image is malformed
```

image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.