-
-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathDatabaseDriver.swift
More file actions
29 lines (23 loc) · 1.05 KB
/
DatabaseDriver.swift
File metadata and controls
29 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Foundation
import TableProModels
public protocol DatabaseDriver: AnyObject, Sendable {
func connect() async throws
func disconnect() async throws
func ping() async throws -> Bool
func execute(query: String) async throws -> QueryResult
func cancelCurrentQuery() async throws
func fetchTables(schema: String?) async throws -> [TableInfo]
func fetchColumns(table: String, schema: String?) async throws -> [ColumnInfo]
func fetchIndexes(table: String, schema: String?) async throws -> [IndexInfo]
func fetchForeignKeys(table: String, schema: String?) async throws -> [ForeignKeyInfo]
func fetchDatabases() async throws -> [String]
func switchDatabase(to name: String) async throws
var supportsSchemas: Bool { get }
func switchSchema(to name: String) async throws
var currentSchema: String? { get }
var supportsTransactions: Bool { get }
func beginTransaction() async throws
func commitTransaction() async throws
func rollbackTransaction() async throws
var serverVersion: String? { get }
}