You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by andrew cooke <an...@acooke.org> on 2006/02/21 16:19:41 UTC

[m2] Database/SQL plugin? Generating DB from schema?

Hi,

I have a DB schema that defines a database.  I'd like Maven to manage this
(so that I can delete/re0create the database before tests, for example). 
How do I do this?

Thanks,
Andrew



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by Wayne Fay <wa...@gmail.com>.
If you can't find any other options, you can always try Antrun and <sql> tags...

Here's an example using in-line sql commands (this goes in the
build-plugin-tasks section):
<sql classpathref="pgsqldriver.class.path"
driver="org.postgresql.Driver"
url="jdbc:postgresql://${pgsql.host}:${pgsql.port}/${pgsql.service}"
userid="${pgsql.user}" password="${pgsql.user.password}"
onerror="continue"><![CDATA[
  DROP TABLE RAW_DATA;
  DROP TABLE ERROR_LOG;
  DROP TABLE CHANGE_LOG;
  COMMIT;
]]></sql>

Give this a try?

Wayne


On 2/21/06, andrew cooke <an...@acooke.org> wrote:
>
> no, they're just databases (SQL) (by schema i mean definitions of tables
> and stored procedures)
>
> andrew
>
> PiÃ(c)roni Raphaël wrote:
> > Do your database schema use Torque oà r hibernate ?
> >
> > Raphaël
> >
> > 2006/2/21, andrew cooke <an...@acooke.org>:
> >>
> >>
> >> Hi,
> >>
> >> I have a DB schema that defines a database.  I'd like Maven to manage
> >> this
> >> (so that I can delete/re0create the database before tests, for example).
> >> How do I do this?
> >>
> >> Thanks,
> >> Andrew
> >>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by andrew cooke <an...@acooke.org>.
thanks.  however, it seems the plugin is too restrictive still -
http://mojo.codehaus.org/jdbc-maven-plugin/introduction.html

andrew

Wayne Fay wrote:
> Looks like there's also a maven-jdbc-plugin that you could potentially
> use. But I've never used it myself.
>
> This email thread has some more info:
> http://mail-archives.apache.org/mod_mbox/maven-users/200509.mbox/%3C20050923114234.96306.qmail@web52906.mail.yahoo.com%3E
>
> If you use it, and it works like you were expecting, please let us
> know. Obviously the rest of us are still using Antrun and sql tag. ;-)
>
> Wayne



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by Wayne Fay <wa...@gmail.com>.
Looks like there's also a maven-jdbc-plugin that you could potentially
use. But I've never used it myself.

This email thread has some more info:
http://mail-archives.apache.org/mod_mbox/maven-users/200509.mbox/%3C20050923114234.96306.qmail@web52906.mail.yahoo.com%3E

If you use it, and it works like you were expecting, please let us
know. Obviously the rest of us are still using Antrun and sql tag. ;-)

Wayne


On 2/21/06, andrew cooke <an...@acooke.org> wrote:
>
> thanks everyone.  looks like ant is the consensus view!  (although we just
> moved to maven from ant to avoid people having arbitrary chunks of
> functionality during builds...)
>
> cheers,
> andrew
>
>
> Kenney Westerhof wrote:
> > On Tue, 21 Feb 2006, andrew cooke wrote:
> >
> > The simplest solution is to use the antrun plugin, and the
> > <sql/> task. Be sure to add an <extensions><extension> under the <plugin>
> > tag that defines antrun containing a dependency to the jdbc driver.
> >
> > But there might also be an sql plugin out there.
> >
> > -- Kenney
> >>
> >> no, they're just databases (SQL) (by schema i mean definitions of tables
> >> and stored procedures)
> >>
> >> andrew
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by andrew cooke <an...@acooke.org>.
thanks everyone.  looks like ant is the consensus view!  (although we just
moved to maven from ant to avoid people having arbitrary chunks of
functionality during builds...)

cheers,
andrew


Kenney Westerhof wrote:
> On Tue, 21 Feb 2006, andrew cooke wrote:
>
> The simplest solution is to use the antrun plugin, and the
> <sql/> task. Be sure to add an <extensions><extension> under the <plugin>
> tag that defines antrun containing a dependency to the jdbc driver.
>
> But there might also be an sql plugin out there.
>
> -- Kenney
>>
>> no, they're just databases (SQL) (by schema i mean definitions of tables
>> and stored procedures)
>>
>> andrew



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by Kenney Westerhof <ke...@apache.org>.
On Tue, 21 Feb 2006, andrew cooke wrote:

The simplest solution is to use the antrun plugin, and the
<sql/> task. Be sure to add an <extensions><extension> under the <plugin>
tag that defines antrun containing a dependency to the jdbc driver.

But there might also be an sql plugin out there.

-- Kenney
>
> no, they're just databases (SQL) (by schema i mean definitions of tables
> and stored procedures)
>
> andrew
>
> Piéroni Raphaël wrote:
> > Do your database schema use Torque oà r hibernate ?
> >
> > Raphaël
> >
> > 2006/2/21, andrew cooke <an...@acooke.org>:
> >>
> >>
> >> Hi,
> >>
> >> I have a DB schema that defines a database.  I'd like Maven to manage
> >> this
> >> (so that I can delete/re0create the database before tests, for example).
> >> How do I do this?
> >>
> >> Thanks,
> >> Andrew
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by andrew cooke <an...@acooke.org>.
no, they're just databases (SQL) (by schema i mean definitions of tables
and stored procedures)

andrew

Piéroni Raphaël wrote:
> Do your database schema use Torque oà r hibernate ?
>
> Raphaël
>
> 2006/2/21, andrew cooke <an...@acooke.org>:
>>
>>
>> Hi,
>>
>> I have a DB schema that defines a database.  I'd like Maven to manage
>> this
>> (so that I can delete/re0create the database before tests, for example).
>> How do I do this?
>>
>> Thanks,
>> Andrew
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Database/SQL plugin? Generating DB from schema?

Posted by Piéroni Raphaël <ra...@gmail.com>.
Do your database schema use Torque oàr hibernate ?

Raphaël

2006/2/21, andrew cooke <an...@acooke.org>:
>
>
> Hi,
>
> I have a DB schema that defines a database.  I'd like Maven to manage this
> (so that I can delete/re0create the database before tests, for example).
> How do I do this?
>
> Thanks,
> Andrew
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>