Category "sqlalchemy"

Many-to-many relationship with parent with two releationships to same child

I'm trying to model a simple (at least I thought so) relationship like in a recipe (I'm using flask-sqlalchemy): I have a Recipe, that has input materials and o

Flask_SQLAlchemy is claiming my value is not boolean?

I ran into the following error: File "/home/sandbox/.local/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1973, in _strict_as_bool raise Ty

'\' character is getting added when executing in graphql

Not able to figure out how i can get rid of '' character. I have tried few things but it didnt work out for me. I think postgressql changes json string like tha

APScheduler RuntimeError: No application found

I have a problem. I have IP addresses and with APScheduler I try to ping them every 10 seconds and update my database. For APScheduler I understand that I need

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres when using flask to access Heroku postgres database

I've seen similar questions asked and the answer is typically to simply change "postgres" to "postgresql" in the database URL. However, I still see this error.

Best way to check if database already exists with flask-sqlalchemy, otherwise create

I have a database app, and want to create the tables and database on the fly when starting the app for the first time. If the app is restarted, it should only c

sqlalchemy ignore nulls in window function

I am using sqlalchemy to generate queries and am unsure how to insert the keyword "IGNORE NULLS" between the last_value() window function and the over() functio

SQLAlchemy mapping an existing table (IBM Db2 Issue)

I´ve been studying SQLAlchemy as a way to simplify some DB work that I have. The tables I work are previously created by other systems and I usually have

sqlalchemy: rename a column on *query* level

I need to rename a column in a query, but I can't do it on column level, eg session.query(MyModel.col_name.label('new_name')) Is there any way to rename a co

Error occurs when I try to create a new column with passwords in database [duplicate]

from flask import Flask, redirect, url_for, render_template, request from flask_sqlalchemy import SQLAlchemy from datetime import datetime imp

Comparing SQLAlchemy Object Instances for Equality of Attributes

My Flask-Restful application has a number of "objects". In the first version of the app these are simple data structures with no behaviour, implemented as Dicts

Pandas to_sql to sqlite returns 'Engine' object has no attribute 'cursor'

I have a working_df in pandas I'd like to output to sqlite database. from sqlalchemy import create_engine sql_engine = create_engine('sqlite:///test.db', ech

SQLAlchemy error: "TypeError: Additional arguments should be named <dialectname>_<argument>, got 'nullable'"

Problem I get an error using Flask when following a tutorial on using Flash. Since I am a basic Python programmer I don't understand why or what is wrong with i

python sqlalchemy query filter

I'm using SQLalchemy and have entered data into the database: class Directions(db.Model): id = db.Column(db.Integer, primary_key=True) key = db.Column(

I can't find an SQLIte database after creating it

I'm really having trouble trying to understand SQLAlchemy so I apologize if this is a really symplistic problem. I can't find the sqlite database in any of my d

Undo last Alembic migration

I created a migration with alembic revision --autogenerate, applied it to my development database with alembic upgrade head, and then realised it wasn't quite w

how to move from sqllite database to mysql database?

i want to move from SQLite database M, MySQL database. if i understood correctly, so i can do it with changing the engine: engine = create_engine('sqlite:///foo

Case-insensitive exact match with SQLAlchemy

How can I ensure that the = operator is always rendered case-insensitive? Are comparisions with the LOWER or the UPPER functions the best bet for performance? I

SQLAlchemy (psycopg2.ProgrammingError) can't adapt type 'dict'

Couldn't find a solution on the web for my problem. I am trying to insert this pandas df to a Postgresql table using SQLAlchemy Pandas 0.24.2 sqlalchemy 1.3.

SqlAlchemy asyncio orm: How to query the database

In SqlAlchemy async orm engine how do I query a table and get a value or all? I know from the non async methods that I can just do SESSION.query(TableClass).get