[SQL Lab] Allow running multiple statements (#6112)

* Allow running multiple statements from SQL Lab

* fix tests

* More tests

* merge heads

* fix heads
This commit is contained in:
Maxime Beauchemin
2018-12-22 10:28:22 -08:00
committed by Beto Dealmeida
parent 6e942c9fb3
commit d427db0a8b
19 changed files with 357 additions and 205 deletions

View File

@@ -12,12 +12,15 @@ from sqlalchemy import (
from sqlalchemy.orm import backref, relationship
from superset import security_manager
from superset.models.helpers import AuditMixinNullable
from superset.models.helpers import AuditMixinNullable, ExtraJSONMixin
from superset.utils.core import QueryStatus, user_label
class Query(Model):
"""ORM model for SQL query"""
class Query(Model, ExtraJSONMixin):
"""ORM model for SQL query
Now that SQL Lab support multi-statement execution, an entry in this
table may represent multiple SQL statements executed sequentially"""
__tablename__ = 'query'
id = Column(Integer, primary_key=True)
@@ -105,6 +108,7 @@ class Query(Model):
'limit_reached': self.limit_reached,
'resultsKey': self.results_key,
'trackingUrl': self.tracking_url,
'extra': self.extra,
}
@property