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

  • Home
  • SEARCH
  • 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 8581087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:57:56+00:00 2026-06-11T20:57:56+00:00

I have an existing legacy Firebird database with nonstandard table and field names. I

  • 0

I have an existing legacy Firebird database with nonstandard table and field names.

I would like to write a Sinatra app that can access it and display information. I’ve seen stuff like dm-is-reflective that appears to work when a database has proper naming conventions, but how do I use DataMapper (or ActiveRecord whichever is the easiest) to access those tables?

For example, assuming I had these two tables:

Bookshelfs
    shelf_id: integer
    level: integer
    created: timestamp

Book
    id: integer
    id_of_shelf: integer
    title: string
    pages: integer

Something like with odd naming conventions that don’t follow any set pattern and where one table’s record might “own” multiple entries in another table even though there is not foreign_key assigned.

How would you set up datamapper (or activerecord) to communicate with it?

  • 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-06-11T20:57:57+00:00Added an answer on June 11, 2026 at 8:57 pm

    Look in to this gem to get setup with ActiveRecord on Sinatra:
    https://github.com/bmizerany/sinatra-activerecord

    As for how to define the relations, activerecord can do this easily.

    class Book < ActiveRecord::Base
      belongs_to :bookshelf, :class_name => 'Bookshelf', :foreign_key => 'id_of_shelf'
    end
    
    class Bookshelf < ActiveRecord::Base
      has_many :books, :class_name => 'Book', :foreign_key => 'id_of_shelf'
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing legacy style IDTExtensibility2, IDTCommandTarget Extension that I would like to
I have existing legacy code that is using a standard form. I would like
I have a legacy PHP/MySQL app that calls mysql_connect(). Tons of existing downstream code
I have two different existing Database design's in the legacy apps I inherited. On
So, my problem is this. I have a legacy MySQL database that I'm building
I want to add a column to an existing legacy database and write a
We have an existing legacy app written in C++/powerbuilder running on Unix with it's
I have an existing search-based app that's being ported to Rails. Due to the
I have existing code that uses CMNewProfileSearch to find then iterate over the color
I have existing java code and need to create Design Document based on that.

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.