Skip to content

Tag: sqlite

Dynamic SQL queries with SQLite3

I would like to allow users to query a sql database. The database is here So the user will be able to enter the queries they want: and then the query will execute: If the user enters both variables like city=’SQL City’ and type=’murder’ it works as it finds both values in the same row, but if the user leaves

can’t put variables inside sqlite3 query in flask

Like documentation says, and I tried: it didn’t work, and I tried: also didn’t work. How can I pass variables inside my request? Answer The insertion looks correct. However, until you perform a commit, any DML operation (like an insert) would only be visible from the session that performed it, and will implicitly be rolled back when the connection is

How to fix a Mac base conda environment when sqlite3 is broken

I recently updated the Python version of my base conda environment from 3.8 to 3.9, using mamba update python=3.9, but I can no longer run IPython, because the sqlite3 package appears to be broken. Since I had another Python 3.9 environment that is still functional, I tried copying over the envs/py39/lib/sqlite3.36.0 and envs/py39/lib/python3.9/sqlite3 directories, as well as envs/py39/lib/python3.9/lib-dynload/ because I

How to reduce size of the database?

I have a folder with more than 150 txt files. To combine the data Resulting file has a size of 320 MB. I create a database and insert combined data: I could not create the database because it is too large. How to reduce size of the database? Answer The problem is not SQLite, it is your import script. SQLite

How should I insert html input data into a Django database

I can’t figure out how to fix this problem. I’m trying to insert some data from a html form into a small simple Django database; SQLite if I’m right. I tried to follow tutorials and did allot of searching online but it seems like I’ve hit tutorial hell. my question is: How can I achieve putting data from the text

Writing a hybrid method using pathlib (accessing properties)

I’m trying to do some path-checking logic on some values in a database. I’m having trouble implementing the class level expression for the hybrid method. Here is some stripped down code: I’m getting the error: Neither ‘Function’ object nor ‘Comparator’ object has an attribute ‘parents’ So I have to create a SQL expression for this function, but I’m not sure

Django – fresh database and no such table

I’m using my complex jobs app in production and it works fine, with sqlite database. I’m trying to create new database from scratch and I cannot do that nor using migrations nor trying to make them once again: When I’m trying to reuse my migrations: When I’ve tried to remove all migration files: How can I investigate what is going