--- a/generate/bin/template-sqlite-filter.py
+++ b/generate/bin/template-sqlite-filter.py
@@ -22,6 +22,9 @@
 
 cv1=r'CREATE OR REPLACE VIEW ([^\s]*) AS'
 cv2=r'DROP VIEW IF EXISTS \1; CREATE VIEW \1 AS'
+cv10=r'base%\$(X|Y|Z)\$~\$(X|Y|Z)\$'
+cv20=r'base%$\1$$\2$'
+
 pk1=r'^([^=]*).create=(.*)PRIMARY KEY(.*)$'
 pk2=r'\1.create=\2CONSTRAINT pk_%\1.table% PRIMARY KEY\3'
 bc1=r'\sBINARY COLLATE utf8_bin'
@@ -75,6 +78,7 @@
 		line=replace(bc1,bc2,line)
 	if re.match("^.*=CREATE OR REPLACE VIEW.*$", line):
 		line=replace(cv1,cv2,line)
+		line=replace(cv10,cv20,line)
 		
 	line=replace(gc1,gc2,line)