Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7563235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:36:50+00:00 2026-05-30T13:36:50+00:00

Intro: I’m writing web interface with SQLAlchemy reflection that supports multiple databases. It turns

  • 0

Intro: I’m writing web interface with SQLAlchemy reflection that supports multiple databases. It turns out that authors of application defined postgresql with lowercase tables/columns, eg. job.jobstatus while sqlite has mixed case, eg Job.JobStatus. I’m using DeclarativeReflectedBase from examples to combine reflection and declarative style.

The issue: Configure SQLAlchemy to work with tables/columns case insensitive with reflection

I have done so far:

  • I have changed DeclarativeReflectedBase.prepare() method to pass quote=False into Table.__init__

What is left to be solved:

  • relationship definitions still has to obey case when configuring joins, like primaryjoin=”Job.JobStatus==Status.JobStatus”.
  • configure __tablename__ based on engine type

The question: Are my assumptions correct or is there more straightforward way? Maybe I could tell reflection to reflect everything lowercase and all problems are gone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:36:52+00:00Added an answer on May 30, 2026 at 1:36 pm

    you’d probably want to look into defining a “.key” on each Column that’s in lower case, that way you can refer to columns as lower case within application code. You should use the column_reflect event (See http://docs.sqlalchemy.org/en/latest/core/events.html#schema-events) to define this key as a lower case version of the .name.

    then, when you reflect the table, I’d just do something like this:

    def reflect_table(name, engine):
        if engine.dialect.name == 'postgresql':
            name = name.lower()
        return Table(name, autoload=True, autoload_with=engine)
    
    my_table = reflect_table("MyTable", engine)
    

    I think that might cover it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

INTRO I have a TCP/HTTP server that supports plugins in form of Shared Libraries
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Intro I am doing a kind of OCR application that should recognize characters based
Intro In the application I 'm currently working on, there are two kinds of
Intro I have an object @organization that has_many :quick_facts Basically, I want to produce
Intro: I'm trying out LESS in an asp.net mvc environment. I use dotless for
INTRO: I created a java application using JFrame. I have a JMenuBar at the
Edit for intro: We know that a ref parameter in C# passes a reference
intro code: public interface Course { /** * returns the number of units (hours)
Intro. I have a C++ application, I use SWIG to launch GetObjects and PutObjects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.