Frontend improvements for Databases plugin

Summary:
Specs here: https://fb.quip.com/aPPOAWMraRMT

Screenshots:
https://pxl.cl/Gngf
https://pxl.cl/Gngg
https://pxl.cl/Gngd
https://pxl.cl/GxQr
https://pxl.cl/Gngh
https://pxl.cl/Gngk
https://pxl.cl/Gngl
https://pxl.cl/Gngm

Reviewed By: quanturium

Differential Revision: D16266093

fbshipit-source-id: a5408b974875dcabcbd6055ccbb2818d0c1b25f6
This commit is contained in:
Chun-Ho Ng
2019-08-07 21:06:32 -07:00
committed by Facebook Github Bot
parent dbf0e3db43
commit fe56c8471c
7 changed files with 908 additions and 54 deletions

View File

@@ -48,6 +48,28 @@ type GetTableStructureResponse = {
definition: string,
};
type ExecuteSqlRequest = {
databaseId: number,
value: string,
};
type ExecuteSqlResponse = {
type: string,
columns: Array<string>,
values: Array<Array<Value>>,
insertedId: number,
affectedCount: number,
};
type GetTableInfoRequest = {
databaseId: number,
table: string,
};
type GetTableInfoResponse = {
definition: string,
};
export class DatabaseClient {
client: PluginClient;
@@ -67,4 +89,12 @@ export class DatabaseClient {
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);
}