Linked Questions
10 questions linked to/from SQLAlchemy equivalent to SQL "LIKE" statement
8
votes
1
answer
19k
views
How to use "Like" operator in sqlAlchemy [duplicate]
Hi I am a new member in stackoverflow. I am currently using sqlAlchemy in flask. Trying to get the matched categories of string provided with the search url. The code of search url is given below:
@...
-1
votes
1
answer
131
views
Unable to execute a SQL LIKE query [duplicate]
I'm getting a value as params when I make an axios GET request and I want to use that value to make an SQL query. This is the code:
@app.route('/get-hcp-data', methods=['GET', 'POST'])
def ...
0
votes
0
answers
38
views
SQLAlchemy cant find certain values in my tables (Python) [duplicate]
This is something I just stumbled upon as a weird exception. Basically I have a bot that I send a slash command to (discord.py) and it takes that username and queries a MySQL table I have. This works ...
1
vote
0
answers
20
views
SQLAlchemy: Method to retrieve all rows where a column value is substring of another string [duplicate]
I am using SQLAlchemy to connect to an SQLite database which contains my words
I want to retrieve all the rows in which the value of column 'token' is a substring of a string 'myToken'
Here's how the ...
30
votes
3
answers
26k
views
How do I do a "starts with" query using SQLAlchemy?
I am learning to use SQLAlchemy to connect to a MySQL database. I want to pull records from the DB that start with a given string. I know that for simple equality all I need to do is this
queryRes = ...
18
votes
2
answers
28k
views
SQLAlchemy filter query "column LIKE ANY (array)"
Hi SQLAlchemy experts out there, here's a tricky one for you:
I'm trying to write a query that resolves into something like:
SELECT * FROM MyTable where my_column LIKE ANY (array['a%', 'b%'])
using ...
1
vote
3
answers
773
views
Using function of sqlalchemy.sql multiple times in query
I am using sqlalchemy version 0.7.8. I have come across an issue where my user can search a text in plain english but record in db can have special characters between text. So if user enters "please ...
2
votes
1
answer
255
views
Python SQLAlchemy and Postgres - How to search using substring in json value
I am aware I can easily query a JSON value using this example query:
r = Books.query.filter(
Books.nameofjsonfield['key1', 'key2'].astext.cast(Unicode) == 'exact_string_to_compare'
).all()
But how ...
0
votes
2
answers
81
views
Unable to execute a query on flask using MqSQL
Hello there im trying to execute a SQL query using Flask with mysqldatabase, the query returns as a JSON managed my JQuery on the front end. The goal is to use a search bar to find any matches with ...
0
votes
0
answers
36
views
Up to date syntax for querying a database with flask-sqlalchemy
What is the correct and up-to-date syntax to query a database with flask-sqlalchemy?
I've been through
https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/
https://docs.sqlalchemy.org/en/20/index....