Hi Thomas, I've been quietly implementing the "INIT=" functionality and have come to a decision point that I'm SURE you'll want to contribute to.
The "INIT=<url>" description below is very similar to the RUNSCRIPT command, so I came to the conclusion that I might as well just use it directly, and rather than "INIT=<url>" I'd support "INIT=<command>", which would in turn let me support the requirement with: ";INIT=RUNSCRIPT FROM <url>" (lets call this Option 1) This also fixes problems with CHARSET issues, because RUNSCRIPT handles that too. If you'd prefer I could just use "RUNSCRIPT" behind the scenes, and use the originally suggested notation, plus support for RUNSCRIPT options: ";INIT=<url> [with support for all the optional RUNSCRIPT parameters too]" (lets call this Option 2) or perhaps, if it's clearer: ";RUNSCRIPT=<url> [with support for all the optional RUNSCRIPT parameters too]" (lets call this Option 3) So, which option do you like? Or have you a 4th suggestion? Cheers Kerry On Tue, Dec 15, 2009 at 9:08 AM, Thomas Mueller < [email protected]> wrote: > Hi, > > > The ability to auto-create schema (based on connection string) for in- > > memory mode would be very helpful.. > > Just creating the schema may solve your specific problem, however I > don't want to add it, because it sounds like a hack. I will add a > feature request for the following feature: > > If the database URL ends with ";INIT=<url>" then the SQL script from > the given file or URL is executed (the user name must have admin > rights). Example URL: jdbc:h2:mem:test;INIT=~/init.sql > > That would allow to create schemas, tables, and data. > > However, I will not have time to implement this feature currently. > Patches are always welcome of course! > > Regards, > Thomas > > -- > > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<h2-database%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
