diff --git a/e2e-tests/cypress/e2e/browse-data.cy.js b/e2e-tests/cypress/e2e/browse-data.cy.js index c7a5b0f4c..42682550f 100644 --- a/e2e-tests/cypress/e2e/browse-data.cy.js +++ b/e2e-tests/cypress/e2e/browse-data.cy.js @@ -13,20 +13,20 @@ beforeEach(() => { }); describe('Data browser data', () => { - it('Export to data archive', () => { - cy.contains('MySql-connection').click(); - // cy.contains('MyChinook').click(); - // cy.contains('Album').click(); - cy.contains('MyChinook').rightclick(); - cy.contains('Export').click(); - cy.wait(1000); - cy.testid('SourceTargetConfig_buttonCurrentArchive_target').click(); - cy.testid('FormTablesSelect_buttonAll_tables').click(); - // cy.wait(4000); - // cy.contains('All tables').click(); - cy.contains('Run').click(); - cy.contains('Finished job script'); - }); + // it('Export to data archive', () => { + // cy.contains('MySql-connection').click(); + // // cy.contains('MyChinook').click(); + // // cy.contains('Album').click(); + // cy.contains('MyChinook').rightclick(); + // cy.contains('Export').click(); + // cy.wait(1000); + // cy.testid('SourceTargetConfig_buttonCurrentArchive_target').click(); + // cy.testid('FormTablesSelect_buttonAll_tables').click(); + // // cy.wait(4000); + // // cy.contains('All tables').click(); + // cy.contains('Run').click(); + // cy.contains('Finished job script'); + // }); it('Data archive editor - macros', () => { cy.testid('WidgetIconPanel_archive').click(); @@ -197,4 +197,52 @@ describe('Data browser data', () => { cy.contains('CREATE INDEX `IFK_CustomerSupportRepId`'); cy.themeshot('sqlpreview'); }); + + it('Query designer', () => { + cy.contains('MySql-connection').click(); + cy.contains('MyChinook').click(); + cy.testid('WidgetIconPanel_file').click(); + cy.contains('customer').click(); + // cy.contains('left join').rightclick(); + cy.themeshot('querydesigner'); + }); + + it('Database diagram', () => { + cy.contains('MySql-connection').click(); + cy.contains('MyChinook').click(); + cy.testid('WidgetIconPanel_file').click(); + cy.contains('chinook-diagram').click(); + cy.testid('WidgetIconPanel_file').click(); + // check diagram is shown + cy.contains('MediaTypeId'); + cy.themeshot('diagram'); + }); + + it('Charts', () => { + cy.testid('WidgetIconPanel_file').click(); + cy.contains('pie-chart').click(); + cy.contains('line-chart').click(); + cy.testid('TabsPanel_buttonSplit').click(); + cy.testid('WidgetIconPanel_file').click(); + cy.themeshot('charts'); + }); + + it('Keyboard configuration', () => { + cy.testid('WidgetIconPanel_settings').click(); + cy.contains('Keyboard shortcuts').click(); + cy.contains('dataForm.refresh').click(); + cy.testid('CommandModal_keyboardButton').click(); + cy.themeshot('keyboard'); + }); + + it('Command palette', () => { + cy.contains('Connections'); + cy.testid('WidgetIconPanel_menu').click(); + cy.contains('Tools').click(); + cy.contains('Command palette').click(); + // cy.realPress('F1'); + cy.realPress('PageDown'); + cy.realPress('PageDown'); + cy.testid('CommandPalette_main').themeshot('commandpalette', { padding: 50 }); + }); }); diff --git a/e2e-tests/cypress/support/commands.js b/e2e-tests/cypress/support/commands.js index cc0385e2c..9723f5e03 100644 --- a/e2e-tests/cypress/support/commands.js +++ b/e2e-tests/cypress/support/commands.js @@ -30,50 +30,64 @@ Cypress.Commands.add('testid', (testId, options = {}) => { return cy.get(`[data-testid="${testId}"]`, options); }); -Cypress.Commands.add('themeshot', file => { - cy.window().then(win => { - win.__changeCurrentTheme('theme-dark'); - }); +Cypress.Commands.add( + 'themeshot', + { + prevSubject: 'optional', + }, + (subject, file, options) => { + cy.window().then(win => { + win.__changeCurrentTheme('theme-dark'); + }); - // cy.screenshot(`${file}-dark`, { - // onAfterScreenshot: (doc, props) => { - // cy.task('renameFile', { - // from: props.path, - // to: path.resolve(__dirname, `../../screenshots/${file}-dark.png`), - // }); + // cy.screenshot(`${file}-dark`, { + // onAfterScreenshot: (doc, props) => { + // cy.task('renameFile', { + // from: props.path, + // to: path.resolve(__dirname, `../../screenshots/${file}-dark.png`), + // }); - // // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-dark.png`))); - // }, - // }); + // // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-dark.png`))); + // }, + // }); - cy.screenshot(`${file}-dark`); - // .then(props => { - // return cy.task('renameFile', { - // from: props.path, - // to: path.resolve(__dirname, `../../screenshots/${file}-dark.png`), - // }); - // }); + if (subject) { + cy.wrap(subject).screenshot(`${file}-dark`, options); + } else { + cy.screenshot(`${file}-dark`, options); + } + // .then(props => { + // return cy.task('renameFile', { + // from: props.path, + // to: path.resolve(__dirname, `../../screenshots/${file}-dark.png`), + // }); + // }); - cy.window().then(win => { - win.__changeCurrentTheme('theme-light'); - }); + cy.window().then(win => { + win.__changeCurrentTheme('theme-light'); + }); - cy.screenshot(`${file}-light`); - // .then(props => { - // return cy.task('renameFile', { - // from: props.path, - // to: path.resolve(__dirname, `../../screenshots/${file}-light.png`), - // }); - // }); + if (subject) { + cy.wrap(subject).screenshot(`${file}-light`, options); + } else { + cy.screenshot(`${file}-light`, options); + } + // .then(props => { + // return cy.task('renameFile', { + // from: props.path, + // to: path.resolve(__dirname, `../../screenshots/${file}-light.png`), + // }); + // }); - // cy.screenshot(`${file}-light`, { - // onAfterScreenshot: (doc, props) => { - // cy.task('renameFile', { - // from: props.path, - // to: path.resolve(__dirname, `../../screenshots/${file}-light.png`), - // }); + // cy.screenshot(`${file}-light`, { + // onAfterScreenshot: (doc, props) => { + // cy.task('renameFile', { + // from: props.path, + // to: path.resolve(__dirname, `../../screenshots/${file}-light.png`), + // }); - // // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-light.png`))); - // }, - // }); -}); + // // fs.rename(props.path, path.resolve(path.join(__dirname, `../../screenshots/${file}-light.png`))); + // }, + // }); + } +); diff --git a/e2e-tests/data/mongo/Album.jsonl b/e2e-tests/data/chinook-jsonl/Album.jsonl similarity index 100% rename from e2e-tests/data/mongo/Album.jsonl rename to e2e-tests/data/chinook-jsonl/Album.jsonl diff --git a/e2e-tests/data/mongo/Artist.jsonl b/e2e-tests/data/chinook-jsonl/Artist.jsonl similarity index 100% rename from e2e-tests/data/mongo/Artist.jsonl rename to e2e-tests/data/chinook-jsonl/Artist.jsonl diff --git a/e2e-tests/data/mongo/Customer.jsonl b/e2e-tests/data/chinook-jsonl/Customer.jsonl similarity index 100% rename from e2e-tests/data/mongo/Customer.jsonl rename to e2e-tests/data/chinook-jsonl/Customer.jsonl diff --git a/e2e-tests/data/mongo/Employee.jsonl b/e2e-tests/data/chinook-jsonl/Employee.jsonl similarity index 100% rename from e2e-tests/data/mongo/Employee.jsonl rename to e2e-tests/data/chinook-jsonl/Employee.jsonl diff --git a/e2e-tests/data/mongo/Genre.jsonl b/e2e-tests/data/chinook-jsonl/Genre.jsonl similarity index 100% rename from e2e-tests/data/mongo/Genre.jsonl rename to e2e-tests/data/chinook-jsonl/Genre.jsonl diff --git a/e2e-tests/data/mongo/Invoice.jsonl b/e2e-tests/data/chinook-jsonl/Invoice.jsonl similarity index 100% rename from e2e-tests/data/mongo/Invoice.jsonl rename to e2e-tests/data/chinook-jsonl/Invoice.jsonl diff --git a/e2e-tests/data/mongo/InvoiceLine.jsonl b/e2e-tests/data/chinook-jsonl/InvoiceLine.jsonl similarity index 100% rename from e2e-tests/data/mongo/InvoiceLine.jsonl rename to e2e-tests/data/chinook-jsonl/InvoiceLine.jsonl diff --git a/e2e-tests/data/mongo/MediaType.jsonl b/e2e-tests/data/chinook-jsonl/MediaType.jsonl similarity index 100% rename from e2e-tests/data/mongo/MediaType.jsonl rename to e2e-tests/data/chinook-jsonl/MediaType.jsonl diff --git a/e2e-tests/data/mongo/Playlist.jsonl b/e2e-tests/data/chinook-jsonl/Playlist.jsonl similarity index 100% rename from e2e-tests/data/mongo/Playlist.jsonl rename to e2e-tests/data/chinook-jsonl/Playlist.jsonl diff --git a/e2e-tests/data/mongo/PlaylistTrack.jsonl b/e2e-tests/data/chinook-jsonl/PlaylistTrack.jsonl similarity index 100% rename from e2e-tests/data/mongo/PlaylistTrack.jsonl rename to e2e-tests/data/chinook-jsonl/PlaylistTrack.jsonl diff --git a/e2e-tests/data/mongo/Track.jsonl b/e2e-tests/data/chinook-jsonl/Track.jsonl similarity index 100% rename from e2e-tests/data/mongo/Track.jsonl rename to e2e-tests/data/chinook-jsonl/Track.jsonl diff --git a/e2e-tests/data/files/charts/line-chart b/e2e-tests/data/files/charts/line-chart new file mode 100644 index 000000000..a3342585e --- /dev/null +++ b/e2e-tests/data/files/charts/line-chart @@ -0,0 +1 @@ +{"data":{"structure":{"columns":[{"columnName":"Month"},{"columnName":"Total"},{"columnName":"Invoices"}]},"rows":[{"Month":"2021-01","Total":"35.64","Invoices":"6"},{"Month":"2021-02","Total":"37.62","Invoices":"7"},{"Month":"2021-03","Total":"37.62","Invoices":"7"},{"Month":"2021-04","Total":"37.62","Invoices":"7"},{"Month":"2021-05","Total":"37.62","Invoices":"7"},{"Month":"2021-06","Total":"37.62","Invoices":"7"},{"Month":"2021-07","Total":"37.62","Invoices":"7"},{"Month":"2021-08","Total":"37.62","Invoices":"7"},{"Month":"2021-09","Total":"37.62","Invoices":"7"},{"Month":"2021-10","Total":"37.62","Invoices":"7"},{"Month":"2021-11","Total":"37.62","Invoices":"7"},{"Month":"2021-12","Total":"37.62","Invoices":"7"},{"Month":"2022-01","Total":"52.62","Invoices":"7"},{"Month":"2022-02","Total":"46.62","Invoices":"7"},{"Month":"2022-03","Total":"44.62","Invoices":"7"},{"Month":"2022-04","Total":"37.62","Invoices":"7"},{"Month":"2022-05","Total":"37.62","Invoices":"7"},{"Month":"2022-06","Total":"37.62","Invoices":"7"},{"Month":"2022-07","Total":"37.62","Invoices":"7"},{"Month":"2022-08","Total":"37.62","Invoices":"7"},{"Month":"2022-09","Total":"36.63","Invoices":"6"},{"Month":"2022-10","Total":"37.62","Invoices":"7"},{"Month":"2022-11","Total":"37.62","Invoices":"7"},{"Month":"2022-12","Total":"37.62","Invoices":"7"},{"Month":"2023-01","Total":"37.62","Invoices":"7"},{"Month":"2023-02","Total":"37.62","Invoices":"7"},{"Month":"2023-03","Total":"37.62","Invoices":"7"},{"Month":"2023-04","Total":"51.62","Invoices":"7"},{"Month":"2023-05","Total":"42.62","Invoices":"7"},{"Month":"2023-06","Total":"50.62","Invoices":"7"},{"Month":"2023-07","Total":"37.62","Invoices":"7"},{"Month":"2023-08","Total":"37.62","Invoices":"7"},{"Month":"2023-09","Total":"37.62","Invoices":"7"},{"Month":"2023-10","Total":"37.62","Invoices":"7"},{"Month":"2023-11","Total":"23.76","Invoices":"6"},{"Month":"2023-12","Total":"37.62","Invoices":"7"},{"Month":"2024-01","Total":"37.62","Invoices":"7"},{"Month":"2024-02","Total":"37.62","Invoices":"7"},{"Month":"2024-03","Total":"37.62","Invoices":"7"},{"Month":"2024-04","Total":"37.62","Invoices":"7"},{"Month":"2024-05","Total":"37.62","Invoices":"7"},{"Month":"2024-06","Total":"37.62","Invoices":"7"},{"Month":"2024-07","Total":"39.62","Invoices":"7"},{"Month":"2024-08","Total":"47.62","Invoices":"7"},{"Month":"2024-09","Total":"46.71","Invoices":"6"},{"Month":"2024-10","Total":"42.62","Invoices":"7"},{"Month":"2024-11","Total":"37.62","Invoices":"7"},{"Month":"2024-12","Total":"37.62","Invoices":"7"},{"Month":"2025-01","Total":"37.62","Invoices":"7"},{"Month":"2025-02","Total":"27.72","Invoices":"5"},{"Month":"2025-03","Total":"37.62","Invoices":"7"},{"Month":"2025-04","Total":"33.66","Invoices":"5"},{"Month":"2025-05","Total":"37.62","Invoices":"7"},{"Month":"2025-06","Total":"37.62","Invoices":"7"},{"Month":"2025-07","Total":"37.62","Invoices":"7"},{"Month":"2025-08","Total":"37.62","Invoices":"7"},{"Month":"2025-09","Total":"37.62","Invoices":"7"},{"Month":"2025-10","Total":"37.62","Invoices":"7"},{"Month":"2025-11","Total":"49.62","Invoices":"7"},{"Month":"2025-12","Total":"38.62","Invoices":"7"}]},"config":{"chartType":"line","labelColumn":"Month","dataColumn_Total":true,"dataColumn_Invoices":false,"truncateFrom":"begin","dataColumn_Month":false,"dataColumnColor_Total":"gold"}} \ No newline at end of file diff --git a/e2e-tests/data/files/charts/pie-chart b/e2e-tests/data/files/charts/pie-chart new file mode 100644 index 000000000..83293c335 --- /dev/null +++ b/e2e-tests/data/files/charts/pie-chart @@ -0,0 +1 @@ +{"data":{"structure":{"columns":[{"columnName":"OS"},{"columnName":"Downloads"}]},"rows":[{"OS":"Windows","Downloads":1724},{"OS":"MaxOS","Downloads":711},{"OS":"Linux","Downloads":445},{"OS":"iOS","Downloads":105},{"OS":"Android","Downloads":77}]},"config":{"chartType":"pie","labelColumn":"OS","dataColumn_Downloads":true,"showRelativeValues":false}} \ No newline at end of file diff --git a/e2e-tests/data/files/diagrams/chinook-diagram b/e2e-tests/data/files/diagrams/chinook-diagram new file mode 100644 index 000000000..44f479c10 --- /dev/null +++ b/e2e-tests/data/files/diagrams/chinook-diagram @@ -0,0 +1 @@ +{"tables":[{"pureName":"Playlist","tableRowCount":"18","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Playlist","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Playlist","notNull":true,"autoIncrement":true,"columnName":"PlaylistId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Playlist","notNull":false,"autoIncrement":false,"columnName":"Name","columnComment":"","dataType":"varchar(120)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Playlist","constraintType":"primaryKey","columns":[{"columnName":"PlaylistId"}]},"foreignKeys":[],"indexes":[],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_PlaylistTrackPlaylistId","constraintType":"foreignKey","pureName":"PlaylistTrack","refTableName":"Playlist","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"PlaylistId","refColumnName":"PlaylistId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Playlist-f819d546-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":330.2477855559807,"top":50,"isSelectedTable":false},{"pureName":"Artist","tableRowCount":"72","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Artist","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Artist","notNull":true,"autoIncrement":true,"columnName":"ArtistId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Artist","notNull":false,"autoIncrement":false,"columnName":"Name","columnComment":"","dataType":"varchar(120)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Artist","constraintType":"primaryKey","columns":[{"columnName":"ArtistId"}]},"foreignKeys":[],"indexes":[],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_AlbumArtistId","constraintType":"foreignKey","pureName":"Album","refTableName":"Artist","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"ArtistId","refColumnName":"ArtistId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Artist-f819d549-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":461.6979079121212,"top":578.4440568057845,"isSelectedTable":false},{"pureName":"PlaylistTrack","tableRowCount":"8715","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:50","objectId":"PlaylistTrack","contentHash":"2025-01-29 07:24:50","columns":[{"pureName":"PlaylistTrack","notNull":true,"autoIncrement":false,"columnName":"PlaylistId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"PlaylistTrack","notNull":true,"autoIncrement":false,"columnName":"TrackId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"PlaylistTrack","constraintType":"primaryKey","columns":[{"columnName":"PlaylistId"},{"columnName":"TrackId"}]},"foreignKeys":[{"constraintName":"FK_PlaylistTrackPlaylistId","constraintType":"foreignKey","pureName":"PlaylistTrack","refTableName":"Playlist","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"PlaylistId","refColumnName":"PlaylistId"}]},{"constraintName":"FK_PlaylistTrackTrackId","constraintType":"foreignKey","pureName":"PlaylistTrack","refTableName":"Track","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"TrackId","refColumnName":"TrackId"}]}],"indexes":[{"constraintName":"IFK_PlaylistTrackTrackId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"TrackId","isDescending":0}],"pureName":"PlaylistTrack","constraintType":"index"},{"constraintName":"IFK_PlaylistTrackPlaylistId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"PlaylistId","isDescending":0}],"pureName":"PlaylistTrack","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[],"objectTypeField":"tables","checks":[],"designerId":"PlaylistTrack-f819d540-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":519.3066822945327,"top":128.96597874389724,"isSelectedTable":false,"tableColor":"red"},{"pureName":"Genre","tableRowCount":"25","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Genre","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Genre","notNull":true,"autoIncrement":true,"columnName":"GenreId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Genre","notNull":false,"autoIncrement":false,"columnName":"Name","columnComment":"","dataType":"varchar(120)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Genre","constraintType":"primaryKey","columns":[{"columnName":"GenreId"}]},"foreignKeys":[],"indexes":[],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_TrackGenreId","constraintType":"foreignKey","pureName":"Track","refTableName":"Genre","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"GenreId","refColumnName":"GenreId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Genre-f819d544-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":702.2712249807678,"top":337.52547727881785,"isSelectedTable":false,"tableColor":"red"},{"pureName":"Track","tableRowCount":"3483","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:50","objectId":"Track","contentHash":"2025-01-29 07:24:50","columns":[{"pureName":"Track","notNull":true,"autoIncrement":true,"columnName":"TrackId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":true,"autoIncrement":false,"columnName":"Name","columnComment":"","dataType":"varchar(200)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":false,"autoIncrement":false,"columnName":"AlbumId","columnComment":"","dataType":"int","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":true,"autoIncrement":false,"columnName":"MediaTypeId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":false,"autoIncrement":false,"columnName":"GenreId","columnComment":"","dataType":"int","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":false,"autoIncrement":false,"columnName":"Composer","columnComment":"","dataType":"varchar(220)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":true,"autoIncrement":false,"columnName":"Milliseconds","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":false,"autoIncrement":false,"columnName":"Bytes","columnComment":"","dataType":"int","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Track","notNull":true,"autoIncrement":false,"columnName":"UnitPrice","columnComment":"","dataType":"decimal(10,2)","defaultValue":null,"isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Track","constraintType":"primaryKey","columns":[{"columnName":"TrackId"}]},"foreignKeys":[{"constraintName":"FK_TrackGenreId","constraintType":"foreignKey","pureName":"Track","refTableName":"Genre","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"GenreId","refColumnName":"GenreId"}]},{"constraintName":"FK_TrackMediaTypeId","constraintType":"foreignKey","pureName":"Track","refTableName":"MediaType","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"MediaTypeId","refColumnName":"MediaTypeId"}]},{"constraintName":"FK_TrackAlbumId","constraintType":"foreignKey","pureName":"Track","refTableName":"Album","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"AlbumId","refColumnName":"AlbumId"}]}],"indexes":[{"constraintName":"IFK_TrackAlbumId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"AlbumId","isDescending":0}],"pureName":"Track","constraintType":"index"},{"constraintName":"IFK_TrackGenreId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"GenreId","isDescending":0}],"pureName":"Track","constraintType":"index"},{"constraintName":"IFK_TrackMediaTypeId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"MediaTypeId","isDescending":0}],"pureName":"Track","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_PlaylistTrackTrackId","constraintType":"foreignKey","pureName":"PlaylistTrack","refTableName":"Track","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"TrackId","refColumnName":"TrackId"}]},{"constraintName":"FK_InvoiceLineTrackId","constraintType":"foreignKey","pureName":"InvoiceLine","refTableName":"Track","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"TrackId","refColumnName":"TrackId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Track-f819d542-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":487.62692408212285,"top":298.61989768712215,"isSelectedTable":false,"tableColor":"red"},{"pureName":"MediaType","tableRowCount":"5","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"MediaType","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"MediaType","notNull":true,"autoIncrement":true,"columnName":"MediaTypeId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"MediaType","notNull":false,"autoIncrement":false,"columnName":"Name","columnComment":"","dataType":"varchar(120)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"MediaType","constraintType":"primaryKey","columns":[{"columnName":"MediaTypeId"}]},"foreignKeys":[],"indexes":[],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_TrackMediaTypeId","constraintType":"foreignKey","pureName":"Track","refTableName":"MediaType","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"MediaTypeId","refColumnName":"MediaTypeId"}]}],"objectTypeField":"tables","checks":[],"designerId":"MediaType-f819d541-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":701.1259844900316,"top":203.52547727881785,"isSelectedTable":false,"tableColor":"red"},{"pureName":"Album","tableRowCount":"347","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Album","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Album","notNull":true,"autoIncrement":true,"columnName":"AlbumId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Album","notNull":true,"autoIncrement":false,"columnName":"Title","columnComment":"","dataType":"varchar(160)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Album","notNull":true,"autoIncrement":false,"columnName":"ArtistId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Album","constraintType":"primaryKey","columns":[{"columnName":"AlbumId"}]},"foreignKeys":[{"constraintName":"FK_AlbumArtistId","constraintType":"foreignKey","pureName":"Album","refTableName":"Artist","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"ArtistId","refColumnName":"ArtistId"}]}],"indexes":[{"constraintName":"IFK_AlbumArtistId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"ArtistId","isDescending":0}],"pureName":"Album","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_TrackAlbumId","constraintType":"foreignKey","pureName":"Track","refTableName":"Album","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"AlbumId","refColumnName":"AlbumId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Album-f819d545-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":643.038502375111,"top":588.9112756934792,"isSelectedTable":false,"tableColor":"red"},{"pureName":"InvoiceLine","tableRowCount":"2240","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"InvoiceLine","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"InvoiceLine","notNull":true,"autoIncrement":true,"columnName":"InvoiceLineId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"InvoiceLine","notNull":true,"autoIncrement":false,"columnName":"InvoiceId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"InvoiceLine","notNull":true,"autoIncrement":false,"columnName":"TrackId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"InvoiceLine","notNull":true,"autoIncrement":false,"columnName":"UnitPrice","columnComment":"","dataType":"decimal(10,2)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"InvoiceLine","notNull":true,"autoIncrement":false,"columnName":"Quantity","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"InvoiceLine","constraintType":"primaryKey","columns":[{"columnName":"InvoiceLineId"}]},"foreignKeys":[{"constraintName":"FK_InvoiceLineTrackId","constraintType":"foreignKey","pureName":"InvoiceLine","refTableName":"Track","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"TrackId","refColumnName":"TrackId"}]},{"constraintName":"FK_InvoiceLineInvoiceId","constraintType":"foreignKey","pureName":"InvoiceLine","refTableName":"Invoice","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"InvoiceId","refColumnName":"InvoiceId"}]}],"indexes":[{"constraintName":"IFK_InvoiceLineTrackId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"TrackId","isDescending":0}],"pureName":"InvoiceLine","constraintType":"index"},{"constraintName":"IFK_InvoiceLineInvoiceId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"InvoiceId","isDescending":0}],"pureName":"InvoiceLine","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[],"objectTypeField":"tables","checks":[],"designerId":"InvoiceLine-f819d548-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":281.42700158698983,"top":184.00000000000003,"isSelectedTable":false,"tableColor":"green"},{"pureName":"Invoice","tableRowCount":"412","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Invoice","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Invoice","notNull":true,"autoIncrement":true,"columnName":"InvoiceId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":true,"autoIncrement":false,"columnName":"CustomerId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":true,"autoIncrement":false,"columnName":"InvoiceDate","columnComment":"","dataType":"datetime","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":false,"autoIncrement":false,"columnName":"BillingAddress","columnComment":"","dataType":"varchar(70)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":false,"autoIncrement":false,"columnName":"BillingCity","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":false,"autoIncrement":false,"columnName":"BillingState","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":false,"autoIncrement":false,"columnName":"BillingCountry","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":false,"autoIncrement":false,"columnName":"BillingPostalCode","columnComment":"","dataType":"varchar(10)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Invoice","notNull":true,"autoIncrement":false,"columnName":"Total","columnComment":"","dataType":"decimal(10,2)","defaultValue":null,"isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Invoice","constraintType":"primaryKey","columns":[{"columnName":"InvoiceId"}]},"foreignKeys":[{"constraintName":"FK_InvoiceCustomerId","constraintType":"foreignKey","pureName":"Invoice","refTableName":"Customer","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"CustomerId","refColumnName":"CustomerId"}]}],"indexes":[{"constraintName":"IFK_InvoiceCustomerId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"CustomerId","isDescending":0}],"pureName":"Invoice","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_InvoiceLineInvoiceId","constraintType":"foreignKey","pureName":"InvoiceLine","refTableName":"Invoice","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"InvoiceId","refColumnName":"InvoiceId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Invoice-f819d543-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":50.15677353968084,"top":130.3014341536835,"isSelectedTable":false,"tableColor":"green"},{"pureName":"Employee","tableRowCount":"8","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Employee","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Employee","notNull":true,"autoIncrement":true,"columnName":"EmployeeId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":true,"autoIncrement":false,"columnName":"LastName","columnComment":"","dataType":"varchar(20)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":true,"autoIncrement":false,"columnName":"FirstName","columnComment":"","dataType":"varchar(20)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"Title","columnComment":"","dataType":"varchar(30)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"ReportsTo","columnComment":"","dataType":"int","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"BirthDate","columnComment":"","dataType":"datetime","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"HireDate","columnComment":"","dataType":"datetime","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"Address","columnComment":"","dataType":"varchar(70)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"City","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"State","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"Country","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"PostalCode","columnComment":"","dataType":"varchar(10)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"Phone","columnComment":"","dataType":"varchar(24)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"Fax","columnComment":"","dataType":"varchar(24)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Employee","notNull":false,"autoIncrement":false,"columnName":"Email","columnComment":"","dataType":"varchar(60)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Employee","constraintType":"primaryKey","columns":[{"columnName":"EmployeeId"}]},"foreignKeys":[{"constraintName":"FK_EmployeeReportsTo","constraintType":"foreignKey","pureName":"Employee","refTableName":"Employee","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"ReportsTo","refColumnName":"EmployeeId"}]}],"indexes":[{"constraintName":"IFK_EmployeeReportsTo","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"ReportsTo","isDescending":0}],"pureName":"Employee","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_CustomerSupportRepId","constraintType":"foreignKey","pureName":"Customer","refTableName":"Employee","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"SupportRepId","refColumnName":"EmployeeId"}]},{"constraintName":"FK_EmployeeReportsTo","constraintType":"foreignKey","pureName":"Employee","refTableName":"Employee","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"ReportsTo","refColumnName":"EmployeeId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Employee-f819d54a-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":263.62981838986,"top":454.1023094743517,"isSelectedTable":true,"tableColor":"purple"},{"pureName":"Customer","tableRowCount":"59","tableEngine":"InnoDB","objectComment":"","modifyDate":"2025-01-29 07:24:49","objectId":"Customer","contentHash":"2025-01-29 07:24:49","columns":[{"pureName":"Customer","notNull":true,"autoIncrement":true,"columnName":"CustomerId","columnComment":"","dataType":"int","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":true,"autoIncrement":false,"columnName":"FirstName","columnComment":"","dataType":"varchar(40)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":true,"autoIncrement":false,"columnName":"LastName","columnComment":"","dataType":"varchar(20)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"Company","columnComment":"","dataType":"varchar(80)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"Address","columnComment":"","dataType":"varchar(70)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"City","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"State","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"Country","columnComment":"","dataType":"varchar(40)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"PostalCode","columnComment":"","dataType":"varchar(10)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"Phone","columnComment":"","dataType":"varchar(24)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"Fax","columnComment":"","dataType":"varchar(24)","defaultValue":"NULL","isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":true,"autoIncrement":false,"columnName":"Email","columnComment":"","dataType":"varchar(60)","defaultValue":null,"isUnsigned":false,"isZerofill":false},{"pureName":"Customer","notNull":false,"autoIncrement":false,"columnName":"SupportRepId","columnComment":"","dataType":"int","defaultValue":"NULL","isUnsigned":false,"isZerofill":false}],"primaryKey":{"constraintName":"PRIMARY","pureName":"Customer","constraintType":"primaryKey","columns":[{"columnName":"CustomerId"}]},"foreignKeys":[{"constraintName":"FK_CustomerSupportRepId","constraintType":"foreignKey","pureName":"Customer","refTableName":"Employee","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"SupportRepId","refColumnName":"EmployeeId"}]}],"indexes":[{"constraintName":"IFK_CustomerSupportRepId","indexType":"BTREE","isUnique":false,"columns":[{"columnName":"SupportRepId","isDescending":0}],"pureName":"Customer","constraintType":"index"}],"uniques":[],"engine":"mysql@dbgate-plugin-mysql","dependencies":[{"constraintName":"FK_InvoiceCustomerId","constraintType":"foreignKey","pureName":"Invoice","refTableName":"Customer","updateAction":"NO ACTION","deleteAction":"NO ACTION","columns":[{"columnName":"CustomerId","refColumnName":"CustomerId"}]}],"objectTypeField":"tables","checks":[],"designerId":"Customer-f819d547-deee-11ef-8c42-4199facf3ba8","autoAddReferences":false,"needsArrange":false,"left":50,"top":433.13715736002416,"isSelectedTable":true,"tableColor":"purple"}],"references":[{"designerId":"f81ce280-deee-11ef-8c42-4199facf3ba8","sourceId":"PlaylistTrack-f819d540-deee-11ef-8c42-4199facf3ba8","targetId":"Playlist-f819d546-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"PlaylistId","target":"PlaylistId"}]},{"designerId":"f81ce281-deee-11ef-8c42-4199facf3ba8","sourceId":"PlaylistTrack-f819d540-deee-11ef-8c42-4199facf3ba8","targetId":"Track-f819d542-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"TrackId","target":"TrackId"}]},{"designerId":"f81ce282-deee-11ef-8c42-4199facf3ba8","sourceId":"Track-f819d542-deee-11ef-8c42-4199facf3ba8","targetId":"Genre-f819d544-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"GenreId","target":"GenreId"}]},{"designerId":"f81ce283-deee-11ef-8c42-4199facf3ba8","sourceId":"Track-f819d542-deee-11ef-8c42-4199facf3ba8","targetId":"MediaType-f819d541-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"MediaTypeId","target":"MediaTypeId"}]},{"designerId":"f81ce284-deee-11ef-8c42-4199facf3ba8","sourceId":"Track-f819d542-deee-11ef-8c42-4199facf3ba8","targetId":"Album-f819d545-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"AlbumId","target":"AlbumId"}]},{"designerId":"f81ce285-deee-11ef-8c42-4199facf3ba8","sourceId":"Invoice-f819d543-deee-11ef-8c42-4199facf3ba8","targetId":"Customer-f819d547-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"CustomerId","target":"CustomerId"}]},{"designerId":"f81ce286-deee-11ef-8c42-4199facf3ba8","sourceId":"Album-f819d545-deee-11ef-8c42-4199facf3ba8","targetId":"Artist-f819d549-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"ArtistId","target":"ArtistId"}]},{"designerId":"f81ce287-deee-11ef-8c42-4199facf3ba8","sourceId":"Customer-f819d547-deee-11ef-8c42-4199facf3ba8","targetId":"Employee-f819d54a-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"SupportRepId","target":"EmployeeId"}]},{"designerId":"f81ce288-deee-11ef-8c42-4199facf3ba8","sourceId":"InvoiceLine-f819d548-deee-11ef-8c42-4199facf3ba8","targetId":"Track-f819d542-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"TrackId","target":"TrackId"}]},{"designerId":"f81ce289-deee-11ef-8c42-4199facf3ba8","sourceId":"InvoiceLine-f819d548-deee-11ef-8c42-4199facf3ba8","targetId":"Invoice-f819d543-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"InvoiceId","target":"InvoiceId"}]},{"designerId":"f81ce28a-deee-11ef-8c42-4199facf3ba8","sourceId":"Employee-f819d54a-deee-11ef-8c42-4199facf3ba8","targetId":"Employee-f819d54a-deee-11ef-8c42-4199facf3ba8","joinType":"","columns":[{"source":"ReportsTo","target":"EmployeeId"}]}],"autoLayout":false,"columns":[{"designerId":"Employee-f819d54a-deee-11ef-8c42-4199facf3ba8","columnName":"FirstName"}]} \ No newline at end of file diff --git a/e2e-tests/data/files/query/customer b/e2e-tests/data/files/query/customer new file mode 100644 index 000000000..d2054485a --- /dev/null +++ b/e2e-tests/data/files/query/customer @@ -0,0 +1,592 @@ +{ + "tables": [ + { + "pureName": "InvoiceLine", + "tableRowCount": "2240", + "tableEngine": "InnoDB", + "objectComment": "", + "modifyDate": "2025-01-30 07:20:38", + "objectId": "InvoiceLine", + "contentHash": "2025-01-30 07:20:38", + "columns": [ + { + "pureName": "InvoiceLine", + "notNull": true, + "autoIncrement": true, + "columnName": "InvoiceLineId", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "InvoiceLine", + "notNull": true, + "autoIncrement": false, + "columnName": "InvoiceId", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "InvoiceLine", + "notNull": true, + "autoIncrement": false, + "columnName": "TrackId", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "InvoiceLine", + "notNull": true, + "autoIncrement": false, + "columnName": "UnitPrice", + "columnComment": "", + "dataType": "decimal(10,2)", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "InvoiceLine", + "notNull": true, + "autoIncrement": false, + "columnName": "Quantity", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + } + ], + "primaryKey": { + "constraintName": "PRIMARY", + "pureName": "InvoiceLine", + "constraintType": "primaryKey", + "columns": [ + { + "columnName": "InvoiceLineId" + } + ] + }, + "foreignKeys": [ + { + "constraintName": "FK_InvoiceLineInvoiceId", + "constraintType": "foreignKey", + "pureName": "InvoiceLine", + "refTableName": "Invoice", + "updateAction": "NO ACTION", + "deleteAction": "NO ACTION", + "columns": [ + { + "columnName": "InvoiceId", + "refColumnName": "InvoiceId" + } + ] + }, + { + "constraintName": "FK_InvoiceLineTrackId", + "constraintType": "foreignKey", + "pureName": "InvoiceLine", + "refTableName": "Track", + "updateAction": "NO ACTION", + "deleteAction": "NO ACTION", + "columns": [ + { + "columnName": "TrackId", + "refColumnName": "TrackId" + } + ] + } + ], + "indexes": [ + { + "constraintName": "IFK_InvoiceLineInvoiceId", + "indexType": "BTREE", + "isUnique": false, + "columns": [ + { + "columnName": "InvoiceId", + "isDescending": 0 + } + ], + "pureName": "InvoiceLine", + "constraintType": "index" + }, + { + "constraintName": "IFK_InvoiceLineTrackId", + "indexType": "BTREE", + "isUnique": false, + "columns": [ + { + "columnName": "TrackId", + "isDescending": 0 + } + ], + "pureName": "InvoiceLine", + "constraintType": "index" + } + ], + "uniques": [], + "engine": "mysql@dbgate-plugin-mysql", + "dependencies": [], + "objectTypeField": "tables", + "checks": [], + "conid": "mysql", + "database": "MyChinook", + "designerId": "InvoiceLine-61eb0ba0-dedc-11ef-acf9-b7e3c0869b02", + "left": 513, + "top": 247, + "alias": null + }, + { + "pureName": "Customer", + "tableRowCount": "59", + "tableEngine": "InnoDB", + "objectComment": "", + "modifyDate": "2025-01-30 07:20:37", + "objectId": "Customer", + "contentHash": "2025-01-30 07:20:37", + "columns": [ + { + "pureName": "Customer", + "notNull": true, + "autoIncrement": true, + "columnName": "CustomerId", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": true, + "autoIncrement": false, + "columnName": "FirstName", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": true, + "autoIncrement": false, + "columnName": "LastName", + "columnComment": "", + "dataType": "varchar(20)", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "Company", + "columnComment": "", + "dataType": "varchar(80)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "Address", + "columnComment": "", + "dataType": "varchar(70)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "City", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "State", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "Country", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "PostalCode", + "columnComment": "", + "dataType": "varchar(10)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "Phone", + "columnComment": "", + "dataType": "varchar(24)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "Fax", + "columnComment": "", + "dataType": "varchar(24)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": true, + "autoIncrement": false, + "columnName": "Email", + "columnComment": "", + "dataType": "varchar(60)", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Customer", + "notNull": false, + "autoIncrement": false, + "columnName": "SupportRepId", + "columnComment": "", + "dataType": "int", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + } + ], + "primaryKey": { + "constraintName": "PRIMARY", + "pureName": "Customer", + "constraintType": "primaryKey", + "columns": [ + { + "columnName": "CustomerId" + } + ] + }, + "foreignKeys": [ + { + "constraintName": "FK_CustomerSupportRepId", + "constraintType": "foreignKey", + "pureName": "Customer", + "refTableName": "Employee", + "updateAction": "NO ACTION", + "deleteAction": "NO ACTION", + "columns": [ + { + "columnName": "SupportRepId", + "refColumnName": "EmployeeId" + } + ] + } + ], + "indexes": [ + { + "constraintName": "IFK_CustomerSupportRepId", + "indexType": "BTREE", + "isUnique": false, + "columns": [ + { + "columnName": "SupportRepId", + "isDescending": 0 + } + ], + "pureName": "Customer", + "constraintType": "index" + } + ], + "uniques": [], + "engine": "mysql@dbgate-plugin-mysql", + "dependencies": [ + { + "constraintName": "FK_InvoiceCustomerId", + "constraintType": "foreignKey", + "pureName": "Invoice", + "refTableName": "Customer", + "updateAction": "NO ACTION", + "deleteAction": "NO ACTION", + "columns": [ + { + "columnName": "CustomerId", + "refColumnName": "CustomerId" + } + ] + } + ], + "objectTypeField": "tables", + "checks": [], + "conid": "mysql", + "database": "MyChinook", + "designerId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02", + "left": 50, + "top": 50 + }, + { + "pureName": "Invoice", + "tableRowCount": "412", + "tableEngine": "InnoDB", + "objectComment": "", + "modifyDate": "2025-01-30 07:20:38", + "objectId": "Invoice", + "contentHash": "2025-01-30 07:20:38", + "columns": [ + { + "pureName": "Invoice", + "notNull": true, + "autoIncrement": true, + "columnName": "InvoiceId", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": true, + "autoIncrement": false, + "columnName": "CustomerId", + "columnComment": "", + "dataType": "int", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": true, + "autoIncrement": false, + "columnName": "InvoiceDate", + "columnComment": "", + "dataType": "datetime", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": false, + "autoIncrement": false, + "columnName": "BillingAddress", + "columnComment": "", + "dataType": "varchar(70)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": false, + "autoIncrement": false, + "columnName": "BillingCity", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": false, + "autoIncrement": false, + "columnName": "BillingState", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": false, + "autoIncrement": false, + "columnName": "BillingCountry", + "columnComment": "", + "dataType": "varchar(40)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": false, + "autoIncrement": false, + "columnName": "BillingPostalCode", + "columnComment": "", + "dataType": "varchar(10)", + "defaultValue": "NULL", + "isUnsigned": false, + "isZerofill": false + }, + { + "pureName": "Invoice", + "notNull": true, + "autoIncrement": false, + "columnName": "Total", + "columnComment": "", + "dataType": "decimal(10,2)", + "defaultValue": null, + "isUnsigned": false, + "isZerofill": false + } + ], + "primaryKey": { + "constraintName": "PRIMARY", + "pureName": "Invoice", + "constraintType": "primaryKey", + "columns": [ + { + "columnName": "InvoiceId" + } + ] + }, + "foreignKeys": [ + { + "constraintName": "FK_InvoiceCustomerId", + "constraintType": "foreignKey", + "pureName": "Invoice", + "refTableName": "Customer", + "updateAction": "NO ACTION", + "deleteAction": "NO ACTION", + "columns": [ + { + "columnName": "CustomerId", + "refColumnName": "CustomerId" + } + ] + } + ], + "indexes": [ + { + "constraintName": "IFK_InvoiceCustomerId", + "indexType": "BTREE", + "isUnique": false, + "columns": [ + { + "columnName": "CustomerId", + "isDescending": 0 + } + ], + "pureName": "Invoice", + "constraintType": "index" + } + ], + "uniques": [], + "engine": "mysql@dbgate-plugin-mysql", + "dependencies": [ + { + "constraintName": "FK_InvoiceLineInvoiceId", + "constraintType": "foreignKey", + "pureName": "InvoiceLine", + "refTableName": "Invoice", + "updateAction": "NO ACTION", + "deleteAction": "NO ACTION", + "columns": [ + { + "columnName": "InvoiceId", + "refColumnName": "InvoiceId" + } + ] + } + ], + "objectTypeField": "tables", + "checks": [], + "conid": "mysql", + "database": "MyChinook", + "designerId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02", + "left": 279, + "top": 112, + "alias": null + } + ], + "references": [ + { + "designerId": "undefined-609cb9b1-dedc-11ef-acf9-b7e3c0869b02", + "sourceId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02", + "targetId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02", + "joinType": "INNER JOIN", + "columns": [ + { + "source": "CustomerId", + "target": "CustomerId" + } + ] + }, + { + "designerId": "undefined-61eb32b0-dedc-11ef-acf9-b7e3c0869b02", + "sourceId": "InvoiceLine-61eb0ba0-dedc-11ef-acf9-b7e3c0869b02", + "targetId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02", + "joinType": "LEFT JOIN", + "columns": [ + { + "source": "InvoiceId", + "target": "InvoiceId" + } + ] + } + ], + "columns": [ + { + "designerId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02", + "columnName": "LastName", + "isOutput": true, + "filter": "NOT NULL", + "sortOrder": 1 + }, + { + "designerId": "5d82f690-dedc-11ef-acf9-b7e3c0869b02", + "columnName": "FirstName", + "isOutput": true, + "sortOrder": 2 + }, + { + "designerId": "Invoice-609cb9b0-dedc-11ef-acf9-b7e3c0869b02", + "columnName": "InvoiceDate", + "isOutput": true + } + ] +} diff --git a/e2e-tests/e2eTestTools.js b/e2e-tests/e2eTestTools.js index bd790fea4..417670d8e 100644 --- a/e2e-tests/e2eTestTools.js +++ b/e2e-tests/e2eTestTools.js @@ -22,6 +22,12 @@ function clearTestingData() { if (fs.existsSync(path.join(baseDir, 'connections-e2etests.jsonl'))) { fs.unlinkSync(path.join(baseDir, 'connections-e2etests.jsonl')); } + if (fs.existsSync(path.join(baseDir, 'files-e2etests'))) { + fs.rmdirSync(path.join(baseDir, 'files-e2etests'), { recursive: true }); + } + if (fs.existsSync(path.join(baseDir, 'archive-e2etests'))) { + fs.rmdirSync(path.join(baseDir, 'archive-e2etests'), { recursive: true }); + } } module.exports = { diff --git a/e2e-tests/init/browse-data.js b/e2e-tests/init/browse-data.js index ab25c1ba1..600a2f30e 100644 --- a/e2e-tests/init/browse-data.js +++ b/e2e-tests/init/browse-data.js @@ -1,5 +1,6 @@ const path = require('path'); const fs = require('fs'); +const os = require('os'); const dbgateApi = require('dbgate-api'); dbgateApi.initializeApiEnvironment(); @@ -164,6 +165,17 @@ async function initRedisDatabase(inputDirectory) { // }); } +const baseDir = path.join(os.homedir(), '.dbgate'); + +async function copyFolder(source, target) { + if (!fs.existsSync(target)) { + fs.mkdirSync(target, { recursive: true }); + } + for (const file of fs.readdirSync(source)) { + fs.copyFileSync(path.join(source, file), path.join(target, file)); + } +} + async function run() { await initMySqlDatabase('MyChinook', path.resolve(path.join(__dirname, '../data/chinook-mysql.sql'))); // await initMySqlDatabase('Northwind', path.resolve(path.join(__dirname, '../data/northwind-mysql.sql'))); @@ -171,9 +183,29 @@ async function run() { await initPostgresDatabase('PgChinook', path.resolve(path.join(__dirname, '../data/chinook-postgres.sql'))); - await initMongoDatabase('MgChinook', path.resolve(path.join(__dirname, '../data/mongo'))); + await initMongoDatabase('MgChinook', path.resolve(path.join(__dirname, '../data/chinook-jsonl'))); await initRedisDatabase(path.resolve(path.join(__dirname, '../data/redis'))); + + await copyFolder( + path.resolve(path.join(__dirname, '../data/chinook-jsonl')), + path.join(baseDir, 'archive-e2etests', 'default') + ); + + await copyFolder( + path.resolve(path.join(__dirname, '../data/files/query')), + path.join(baseDir, 'files-e2etests', 'query') + ); + + await copyFolder( + path.resolve(path.join(__dirname, '../data/files/diagrams')), + path.join(baseDir, 'files-e2etests', 'diagrams') + ); + + await copyFolder( + path.resolve(path.join(__dirname, '../data/files/charts')), + path.join(baseDir, 'files-e2etests', 'charts') + ); } dbgateApi.runScript(run); diff --git a/e2e-tests/package.json b/e2e-tests/package.json index 059b7ca43..04b0e2494 100644 --- a/e2e-tests/package.json +++ b/e2e-tests/package.json @@ -14,18 +14,16 @@ }, "scripts": { "cy:open": "cypress open --config experimentalInteractiveRunEvents=true", - "cy:run:add-connection": "cypress run --spec cypress/e2e/add-connection.cy.js", "cy:run:portal": "cypress run --spec cypress/e2e/portal.cy.js", "cy:run:oauth": "cypress run --spec cypress/e2e/oauth.cy.js", "cy:run:browse-data": "cypress run --spec cypress/e2e/browse-data.cy.js", - "start:add-connection": "cd .. && node packer/build/bundle.js --listen-api --run-e2e-tests", "start:portal": "cd .. && env-cmd -f e2e-tests/env/portal/.env node e2e-tests/init/portal.js && env-cmd -f e2e-tests/env/portal/.env node packer/build/bundle.js --listen-api --run-e2e-tests", "start:oauth": "cd .. && env-cmd -f e2e-tests/env/oauth/.env node packer/build/bundle.js --listen-api --run-e2e-tests", "start:browse-data": "cd .. && env-cmd -f e2e-tests/env/browse-data/.env node e2e-tests/init/browse-data.js && env-cmd -f e2e-tests/env/browse-data/.env node packer/build/bundle.js --listen-api --run-e2e-tests", - "test": "start-server-and-test start:add-connection http://localhost:3000 cy:run:add-connection && start-server-and-test start:portal http://localhost:3000 cy:run:portal && start-server-and-test start:oauth http://localhost:3000 cy:run:oauth && start-server-and-test start:browse-data http://localhost:3000 cy:run:browse-data", "test:ci": "yarn test" - } + }, + "dependencies": {} } diff --git a/packages/api/src/utility/directories.js b/packages/api/src/utility/directories.js index 7ddac98e6..1038382f3 100644 --- a/packages/api/src/utility/directories.js +++ b/packages/api/src/utility/directories.js @@ -59,10 +59,10 @@ const rundir = dirFunc('run', true); const uploadsdir = dirFunc('uploads', true); const pluginsdir = dirFunc('plugins'); const archivedir = processArgs.runE2eTests - ? dirFunc('archive-e2etests', true, ['default']) + ? dirFunc('archive-e2etests', false, ['default']) : dirFunc('archive', false, ['default']); const appdir = dirFunc('apps'); -const filesdir = dirFunc('files'); +const filesdir = processArgs.runE2eTests ? dirFunc('files-e2etests') : dirFunc('files'); const logsdir = dirFunc('logs', 3600 * 24 * 7); function packagedPluginsDir() { diff --git a/packages/web/src/commands/CommandPalette.svelte b/packages/web/src/commands/CommandPalette.svelte index aea16a20a..7b9fa7a8c 100644 --- a/packages/web/src/commands/CommandPalette.svelte +++ b/packages/web/src/commands/CommandPalette.svelte @@ -162,6 +162,7 @@ on:clickOutside={() => { $visibleCommandPalette = null; }} + data-testid='CommandPalette_main' >
- +
diff --git a/packages/web/src/widgets/WidgetIconPanel.svelte b/packages/web/src/widgets/WidgetIconPanel.svelte index 1b7482368..8214d1953 100644 --- a/packages/web/src/widgets/WidgetIconPanel.svelte +++ b/packages/web/src/widgets/WidgetIconPanel.svelte @@ -100,7 +100,7 @@
{#if $visibleHamburgerMenuWidget} -
+
{/if} @@ -123,11 +123,12 @@ on:click={() => { $lockedDatabaseMode = !$lockedDatabaseMode; }} + data-testid="WidgetIconPanel_lockDb" >
-
+