Databases plugin migrated to Sandy functional API
Summary: Converted Databases plugin to Sandy functional API Reviewed By: mweststrate Differential Revision: D27999205 fbshipit-source-id: e9d2c7aa5858b9da3c1672efbb558fb6b1077b6b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
140cf38ffd
commit
c2a07e7638
@@ -7,9 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {PluginClient, Value} from 'flipper';
|
||||
|
||||
type ClientCall<Params, Response> = (arg: Params) => Promise<Response>;
|
||||
import {Value} from 'flipper';
|
||||
|
||||
type DatabaseListRequest = {};
|
||||
|
||||
@@ -71,28 +69,14 @@ type GetTableInfoResponse = {
|
||||
definition: string;
|
||||
};
|
||||
|
||||
export class DatabaseClient {
|
||||
client: PluginClient;
|
||||
export type Methods = {
|
||||
databaseList(params: DatabaseListRequest): Promise<DatabaseListResponse>;
|
||||
getTableData(params: QueryTableRequest): Promise<QueryTableResponse>;
|
||||
getTableStructure(
|
||||
params: GetTableStructureRequest,
|
||||
): Promise<GetTableStructureResponse>;
|
||||
execute(params: ExecuteSqlRequest): Promise<ExecuteSqlResponse>;
|
||||
getTableInfo(params: GetTableInfoRequest): Promise<GetTableInfoResponse>;
|
||||
};
|
||||
|
||||
constructor(pluginClient: PluginClient) {
|
||||
this.client = pluginClient;
|
||||
}
|
||||
|
||||
getDatabases: ClientCall<DatabaseListRequest, DatabaseListResponse> = () =>
|
||||
this.client.call('databaseList', {});
|
||||
|
||||
getTableData: ClientCall<QueryTableRequest, QueryTableResponse> = (params) =>
|
||||
this.client.call('getTableData', params);
|
||||
|
||||
getTableStructure: ClientCall<
|
||||
GetTableStructureRequest,
|
||||
GetTableStructureResponse
|
||||
> = (params) => this.client.call('getTableStructure', params);
|
||||
|
||||
getExecution: ClientCall<ExecuteSqlRequest, ExecuteSqlResponse> = (params) =>
|
||||
this.client.call('execute', params);
|
||||
|
||||
getTableInfo: ClientCall<GetTableInfoRequest, GetTableInfoResponse> = (
|
||||
params,
|
||||
) => this.client.call('getTableInfo', params);
|
||||
}
|
||||
export type Events = {};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,9 @@
|
||||
"react-redux": "^7.2.3",
|
||||
"redux-mock-store": "^1.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"flipper-plugin": "*"
|
||||
},
|
||||
"bugs": {
|
||||
"email": "oncall+flipper@xmail.facebook.com",
|
||||
"url": "https://fb.workplace.com/groups/flippersupport/"
|
||||
|
||||
Reference in New Issue
Block a user