2024-03-20 06:07:48 +08:00
export const normalTableName = 'normalTable' ;
export const tableNameWithSpecialCharacter = 'table-name' ;
export const tablesResponse = {
results : {
tables : {
status : 200 ,
frames : [
{
schema : {
refId : 'tables' ,
meta : {
executedQueryString :
"SELECT table_name FROM information_schema.tables WHERE table_schema = 'DataMaker' ORDER BY table_name" ,
} ,
fields : [ { name : 'TABLE_NAME' , type : 'string' , typeInfo : { frame : 'string' , nullable : true } } ] ,
} ,
data : { values : [ [ normalTableName , tableNameWithSpecialCharacter ] ] } ,
} ,
] ,
} ,
} ,
} ;
2024-11-05 00:13:35 +08:00
export const fieldsResponse = ( refId : string ) = > ( {
2024-03-20 06:07:48 +08:00
results : {
2024-11-05 00:13:35 +08:00
[ refId ] : {
2024-03-20 06:07:48 +08:00
status : 200 ,
frames : [
{
schema : {
2024-11-05 00:13:35 +08:00
refId ,
2024-03-20 06:07:48 +08:00
meta : {
executedQueryString :
"SELECT column_name, data_type FROM information_schema.columns WHERE table_schema = 'DataMaker' AND table_name = 'RandomIntsWithTimes' ORDER BY column_name" ,
} ,
fields : [
{ name : 'COLUMN_NAME' , type : 'string' , typeInfo : { frame : 'string' , nullable : true } } ,
{ name : 'DATA_TYPE' , type : 'string' , typeInfo : { frame : 'string' , nullable : true } } ,
] ,
} ,
data : {
values : [
[ 'createdAt' , 'id' , 'time' , 'updatedAt' , 'bigint' ] ,
[ 'datetime' , 'int' , 'datetime' , 'datetime' , 'int' ] ,
] ,
} ,
} ,
] ,
} ,
} ,
2024-11-05 00:13:35 +08:00
} ) ;
2024-03-20 06:07:48 +08:00
export const datasetResponse = {
results : {
datasets : {
status : 200 ,
frames : [
{
schema : {
refId : 'datasets' ,
meta : {
executedQueryString :
"SELECT DISTINCT TABLE_SCHEMA from information_schema.TABLES where TABLE_TYPE != 'SYSTEM VIEW' ORDER BY TABLE_SCHEMA" ,
} ,
fields : [ { name : 'TABLE_SCHEMA' , type : 'string' , typeInfo : { frame : 'string' , nullable : true } } ] ,
} ,
data : { values : [ [ 'DataMaker' , 'mysql' , 'performance_schema' , 'sys' ] ] } ,
} ,
] ,
} ,
} ,
} ;