0

I have a program communicating with a mysql database, which I should avoid to modify it until everything works fine.

So I already have a way to create a fake in-memory database (using sqlalchemy+sqlite), but the problem is that I have to create the schema and populate the database all the time.

As for example

Table(
    'builddefinitions', meta,
    Column('idBuildDefinitions', String(20)),
    Column('BuildType', String(20)),
)

Is it possible instead to

  • create a mysql engine for loading the tables and schema
  • create a sqlite in-memory engine and load all the schema and data in it
  • use that database to do all the updates safely

Is there a way to do this is sqlalchemy?

1
  • 1
    I think it should be easier to create a test database, just "clone" (dump) the original database and work on the copy, after you are completely certain that everything works fine then you swithc to the production database. Commented Jul 11, 2012 at 15:50

2 Answers 2

1

You do not have an straight way to do it. Take a look at this dumper: http://www.tylerlesmann.com/2009/apr/27/copying-databases-across-platforms-sqlalchemy/

I don't know how to maintain both updated, if it is what you want.

Sign up to request clarification or add additional context in comments.

1 Comment

Good thanks, having both updated is not so important, I just want to be able easily to play with the current database, without modifying it..
1

I would clone the database. This is why one usually has a production environment and a separate development environment (and in some cases testing and pre-production).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.