-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
518ac4e
commit cc1a445
Showing
9 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Library/Main/Processor/Processors/DropTableProcessor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// DropTableProcessor.swift | ||
// SundeedQLiteLibrary | ||
// | ||
// Created by Nour Sandid on 20/05/2024. | ||
// Copyright © 2024 LUMBERCODE. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class DropTableProcessor { | ||
func dropTable(tableName: String) async { | ||
let dropTableStatement = DropTableStatement(with: tableName).build() | ||
await SundeedQLiteConnection.pool.execute(query: dropTableStatement, | ||
parameters: nil) | ||
Sundeed.shared.tables.removeAll(where: {$0 == tableName}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// DropTableStatement.swift | ||
// SundeedQLiteLibrary | ||
// | ||
// Created by Nour Sandid on 20/05/2024. | ||
// Copyright © 2024 LUMBERCODE. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class DropTableStatement { | ||
private var tableName: String | ||
init(with tableName: String) { | ||
self.tableName = tableName | ||
} | ||
func build() -> String? { | ||
var statement = "DROP TABLE IF EXISTS \(tableName);" | ||
return statement | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters