IsaacKerson commited on
Commit
5a87f31
1 Parent(s): c56c4b1

SQLite Test

Browse files
Files changed (3) hide show
  1. app.py +7 -9
  2. requirements.txt +1 -3
  3. vocabulary.db +0 -0
app.py CHANGED
@@ -1,11 +1,9 @@
1
  import streamlit as st
2
- import pymongo
3
 
4
- uri = "mongodb+srv://m220student:test@sandbox.zqzg8.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"
5
- client = pymongo.MongoClient(uri, connect=False)
6
- mflix = client.sample_mflix
7
-
8
- movies = mflix.movies
9
-
10
- st.title("With Pymongo")
11
- st.write(movies.find_one())
 
1
  import streamlit as st
2
+ import sqlite3
3
 
4
+ conn = sqlite3.connect('vocabulary.db')
5
+ cursor = conn.cursor
6
+ unit = ("Unit 1",)
7
+ cursor.execute("SELECT * FROM vocab WHERE unit = ?", unit)
8
+ st.title("With SQLite")
9
+ st.write(cursor.fetchone())
 
 
requirements.txt CHANGED
@@ -1,3 +1 @@
1
- pymongo
2
- pymongo[srv]
3
- dnspython
 
1
+ pysqlite3
 
 
vocabulary.db ADDED
Binary file (49.2 kB). View file