SwifterDatabaseProxy.swift 927 B

1234567891011121314151617181920212223242526
  1. //
  2. // ActiveRecordProxy.swift
  3. // Swifter
  4. // Copyright (c) 2014 Damian Kołakowski. All rights reserved.
  5. //
  6. import Foundation
  7. enum SwifterDatabseProxyType {
  8. case String, Integer, Float, Unknown
  9. }
  10. protocol SwifterDatabseProxy {
  11. func scheme(error: NSErrorPointer?) -> [String: [(String, String)]]?;
  12. func createTable(name: String, columns: [String: String], error: NSErrorPointer?) -> Bool;
  13. func deleteTable(name: String, error: NSErrorPointer?) -> Bool;
  14. func insertColumn(table: String, column: String, error: NSErrorPointer?) -> Bool;
  15. func deleteColumn(table: String, column: String, error: NSErrorPointer?) -> Bool;
  16. func copyColumn(table: String, from: String, to: String, error: NSErrorPointer?) -> Bool;
  17. func insertRow(table: String, value: [String: String], error: NSErrorPointer?) -> Int;
  18. func deleteRow(table: String, id: Int, error: NSErrorPointer?) -> Bool;
  19. }