开发者_如何学GoWhat is a good way of executing the DDL for a in-process HSQL database on the startup of the application?
I thought of selecting from INFORMATION_SCHEMA.TABLES
and if the count is zero, then i'd only execute my DDL script.
Is there a better way of doing this?
Checking the database metadata is always a good way to find out if your tables have already been created. INFORMATION_SCHEMA.TABLES reports some system tables and view as well as user tables, therefore you should select the name and schema of one of your application's tables to check the count.
精彩评论