db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tyju tiui <jckdnk...@yahoo.com>
Subject Re: ddl utils schema with existing db
Date Fri, 07 Dec 2007 23:39:49 GMT
Hi,

Sorry for the quick re-post ... I see that the catalog and schema patter are actually part
of the Java API.
I thought they were something you had implemented.
Sorry for the confusion.

I am still a little confused about how to use the schema patter to search for multiple schemas
though.
If you have any pointers I would appreciate it.

Thanks,

Ty



----- Original Message ----
From: tyju tiui <jckdnk111@yahoo.com>
To: ddlutils-user@db.apache.org
Sent: Friday, December 7, 2007 6:11:57 PM
Subject: Re: ddl utils schema with existing db


Hi Tom,

I've got the creation / removal of multiple schema's working, but
 ddlutils still wants to remove existing tables from my default schema
 (public schema in postgres).

I have a few questions about this:

    1) Will it break anything to add the schema to the 'clone' /
 'equals' methods?
    2) I see mention of an unused 'catalog' variable in a few places
 ... what exactly is this?
    2) I noticed a default schema pattern of '%' ... could I use this
 to filter for only the schemas mentioned in the schema definition xml?
 If so could you maybe provide a quick example (I'm thinking something
 like " 'my_%','the_schm','%_schm' ")

This has been quite fun to work on so far ... you guys have done a
 great job.

Thanks for your help,

Ty 


----- Original Message ----
From: Thomas Dudziak <tomdzk@gmail.com>
To: ddlutils-user@db.apache.org
Sent: Friday, December 7, 2007 1:23:10 AM
Subject: Re: ddl utils schema with existing db


On Dec 6, 2007 2:05 PM, tyju tiui <jckdnk111@yahoo.com> wrote:

> I'm confused about the difference between database and schema
 definition in ddlutils.
> If I have an existing database and would like to create a new schema
 within that database how would I go about that (via ant or
 programmatically)?
>
> For servers like MySQL which don't have a notion of separate schema's
 inside a single database I would have to create a new database each
 time. For servers like PostgreSQL and Oracle which do support separate
 schemas within a single database I shouldn't need to create a new db
 each
 time I need a new schema. Does this make sense?

DdlUtils' support for schemas within the database is weak at the
moment. You can create tables etc. within a specific schema by
prefixing the table names etc. with the schema. E.g.

<database name="test">
  <table name="testschema.test">
    ...
  </table>
</database>

For databases like Oracle, you can achieve somethin similar by
accessing the database using a user corresponding to the schema. E.g.
to place something in schema 'testschema', create the schema
indirectly by creating a user of the same name, and then use this user
to connect to the database. Any tables created via an unqualified name
will then be placed in that schema.
This also works for reading the database model from a schema (using
the schema pattern to restrict which schemas to read from).

Tom






    
  ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
  http://tools.search.yahoo.com/newsearch/category.php?category=shopping





      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message