Re: SQL parsing suggestions?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Vance Maverick <vmaverick(at)pgp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL parsing suggestions?
Date: 2006-07-11 17:54:38
Message-ID: AEBB0671-D54A-4819-9236-482F59B4C2A5@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jul 11, 2006, at 11:49 AM, Vance Maverick wrote:

> I have a PostgreSQL schema definition. I'd like to be able to use
> it as
> the basis for code generation in a software build process --
> specifically, I want to generate Java enums corresponding to the table
> definitions. However, it would be inconvenient to have to connect
> to a
> running database during the build.
>
> What approach would people suggest?

I would suggest connect to a running database during the build :)

Maybe if you don't want to connect for every build, you could create
a procedure that runs as part of any schema update to the database.
This procedure would generate a simple, easily-to-parse file of the
schema information you need for your build. Building this file from
the information schema when you are connected to the database should
be an easy task in comparison to creating a parser.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guido Neitzer 2006-07-11 18:01:32 Re: pgsql vs mysql
Previous Message Merlin Moncure 2006-07-11 17:36:16 Re: pgsql vs mysql