FLEXDatabaseManager.h 943 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // PTDatabaseManager.h
  3. // Derived from:
  4. //
  5. // FMDatabase.h
  6. // FMDB( https://github.com/ccgus/fmdb )
  7. //
  8. // Created by Peng Tao on 15/11/23.
  9. //
  10. // Licensed to Flying Meat Inc. under one or more contributor license agreements.
  11. // See the LICENSE file distributed with this work for the terms under
  12. // which Flying Meat Inc. licenses this file to you.
  13. #import <Foundation/Foundation.h>
  14. #import "FLEXSQLResult.h"
  15. /// Conformers should automatically open and close the database
  16. @protocol FLEXDatabaseManager <NSObject>
  17. @required
  18. /// @return \c nil if the database couldn't be opened
  19. + (instancetype)managerForDatabase:(NSString *)path;
  20. /// @return a list of all table names
  21. - (NSArray<NSString *> *)queryAllTables;
  22. - (NSArray<NSString *> *)queryAllColumnsOfTable:(NSString *)tableName;
  23. - (NSArray<NSArray *> *)queryAllDataInTable:(NSString *)tableName;
  24. @optional
  25. - (FLEXSQLResult *)executeStatement:(NSString *)SQLStatement;
  26. @end