As an idea for the future, when there is time and bodies available... With minimal work, it might be easy to add a complementary LOAD command.
I think the major obstacle is that SCRIPT currently always includes the database users, which I've found to be the overriding issue when attempting to use the SCRIPT <file> output to populate another instance (have to manually edit file to remove users, since SA and other common user names are likely to clash with target db). Perhaps the easiest easy solution to this would be SCRIPT <file> [WITH OPTION] [NO] USERS Obvious extensions are: [NO] DATA [NO] DDL -- synonym for USERS, TABLES, CONSTRAINTS, INDEXES, GRANTS... [NO] TABLES [NO] CONSTRAINTS [NO] INDEXES [NO] GRANTS [NO] ALIASES etc. e.g. SCRIPT <file> DATA -- just scripts the data SCRIPT <file> NO DATA -- scripts all DDL but no data SCRIPT <file> NO USERS -- scripts DML and all DDL except user definitions LOAD <file> would then only need to do a simple job: execute a script file in the form created by SCRIPT, rather than having to include logic to ignore certain DDL and DML forms (which would require a major reworking of DatabaseCommandInterpreter) A less obvious (but quite interesting) extension would be: [USING] FILE PER OBJECT (e.g. MY_TABLE.tab, MY_TABLE.dat, MY_TABLE_INDEX_1.idx) of course, this last point is treading on a full internal dump/restore facility, which would likely better be implemented at a lower level (for efficiency and safety). C:\ On Sat, 2005-03-19 at 18:23, fredt wrote: > The SCRIPT <filename> command uses ScriptWriterText. The readers are > not currently used with all-in-memory databases, but they might in the > future for importing data. We also have a files_readonly mode that > uses the readers. > > Fred > ----- Original Message ----- > From: Irum Godil > To: [email protected] > Sent: 19 March 2005 23:24 > Subject: Re: [Hsqldb-developers] Scripting in HSQL > > But all the files in scriptio package such as > ScriptWriterText, ScriptReaderBase, etc. are only useful for > persistent databases right? > > fredt <[EMAIL PROTECTED]> wrote: > Sure, see the documentation. Both "SCRIPT" and "SCRIPT > <filename>" can be used for pure in-memory databases > and are obviously useful commands. > > Fred > ----- Original Message ----- > From: Irum Godil > To: hsql > Sent: 19 March 2005 22:01 > Subject: [Hsqldb-developers] Scripting in HSQL > > Hi, > > I would like to know that is the SCRIPT > Statement on the database only applied in case > of Persistent databases, or is it also useful > for pure-in memory databases? I am assuming > that all the ScriptWriter and Reader classes > are used in the context of Persistent > databases only, but I am not too sure about > the org.hsqldb.DatabaseScript class, if it can > be used for transient databases as well? > > Any help will be appreciated. I am refactoring > the application to only support In-Memory > databases in the code, and make persistence an > aspect, that is why I need to be sure what is > useful for only persistent cases. > > Thanks a lot. > Sincerely, > Irum Godil. > > > ______________________________________________ > Do you Yahoo!? > Yahoo! Mail - Find what you need with new > enhanced search. Learn more. > > > ______________________________________________________________ > Do you Yahoo!? > Yahoo! Small Business - Try our new resources site! ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ hsqldb-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers
