-
Notifications
You must be signed in to change notification settings - Fork 11
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
ed219b5
commit 354cbbb
Showing
21 changed files
with
879 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export PATH=/opt/homebrew/bin:$PATH | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Tella | ||
// | ||
// Copyright © 2022 INTERNEWS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import SQLite3 | ||
|
||
struct D { | ||
/* DATABASE */ | ||
static let databaseName = "tella_vault.db" | ||
|
||
/* DEFAULT TYPES FOR DATABASE */ | ||
static let integer = " INTEGER " | ||
static let text = " TEXT "; | ||
static let blob = " BLOB "; | ||
|
||
|
||
/* DATABASE TABLES */ | ||
|
||
static let tServer = "t_server" | ||
static let tReport = "t_report" | ||
static let tReportFiles = "t_report_files" | ||
|
||
/* DATABASE COLUMNS */ | ||
|
||
static let cId = "c_id" | ||
static let cName = "c_name" | ||
static let cURL = "c_url" | ||
static let cUsername = "c_username" | ||
static let cPassword = "c_password" | ||
|
||
|
||
static let cTitle = "c_title" | ||
static let cDescription = "c_description" | ||
static let cDate = "c_date" | ||
static let cStatus = "c_Status" | ||
static let cServerId = "c_server_id" | ||
|
||
static let cReportId = "c_report_id" | ||
static let cVaultFileId = "c_vaultFile_id" | ||
|
||
|
||
} | ||
|
||
|
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,54 @@ | ||
// Tella | ||
// | ||
// Copyright © 2022 INTERNEWS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import SQLite3 | ||
|
||
extension TellaDataBase { | ||
|
||
|
||
|
||
func cddl(_ columnName: String, _ columnType: String, primaryKey : Bool , autoIncrement : Bool) -> String { | ||
return columnName + " " + columnType + (primaryKey ? " PRIMARY KEY " : "") + (autoIncrement ? " AUTOINCREMENT " : ""); | ||
} | ||
|
||
func cddl(_ columnName: String, _ columnType: String) -> String { | ||
return columnName + " " + columnType; | ||
} | ||
|
||
func cddl(_ columnName: String, _ columnType: String, _ notNull: Bool) -> String { | ||
return (columnName) + " " + columnType + (notNull ? " NOT NULL" : "") | ||
} | ||
|
||
func cddl(_ columnName: String, _ columnType: String, _ notNull: Bool, _ defaultValue: Int) -> String { | ||
return columnName + " " + columnType + (notNull ? " NOT NULL " : "") + "DEFAULT " + "\(defaultValue)"; | ||
} | ||
|
||
|
||
func cddl(_ columnName: String, _ columnType: String, tableName : String , referenceKey : String) -> String { | ||
return columnName + " " + columnType + ", FOREIGN KEY" + " (" + columnName + ") " + " REFERENCES " + tableName + "(" + referenceKey + ")"; | ||
} | ||
|
||
|
||
func sq(_ text: String) -> String { | ||
return " " + text + " "; | ||
} | ||
|
||
func objQuote(_ str: String) -> String { | ||
return "'" + str + "'"; | ||
} | ||
|
||
func objDoubleQuote(_ str: String) -> String { | ||
return "\"" + str + "\""; | ||
} | ||
|
||
|
||
|
||
func comma() -> String { | ||
return " , "; | ||
} | ||
|
||
|
||
} |
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 @@ | ||
// Tella | ||
// | ||
// Copyright © 2022 INTERNEWS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
class JoinCondition { | ||
|
||
var tableName :String | ||
var firstItem : JoinItem | ||
var secondItem : JoinItem | ||
|
||
init(tableName: String, firstItem: JoinItem, secondItem: JoinItem) { | ||
self.tableName = tableName | ||
self.firstItem = firstItem | ||
self.secondItem = secondItem | ||
} | ||
} |
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,12 @@ | ||
// Tella | ||
// | ||
// Copyright © 2022 INTERNEWS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
struct KeyValue { | ||
var key : String | ||
var value : Any | ||
} |
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,28 @@ | ||
// Tella | ||
// | ||
// Copyright © 2022 INTERNEWS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
class JoinItem { | ||
|
||
var tableName: String | ||
var columnName : String | ||
|
||
init(tableName: String, columnName: String) { | ||
self.tableName = tableName | ||
self.columnName = columnName | ||
} | ||
|
||
func format() -> String { | ||
return (objDoubleQuote(tableName) + "." + objDoubleQuote(columnName)) | ||
} | ||
|
||
func objDoubleQuote(_ str: String) -> String { | ||
return "\"" + str + "\""; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.