Category "sqlalchemy"

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

How to remove default value in model and add alembic version?

I am having a pyramid application which uses sqlalchemy and alembic for databases and migrations. I need to remove default specifier from my model class and add

SQLAlchemy Multitype columns - Hybrid Property querying

I have several tables in my PostgreSQL database that need to contain timeseries like information in an IoT-link context, that require several data types support

How to get the vendor type for a SQLAlchemy generic type without creating a table?

Using the code shown below I can obtain the vendor type that corresponds to the SQLAlchemy generic type. In this case it is "VARCHAR(10)". How can I get the v

Connecting Heroku Database to SQLAlchemy

so as part of a Web Programming MOOC, I have to connect to a PostgreSQL Database hosted on Heroku using Python and SQLalchemy. I have spent a lot of hours tryin