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 493759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:26:08+00:00 2026-05-13T05:26:08+00:00

A frequent task I run into at work is writing scripts against pre-existing databases.

  • 0

A frequent task I run into at work is writing scripts against pre-existing databases. Sometimes I’m connecting to Oracle, other times it might be MySql or even sql server.

What I would like is a tool which would reverse-engineer the database’s tables and foreign keys and allow me to write OO-style scripts against the database. This could be in any language really, but python or ruby would be preferred.

For example – this is my ideal ruby script: (assuming the manager and employee tables already exist with foreign keys)

DB = Database.connect(connect_string)
DB.managers.each do |manager|
  puts manager.name
  manager.employees.each do |employee|
    puts employee.name
  end
end

Does this type of library exist? If so, it would save me so much time!

Edit – the main feature I would like is for it to automatically discover foreign key associations from the database metadata without explicitly mapping them – I have tried ActiveRecord, SQLAlchemy, Sequel, and DataMapper, and from what I can tell, none of them can do this.

  • 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-13T05:26:08+00:00Added an answer on May 13, 2026 at 5:26 am

    You should take a look at the SQLSoup extension in SQLAlchemy. It claims to do all this for you (including foreign keys). I haven’t tested it myself.

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

Sidebar

Related Questions

One of the most frequent thing I do with Eclipse is to re-run the
A frequent problem I encounter is having to run some script with 50 or
I am writing an application for Android that downloads a games leaderboard at frequent
I am a frequent R user (the very first program I turn on everyday
I have frequent updates to a user table that simply sets the last seen
This has to be a frequent question, but not on SO yet, so it
I'd like to bypass some frequent queries by storing str(key) in memcache. When I
My app has a not that frequent operation that is executed on the UI
I'm using the following query to extract the frequent short values from a mediumblob
A web app I'm working on requires frequent parsing of diverse web resources (HTML,

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.