File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ extension SchemaType {
2727 // MARK: - DROP TABLE / VIEW / VIRTUAL TABLE
2828
2929 public func drop( ifExists ifExists: Bool = false ) -> String {
30- return drop ( Self . identifier , tableName ( ) , ifExists)
30+ return drop ( " TABLE " , tableName ( ) , ifExists)
3131 }
3232
3333}
@@ -183,6 +183,12 @@ extension View {
183183 return " " . join ( clauses. flatMap { $0 } ) . asSQL ( )
184184 }
185185
186+ // MARK: - DROP VIEW
187+
188+ public func drop( ifExists ifExists: Bool = false ) -> String {
189+ return drop ( " VIEW " , tableName ( ) , ifExists)
190+ }
191+
186192}
187193
188194extension VirtualTable {
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ class SchemaTests : XCTestCase {
99 }
1010
1111 func test_drop_compilesDropVirtualTableExpression( ) {
12- XCTAssertEqual ( " DROP VIRTUAL TABLE \" virtual_table \" " , virtualTable. drop ( ) )
13- XCTAssertEqual ( " DROP VIRTUAL TABLE IF EXISTS \" virtual_table \" " , virtualTable. drop ( ifExists: true ) )
12+ XCTAssertEqual ( " DROP TABLE \" virtual_table \" " , virtualTable. drop ( ) )
13+ XCTAssertEqual ( " DROP TABLE IF EXISTS \" virtual_table \" " , virtualTable. drop ( ifExists: true ) )
1414 }
1515
1616 func test_drop_compilesDropViewExpression( ) {
You can’t perform that action at this time.
0 commit comments