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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:51:54+00:00 2026-06-15T12:51:54+00:00

I am looking into using an ORM (Objection Relational Mapper) to allow me to

  • 0

I am looking into using an ORM (Objection Relational Mapper) to allow me to persist my C++ objects into an SQLite database. I’m currently considering ODB by CodeSynthesis.

See: http://www.codesynthesis.com/products/odb/

Looking at the docs for ODB, I don’t see an answer to a nagging question I have, which is:

What happens if I create a class, persist it to the DB, but then in a later version of my product change the class. When the user gets the new version of my software, how will the old data get loaded properly into the new version of the class?

I’ve looked at boost::serialize before and it has mechanisms to handle this kind of “upgrading”, but I’m wondering:

  1. How is this handled in ORM tools generally speaking?
  2. How to do this with ODB specifically
  3. Is there a better ORM tool than ODB for handling this problem?
  • 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-15T12:51:56+00:00Added an answer on June 15, 2026 at 12:51 pm

    From the outset, full disclosure: I work on ODB. And to answer your third question, no, there aren’t any ;-).

    Seriously, though, schema evolution is a hard problem and it is one of the three big items on our TODO list (the other two are multi-database support and SQL-to-C++ compiler). The good news is that we are pretty much done with multi-database support and the next one in line is schema evolution.

    Generally, it seems the best approach is to bring your schema (and the data, if necessary) to the latest version. The alternative of making the application capable of reading multiple different versions just doesn’t seem to scale in the real world.

    As an example, let’s say we added a data member to the class which in the database schema level translates to adding a column to the corresponding table. The way to handle this is to make this new column NULL-able (with, say, odb::nullable or boost::optional). The idea here is that old data that doesn’t have a value for this column will be NULL (which the application can detect and handle).

    Next we need to upgrade the schema in the database. In this case we will need to execute the ALTER TABLE ADD COLUMN statement which will add the new column. Once ODB supports schema evolution, it will generate these migration statements automatically. Right now you will have to write them yourself (pain in the ass, I know). All the existing rows in the table will be automatically assigned NULL value for this column.

    So normally an application will contain sets of such statements that upgrade the schema from one version to the next. E.g., from 1 to 2, from 2 to 3, etc. The database will store the schema version and the application will know its latest schema version. Immediately after
    opening the database, the application will check the database version and if it is below the application schema version, it will start running these migration sets to upgrade the schema to the latest version.

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

Sidebar

Related Questions

I'm currently looking into using WIF for an upcoming project and would appreciate some
I'm currently looking into using C++/CLI to bridge the gap between managed C# and
I'm currently looking into using WCF to communicate between a server and a program
I'm looking into using FluentNHibernate as my ORM but I'm wondering how best to
Possible Duplicate: Using Entity Framework entities as business objects? I'm looking into using Entity
We are looking into using an ORM and I wanted some opinions/comparisons The basic
I'm looking into using JSR-303 with hibernate validator. We would like to be able
I am looking into using Google App Engine for a project and would like
I've been looking into using the UIPageControl for a scrolling part of an application,
I'm looking into using parallel unit tests for our project(s) and was wondering about

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.