I was reading the forum and noticed that there are requests to change file extensions or to somehow customize extensions.
I would like to propose a method in H2 format that would make H2 discoverable and independent from file extension format so to give freedom for people to have any extension they want for the H2 database files they would like to name it as. H2 in Page Store format seems to have a header that says "-- H2 0.5/B --" and it may have three lines of that header. It could be used to identify H2 files from other files by the header rather then file extensions and so users can simply make up their extensions as they want as long as the header is intact. H2 could also allow users to target specific database files .e.g. "~/ DB/MyDbFiles.myExt" so by doing that, users could have their own extensions as long as the files have the correct formatting. H2 would need to read the header of the file and check basic formatting to positively ID that the file is genuinely H2 too. I know H2 have trace and log files too and the ability to extend the proposed ability to allow users to have free control over the file extensions do apply. I would like to propose a change of H2 header format to allow the extensibility and unify formats across H2. Below is my proposal and is designed to have as minimal disruptions as possible to the current H2 format if possible. Skeletal format: --<space>H2<space><version of file format protocol>/<alpha (A), beta (B), stable (S)><space><filetype><space><Engine Version><space>-- Example: "-- H2 0.5/B D 1.2.147--" means: H2, version 0.5 protocol Beta and filetype: D. Engine of creation is 1.2.147 database. The format should be able to accept users who refuse to include the engine version in case they do not wish to specify which version of H2 they are using to create the database. Datatype available: B - blobs C - clobs D - normal database file T - trace / log files End of file format: -- H2 eof -- //H2 end of file It is not necessary to have eof (end-of-file) but it is a good practise to do so. Possible drawbacks: - Slower engine ? Could be tweaked and enhanced just to handle it. - Additional space for headers and eofs ? Not really big actually. - Changing H2 page store format versions is troublesome ? Proper and lightweight conversion / file IO tools. - "Header overload" syndrome whereby taking advantage of extensibility of header, could dump all information and metadata into header ? Strict formatting of header. Possible advantages: - Clearer distinction by using a better header and possibly with eofs (enders). - Customizability of file extensions - Protocol longevity and extensibility. For those who may want to compare headers and everything: Currently some H2 have 3 lines of "-- H2 0.5/B --" but it could be reduced to 1 single line of header as I proposed. I estimate that 3 lines of the current H2 header is 14 characters in UTF-8 and in total 3 lines which is about 336 bits or 42 bytes. (Disclaimer: I cannot say this numbers are correct to the point as I am no expert in H2 format.) With the proposed headers and eofs with only 1 line needed for header and an optional eof including optional specification of type of database engine being used in creation of file: 35 characters in UTF-8 = 280 bits or 35 bytes. Additional goodies: If you have a header and a eof I proposed, you can add additional data in front of the header and end of eof in the below manner which can make the file even more flexible to your liking. ...your other stuff... //Main H2 data -- H2 0.5/B D 1.2.147-- <H2 data> -- H2 eof -- //Another H2 CLOB stored -- H2 0.5/B C 1.2.147-- <H2 CLOB data> -- H2 eof -- //Another H2 Trace stored -- H2 0.5/B T 1.2.147-- <H2 Trace data> -- H2 eof -- ... your other stuff ... What happens is that you could literally add stuff before and after H2 data and maybe you could store blobs, normal h2 data and logs together in a file but the bad thing is once the file is gone, all is lost. Another possible thing is that you can store multiple instance of H2 databases and H2 items in a single file but that is really really complex. Thanks for reading this really long message post. Thanks Regards, Thotheolh. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-datab...@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.