Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 24301 invoked from network); 23 Nov 2006 22:17:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Nov 2006 22:17:25 -0000 Received: (qmail 5377 invoked by uid 500); 23 Nov 2006 22:17:34 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 5316 invoked by uid 500); 23 Nov 2006 22:17:34 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Received: (qmail 5304 invoked by uid 99); 23 Nov 2006 22:17:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2006 14:17:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2006 14:17:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ECB297142C3 for ; Thu, 23 Nov 2006 14:17:03 -0800 (PST) Message-ID: <27952755.1164320223966.JavaMail.jira@brutus> Date: Thu, 23 Nov 2006 14:17:03 -0800 (PST) From: "Thomas Dudziak (JIRA)" To: ddlutils-dev@db.apache.org Subject: [jira] Updated: (DDLUTILS-133) Command-Line Invoker In-Reply-To: <4966905.1164273306232.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DDLUTILS-133?page=all ] Thomas Dudziak updated DDLUTILS-133: ------------------------------------ Fix Version/s: 1.1 Sounds good too me ! Please check out whether you can use commons-cli (http://jakarta.apache.org/commons/cli/) to do the commandline parsing. Some suggestions: * In general, it is most useful to have the CLI in one jar file with wrapper shell script/batch files. Invocation then would be java -jar ddlutils-cli.jar ... or ddlutils ... * I would organize the commandline as follows: ddlutils
E.g. ddlutils createdb -cp $CLASSPATH -driver ... -username ... * For entering the password, the commandline interface should provide some interactive means (e.g. stdin). * It is quite useful to allow the specification of options via properties files. E.g. ddlutils createdb -cp $CLASSPATH -options classpath:derby.properties (loads the options file from the classpath) or ddlutils createdb -cp $CLASSPATH -options derby/derby.properties * Normal output should go to stdout (esp. if reading a schema XML from the database) unless a -output (or similar) option is used. This makes piping quite easy. * Logging should be configured to print to stderr, and have WARN as default. This can be done in code or via a log4j proeprties file embedded in the cli jar. Let me know wdyt and if you need help with this. > Command-Line Invoker > -------------------- > > Key: DDLUTILS-133 > URL: http://issues.apache.org/jira/browse/DDLUTILS-133 > Project: DdlUtils > Issue Type: New Feature > Components: Ant Tasks > Reporter: Alexander Hars > Assigned To: Thomas Dudziak > Priority: Minor > Fix For: 1.1 > > > We should be able to use DdlUtils even in non-Java, non-Ant environments. For example, I would like to use DdlUtils for running unit tests in PHP. My Php tests are not executed using Ant. > It would not be very complicated to extend the tasks classes with a few CommandLine tasks. They can be modeled on the Ant tasks. > Parameters could be, for example (just an initial set): > cmd=(createDb | dropDb | SchemaToDb | DataToDb | DbToDtd | DataToFile | SchemaToFile | SchemaSqlToFile) > driver= > url= > user= > password= > file= > .. > This way, DdlUtils could be used very easily with many more programming languages and target environments. The programmer would only have to have the JRE, the DdlUtils jars (including dependencies) and the database driver installed to use DdlUtils. > I am willing to do this, but need your feedback if this makes sense. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira