|
|
|
@ -937,6 +937,7 @@ class filter(ast_node):
|
|
|
|
|
def produce(self, node):
|
|
|
|
|
filter_expr = expr(self, node)
|
|
|
|
|
self.add(filter_expr.sql)
|
|
|
|
|
if self.datasource is not None:
|
|
|
|
|
self.datasource.join_conditions += filter_expr.join_conditions
|
|
|
|
|
|
|
|
|
|
class create_table(ast_node):
|
|
|
|
@ -1053,6 +1054,18 @@ class insert(ast_node):
|
|
|
|
|
self.sql += ', '.join(list_values)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class delete_table(ast_node):
|
|
|
|
|
name = 'delete'
|
|
|
|
|
first_order = name
|
|
|
|
|
def init(self, node):
|
|
|
|
|
super().init(node)
|
|
|
|
|
|
|
|
|
|
def produce(self, node):
|
|
|
|
|
tbl = node['delete']
|
|
|
|
|
self.sql = f'DELETE FROM {tbl} '
|
|
|
|
|
if 'where' in node:
|
|
|
|
|
self.sql += filter(self, node['where']).sql
|
|
|
|
|
|
|
|
|
|
class load(ast_node):
|
|
|
|
|
name="load"
|
|
|
|
|
first_order = name
|
|
|
|
|