ActiveRecordProxy.swift 841 B

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