134 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
121
views
Why am I getting a foreign key mismatch when trying to join 2 tables using foreign keys?
I am doing Chapter 16 - SQLite Databases of Automate the Boring Stuff with Python By Al. Sweigart and I ran into a problem in the "Joining Multiple Tables with Foreign Keys" part, let it be ...
1
vote
0
answers
681
views
How to properly store a date time value in a sqlite3 database with python
I wanted to store a timestamp from Python in a sqlite3 database. For that I used this kind of code
from datetime import datetime, date, timedelta, time
import sqlite3
import os
def main():
...
1
vote
1
answer
108
views
Force Python-SQLite3 to report non-existing columns in WHERE clause
This is my code:
import sqlite3
conn = sqlite3.connect(':memory:')
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE schools (
county TEXT,
statustype TEXT
)
''')
cursor.execute('''
...
0
votes
0
answers
351
views
discord.py "Unknown Webhook 10015" since new router
Ever since getting my new router (HG8147X6) I seem to have constantly run into an issue with my Discord.py bots.
After starting the bot, every slash command works once, then all of them fail (I get ...
0
votes
0
answers
71
views
Unable to limit memory(RAM) consumption in a FastAPI based service using Sqlite / AioSqlite
I have stored strings & their vector embeddings in a Sqlite DB file with the table name "query_metadata". Embeddings are stored as numpy bytes. The embeddings would be used for ...
0
votes
0
answers
41
views
Using Arrow ADBC to register UDF
While chasing down performance and cleaner code, I've ran into this problem I've found that UDF's are seemingly connection dependent, not database dependent. If I, for instance, used a trigger on ...
0
votes
2
answers
175
views
Attaching an adbc connection to an sqlite in-memory database
I have a setup where I'm utilizing two connections for sqlite: A dbapi-based sqlite connection from Arrow ADBC so I can have access to ingesting and fetching arrow data, and a native sqlite3 ...
0
votes
1
answer
52
views
Flask Select query returning a cursor object or an empty list instead of a tuple of values
Here is my code in app.py:
from flask import Flask, render_template, request, g
import sys
import sqlite3
import os
current_directory = os.path.dirname(os.path.abspath(__file__))
app = Flask(...
0
votes
1
answer
76
views
Extract information through SQLite and Python [closed]
I am working with a DataBase in Sqlite and Python with the table that is attached.
I am interested in get a query that give me a list with an unique item in IDFrom, for those unique items, the VoltMag,...
1
vote
2
answers
154
views
ModuleNotFoundError: No module named '_sqlite3' after installing spyder-kernels 3 for Spyder 6.0 IPython console
I am trying to use Spyder 6 IDE on Ubuntu 24.04. After installation of Spyder 6, I changed the default python interpreter to my virtual environment running Python 3.11 and installed spyder-kernels==3....
0
votes
0
answers
49
views
Data retrieving and SQL database update
I'm trying to retrieve some data from an API and save them to a local database I created. All data come from Google Ads campaigns, and I need to make two separate calls because of their docs, but that'...
0
votes
1
answer
134
views
How can I update display of chat history upon page refresh?
My chat UI using Gradio:
import sqlite3
import gradio as gr
import time
formatted_history = []
sqlite = None
def loadHistoryFromDB():
global sqlite,formatted_history
sql="SELECT role,...
0
votes
1
answer
81
views
Convert blob to bytes SQLite3 Python
Have a requirement of storing/retrieving bytes as a blob in SQLite3;
The column definition in as follows:"bytes_as_blob " BLOB,
Byte data is stored in the table using the following construct ...
0
votes
0
answers
53
views
How to prevent "OperationalError: Database is locked" from discarding changes?
I have an application that periodically records data to a database with Python's SQLite3. Unfortunately, when I open the database with DBBrowser, it can sometimes lock the database. When this happens, ...
-1
votes
1
answer
153
views
How do I instruct Python to use my own compiled SQLite3?
I have compiled my own version of SQLite3 amalgamation tarball from the download page and would like to include that into my Python3 script on MacOs. Is there a way to do that via import sqlite3? As ...