.
This commit is contained in:
23
src/main/resources/tpl/sql/db.sql
Normal file
23
src/main/resources/tpl/sql/db.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
#define arrToStr(arr)
|
||||
#for(x : arr)
|
||||
'#(x)' #if(!for.last),#end
|
||||
#end
|
||||
#end
|
||||
|
||||
#sql("db.table_list")
|
||||
SELECT TABLE_NAME 'name',TABLE_COMMENT 'comment',table_schema 'catalog' FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE 1=1
|
||||
#if(catalogs)
|
||||
AND TABLE_SCHEMA IN (#@arrToStr(catalogs))
|
||||
#end
|
||||
#if(catalog)
|
||||
AND TABLE_SCHEMA = '#(catalog)'
|
||||
#end
|
||||
|
||||
#if(tables)
|
||||
AND TABLE_NAME IN (#@arrToStr(tables))
|
||||
#end
|
||||
#if(table)
|
||||
AND TABLE_NAME = '#(table)'
|
||||
#end
|
||||
#end
|
||||
Reference in New Issue
Block a user